]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Merged from mainline
authorheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 23 Jul 2013 13:01:18 +0000 (13:01 +0000)
committerheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 23 Jul 2013 13:01:18 +0000 (13:01 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@30130 0785d39b-7218-0410-832d-ea1e28bc413d

917 files changed:
deal.II/CMakeLists.txt
deal.II/LICENSE
deal.II/VERSION
deal.II/bundled/CMakeLists.txt
deal.II/bundled/boost-1.49.0/include/boost/thread/xtime.hpp
deal.II/bundled/boost-1.49.0/libs/serialization/src/CMakeLists.txt
deal.II/bundled/boost-1.49.0/libs/thread/example/starvephil.cpp
deal.II/bundled/boost-1.49.0/libs/thread/example/tennis.cpp
deal.II/bundled/boost-1.49.0/libs/thread/example/thread.cpp
deal.II/bundled/boost-1.49.0/libs/thread/example/xtime.cpp
deal.II/bundled/boost-1.49.0/libs/thread/src/CMakeLists.txt
deal.II/bundled/boost-1.49.0/libs/thread/src/pthread/thread.cpp
deal.II/bundled/boost-1.49.0/libs/thread/src/pthread/timeconv.inl
deal.II/bundled/boost-1.49.0/libs/thread/src/win32/timeconv.inl
deal.II/bundled/functionparser/CMakeLists.txt
deal.II/bundled/tbb41_20130401oss/src/CMakeLists.txt
deal.II/bundled/umfpack/AMD/Source/CMakeLists.txt
deal.II/bundled/umfpack/UMFPACK/Source/CMakeLists.txt
deal.II/cmake/TODO.CMAKE [deleted file]
deal.II/cmake/checks/check_01_compiler_features.cmake
deal.II/cmake/checks/check_01_cpu_features.cmake
deal.II/cmake/checks/check_01_cxx_features.cmake
deal.II/cmake/checks/check_02_system_features.cmake
deal.II/cmake/checks/check_03_compiler_bugs.cmake
deal.II/cmake/config/CMakeLists.txt
deal.II/cmake/config/Config.cmake.in
deal.II/cmake/configure/configure_1_lapack.cmake
deal.II/cmake/configure/configure_1_mpi.cmake
deal.II/cmake/configure/configure_1_threads.cmake
deal.II/cmake/configure/configure_1_umfpack.cmake
deal.II/cmake/configure/configure_2_metis.cmake [moved from deal.II/cmake/configure/configure_metis.cmake with 51% similarity]
deal.II/cmake/configure/configure_2_petsc.cmake [moved from deal.II/cmake/configure/configure_petsc.cmake with 66% similarity]
deal.II/cmake/configure/configure_2_trilinos.cmake [moved from deal.II/cmake/configure/configure_trilinos.cmake with 74% similarity]
deal.II/cmake/configure/configure_arpack.cmake
deal.II/cmake/configure/configure_boost.cmake
deal.II/cmake/configure/configure_functionparser.cmake
deal.II/cmake/configure/configure_hdf5.cmake
deal.II/cmake/configure/configure_mumps.cmake
deal.II/cmake/configure/configure_netcdf.cmake
deal.II/cmake/configure/configure_p4est.cmake
deal.II/cmake/configure/configure_slepc.cmake
deal.II/cmake/configure/configure_zlib.cmake
deal.II/cmake/macros/macro_add_flags.cmake
deal.II/cmake/macros/macro_check_cxx_compiler_bug.cmake
deal.II/cmake/macros/macro_cond_set_to_yes.cmake
deal.II/cmake/macros/macro_configure_feature.cmake
deal.II/cmake/macros/macro_deal_ii_add_definitions.cmake
deal.II/cmake/macros/macro_deal_ii_add_dependencies.cmake
deal.II/cmake/macros/macro_deal_ii_add_library.cmake
deal.II/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake
deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
deal.II/cmake/macros/macro_deal_ii_setup_target.cmake
deal.II/cmake/macros/macro_enable_if_links.cmake
deal.II/cmake/macros/macro_enable_if_supported.cmake
deal.II/cmake/macros/macro_enable_language_optional.cmake [new file with mode: 0644]
deal.II/cmake/macros/macro_expand_instantiations.cmake
deal.II/cmake/macros/macro_find_package.cmake
deal.II/cmake/macros/macro_item_matches.cmake
deal.II/cmake/macros/macro_pop_test_flag.cmake
deal.II/cmake/macros/macro_push_test_flag.cmake
deal.II/cmake/macros/macro_replace_flag.cmake
deal.II/cmake/macros/macro_set_if_empty.cmake
deal.II/cmake/macros/macro_split_debug_release.cmake
deal.II/cmake/macros/macro_strip_flag.cmake
deal.II/cmake/macros/macro_switch_library_preference.cmake [new file with mode: 0644]
deal.II/cmake/macros/macro_to_string.cmake
deal.II/cmake/macros/macro_to_string_and_add_prefix.cmake
deal.II/cmake/modules/FindARPACK.cmake
deal.II/cmake/modules/FindHDF5.cmake
deal.II/cmake/modules/FindMETIS.cmake
deal.II/cmake/modules/FindMUMPS.cmake
deal.II/cmake/modules/FindNETCDF.cmake
deal.II/cmake/modules/FindP4EST.cmake
deal.II/cmake/modules/FindPETSC.cmake
deal.II/cmake/modules/FindSCALAPACK.cmake
deal.II/cmake/modules/FindSLEPC.cmake
deal.II/cmake/modules/FindTBB.cmake
deal.II/cmake/modules/FindTRILINOS.cmake
deal.II/cmake/modules/FindUMFPACK.cmake
deal.II/cmake/scripts/CMakeLists.txt
deal.II/cmake/scripts/expand_instantiations.cc
deal.II/cmake/scripts/make_dependencies.cc
deal.II/cmake/scripts/report_features.cc.in
deal.II/cmake/setup_cached_variables.cmake
deal.II/cmake/setup_compiler_flags.cmake
deal.II/cmake/setup_compiler_flags_gnu.cmake
deal.II/cmake/setup_compiler_flags_intel.cmake
deal.II/cmake/setup_compiler_flags_msvc.cmake
deal.II/cmake/setup_custom_targets.cmake [deleted file]
deal.II/cmake/setup_deal_ii.cmake
deal.II/cmake/setup_external_macros.cmake
deal.II/cmake/setup_finalize.cmake
deal.II/contrib/CMakeLists.txt
deal.II/contrib/lapack_templates/example_custom_target.cmake
deal.II/contrib/lapack_templates/lapack_templates.pl
deal.II/contrib/mesh_conversion/CMakeLists.txt
deal.II/contrib/parameter_gui/CMakeLists.txt
deal.II/contrib/parameter_gui/README
deal.II/contrib/parameter_gui/browse_lineedit.cpp
deal.II/contrib/parameter_gui/browse_lineedit.h
deal.II/contrib/parameter_gui/info_message.cpp
deal.II/contrib/parameter_gui/info_message.h
deal.II/contrib/parameter_gui/main.cpp
deal.II/contrib/parameter_gui/mainwindow.cpp
deal.II/contrib/parameter_gui/mainwindow.h
deal.II/contrib/parameter_gui/parameter_delegate.cpp
deal.II/contrib/parameter_gui/parameter_delegate.h
deal.II/contrib/parameter_gui/xml_parameter_reader.cpp
deal.II/contrib/parameter_gui/xml_parameter_reader.h
deal.II/contrib/parameter_gui/xml_parameter_writer.cpp
deal.II/contrib/parameter_gui/xml_parameter_writer.h
deal.II/contrib/test_affinity/CMakeLists.txt [new file with mode: 0644]
deal.II/contrib/test_affinity/test_affinity.cc [new file with mode: 0644]
deal.II/doc/CMakeLists.txt
deal.II/doc/authors.html
deal.II/doc/development/Config.sample
deal.II/doc/development/cmake-internals.html
deal.II/doc/development/cmake.html
deal.II/doc/development/index.html
deal.II/doc/development/navbar.html
deal.II/doc/development/testsuite.html
deal.II/doc/doxygen/CMakeLists.txt
deal.II/doc/doxygen/header.html.in
deal.II/doc/doxygen/headers/boundary.h
deal.II/doc/doxygen/headers/coding_conventions.h
deal.II/doc/doxygen/headers/constraints.h
deal.II/doc/doxygen/headers/distributed.h
deal.II/doc/doxygen/headers/dofs.h
deal.II/doc/doxygen/headers/exceptions.h
deal.II/doc/doxygen/headers/fe.h
deal.II/doc/doxygen/headers/functions.h
deal.II/doc/doxygen/headers/geodynamics.h
deal.II/doc/doxygen/headers/geometry_and_primitives.h
deal.II/doc/doxygen/headers/global_dof_index.h [new file with mode: 0644]
deal.II/doc/doxygen/headers/glossary.h
deal.II/doc/doxygen/headers/grid.h
deal.II/doc/doxygen/headers/hp.h
deal.II/doc/doxygen/headers/instantiations.h
deal.II/doc/doxygen/headers/integrators.h
deal.II/doc/doxygen/headers/io.h
deal.II/doc/doxygen/headers/iterators.h
deal.II/doc/doxygen/headers/lac.h
deal.II/doc/doxygen/headers/main.h
deal.II/doc/doxygen/headers/matrices.h
deal.II/doc/doxygen/headers/memory.h
deal.II/doc/doxygen/headers/mesh_worker.h
deal.II/doc/doxygen/headers/mg.h
deal.II/doc/doxygen/headers/multithreading.h
deal.II/doc/doxygen/headers/namespace_dealii.h
deal.II/doc/doxygen/headers/numerical_algorithms.h
deal.II/doc/doxygen/headers/parallel.h
deal.II/doc/doxygen/headers/petsc.h
deal.II/doc/doxygen/headers/polynomials.h
deal.II/doc/doxygen/headers/preconditioners.h
deal.II/doc/doxygen/headers/quadrature.h
deal.II/doc/doxygen/headers/slepc.h
deal.II/doc/doxygen/headers/solvers.h
deal.II/doc/doxygen/headers/std_cxx1x.h
deal.II/doc/doxygen/headers/trilinos.h
deal.II/doc/doxygen/headers/tutorial.h
deal.II/doc/doxygen/headers/update_flags.h
deal.II/doc/doxygen/headers/utilities.h
deal.II/doc/doxygen/headers/vector_memory.h
deal.II/doc/doxygen/headers/vector_valued.h
deal.II/doc/doxygen/headers/vectors.h
deal.II/doc/doxygen/images/CMakeLists.txt
deal.II/doc/doxygen/scripts/create_anchors
deal.II/doc/doxygen/scripts/intro2toc
deal.II/doc/doxygen/scripts/make_step.pl
deal.II/doc/doxygen/scripts/program2doxygen
deal.II/doc/doxygen/scripts/program2doxyplain
deal.II/doc/doxygen/scripts/program2html
deal.II/doc/doxygen/scripts/program2plain
deal.II/doc/doxygen/scripts/program2toc
deal.II/doc/doxygen/tutorial/CMakeLists.txt
deal.II/doc/external-libs/mumps.html
deal.II/doc/external-libs/p4est.html
deal.II/doc/external-libs/petsc.html
deal.II/doc/external-libs/slepc.html
deal.II/doc/external-libs/trilinos.html
deal.II/doc/index.html
deal.II/doc/license/adjust.pl [new file with mode: 0644]
deal.II/doc/license/header-template
deal.II/doc/license/header-template.cmake [new file with mode: 0644]
deal.II/doc/license/replace.sh [new file with mode: 0755]
deal.II/doc/navbar.html
deal.II/doc/news/7.3.0-vs-8.0.0.h [new file with mode: 0644]
deal.II/doc/news/changes.h
deal.II/doc/news/news.html
deal.II/doc/publications/index.html
deal.II/doc/readme.html
deal.II/examples/CMakeLists.txt
deal.II/examples/doxygen/block_matrix_array.cc
deal.II/examples/doxygen/compressed_block_sparsity_pattern.cc
deal.II/examples/doxygen/product_matrix.cc
deal.II/examples/doxygen/theta_timestepping.cc
deal.II/examples/step-1/step-1.cc
deal.II/examples/step-10/step-10.cc
deal.II/examples/step-11/step-11.cc
deal.II/examples/step-12/step-12.cc
deal.II/examples/step-13/step-13.cc
deal.II/examples/step-14/step-14.cc
deal.II/examples/step-15/step-15.cc
deal.II/examples/step-16/step-16.cc
deal.II/examples/step-17/step-17.cc
deal.II/examples/step-18/step-18.cc
deal.II/examples/step-19/step-19.cc
deal.II/examples/step-2/step-2.cc
deal.II/examples/step-20/step-20.cc
deal.II/examples/step-21/step-21.cc
deal.II/examples/step-22/step-22.cc
deal.II/examples/step-23/step-23.cc
deal.II/examples/step-24/step-24.cc
deal.II/examples/step-25/step-25.cc
deal.II/examples/step-26/step-26.cc
deal.II/examples/step-27/step-27.cc
deal.II/examples/step-28/step-28.cc
deal.II/examples/step-29/step-29.cc
deal.II/examples/step-3/doc/intro.dox
deal.II/examples/step-3/doc/results.dox
deal.II/examples/step-3/step-3.cc
deal.II/examples/step-30/step-30.cc
deal.II/examples/step-31/doc/results.dox
deal.II/examples/step-31/step-31.cc
deal.II/examples/step-32/step-32.cc
deal.II/examples/step-33/step-33.cc
deal.II/examples/step-34/step-34.cc
deal.II/examples/step-35/step-35.cc
deal.II/examples/step-36/step-36.cc
deal.II/examples/step-37/step-37.cc
deal.II/examples/step-38/step-38.cc
deal.II/examples/step-39/step-39.cc
deal.II/examples/step-4/step-4.cc
deal.II/examples/step-40/doc/intro.dox
deal.II/examples/step-40/step-40.cc
deal.II/examples/step-41/step-41.cc
deal.II/examples/step-42/step-42.cc
deal.II/examples/step-43/doc/intro.dox
deal.II/examples/step-43/step-43.cc
deal.II/examples/step-44/step-44.cc
deal.II/examples/step-45/step-45.cc
deal.II/examples/step-46/step-46.cc
deal.II/examples/step-47/step-47.cc
deal.II/examples/step-48/step-48.cc
deal.II/examples/step-49/step-49.cc
deal.II/examples/step-5/step-5.cc
deal.II/examples/step-50/step-50.cc
deal.II/examples/step-6/step-6.cc
deal.II/examples/step-7/step-7.cc
deal.II/examples/step-8/step-8.cc
deal.II/examples/step-9/step-9.cc
deal.II/include/CMakeLists.txt
deal.II/include/deal.II/algorithms/newton.h
deal.II/include/deal.II/algorithms/newton.templates.h
deal.II/include/deal.II/algorithms/operator.h
deal.II/include/deal.II/algorithms/operator.templates.h
deal.II/include/deal.II/algorithms/theta_timestepping.h
deal.II/include/deal.II/algorithms/theta_timestepping.templates.h
deal.II/include/deal.II/algorithms/timestep_control.h
deal.II/include/deal.II/base/auto_derivative_function.h
deal.II/include/deal.II/base/conditional_ostream.h
deal.II/include/deal.II/base/config.h.in
deal.II/include/deal.II/base/convergence_table.h
deal.II/include/deal.II/base/data_out_base.h
deal.II/include/deal.II/base/derivative_form.h
deal.II/include/deal.II/base/event.h
deal.II/include/deal.II/base/exceptions.h
deal.II/include/deal.II/base/flow_function.h
deal.II/include/deal.II/base/function.h
deal.II/include/deal.II/base/function_bessel.h
deal.II/include/deal.II/base/function_derivative.h
deal.II/include/deal.II/base/function_lib.h
deal.II/include/deal.II/base/function_parser.h
deal.II/include/deal.II/base/function_time.h
deal.II/include/deal.II/base/geometry_info.h
deal.II/include/deal.II/base/index_set.h
deal.II/include/deal.II/base/job_identifier.h
deal.II/include/deal.II/base/logstream.h
deal.II/include/deal.II/base/memory_consumption.h
deal.II/include/deal.II/base/mg_level_object.h
deal.II/include/deal.II/base/mpi.h
deal.II/include/deal.II/base/multithread_info.h
deal.II/include/deal.II/base/named_data.h
deal.II/include/deal.II/base/numbers.h
deal.II/include/deal.II/base/parallel.h
deal.II/include/deal.II/base/parameter_handler.h
deal.II/include/deal.II/base/parsed_function.h
deal.II/include/deal.II/base/partitioner.h
deal.II/include/deal.II/base/path_search.h
deal.II/include/deal.II/base/point.h
deal.II/include/deal.II/base/polynomial.h
deal.II/include/deal.II/base/polynomial_space.h
deal.II/include/deal.II/base/polynomials_abf.h
deal.II/include/deal.II/base/polynomials_adini.h
deal.II/include/deal.II/base/polynomials_bdm.h
deal.II/include/deal.II/base/polynomials_nedelec.h
deal.II/include/deal.II/base/polynomials_p.h
deal.II/include/deal.II/base/polynomials_piecewise.h
deal.II/include/deal.II/base/polynomials_raviart_thomas.h
deal.II/include/deal.II/base/qprojector.h
deal.II/include/deal.II/base/quadrature.h
deal.II/include/deal.II/base/quadrature_lib.h
deal.II/include/deal.II/base/quadrature_selector.h
deal.II/include/deal.II/base/smartpointer.h
deal.II/include/deal.II/base/std_cxx1x/array.h
deal.II/include/deal.II/base/std_cxx1x/bind.h
deal.II/include/deal.II/base/std_cxx1x/condition_variable.h
deal.II/include/deal.II/base/std_cxx1x/function.h
deal.II/include/deal.II/base/std_cxx1x/mutex.h
deal.II/include/deal.II/base/std_cxx1x/shared_ptr.h
deal.II/include/deal.II/base/std_cxx1x/thread.h
deal.II/include/deal.II/base/std_cxx1x/tuple.h
deal.II/include/deal.II/base/std_cxx1x/type_traits.h
deal.II/include/deal.II/base/subscriptor.h
deal.II/include/deal.II/base/symmetric_tensor.h
deal.II/include/deal.II/base/synchronous_iterator.h
deal.II/include/deal.II/base/table.h
deal.II/include/deal.II/base/table_handler.h
deal.II/include/deal.II/base/table_indices.h
deal.II/include/deal.II/base/template_constraints.h
deal.II/include/deal.II/base/tensor.h
deal.II/include/deal.II/base/tensor_base.h
deal.II/include/deal.II/base/tensor_function.h
deal.II/include/deal.II/base/tensor_product_polynomials.h
deal.II/include/deal.II/base/tensor_product_polynomials_const.h
deal.II/include/deal.II/base/thread_local_storage.h
deal.II/include/deal.II/base/thread_management.h
deal.II/include/deal.II/base/timer.h
deal.II/include/deal.II/base/types.h
deal.II/include/deal.II/base/utilities.h
deal.II/include/deal.II/base/vector_slice.h
deal.II/include/deal.II/base/vectorization.h
deal.II/include/deal.II/base/work_stream.h
deal.II/include/deal.II/distributed/grid_refinement.h
deal.II/include/deal.II/distributed/solution_transfer.h
deal.II/include/deal.II/distributed/tria.h
deal.II/include/deal.II/dofs/block_info.h
deal.II/include/deal.II/dofs/dof_accessor.h
deal.II/include/deal.II/dofs/dof_accessor.templates.h
deal.II/include/deal.II/dofs/dof_faces.h
deal.II/include/deal.II/dofs/dof_handler.h
deal.II/include/deal.II/dofs/dof_handler_policy.h
deal.II/include/deal.II/dofs/dof_iterator_selector.h
deal.II/include/deal.II/dofs/dof_levels.h
deal.II/include/deal.II/dofs/dof_objects.h
deal.II/include/deal.II/dofs/dof_renumbering.h
deal.II/include/deal.II/dofs/dof_tools.h
deal.II/include/deal.II/dofs/function_map.h
deal.II/include/deal.II/dofs/number_cache.h
deal.II/include/deal.II/fe/block_mask.h
deal.II/include/deal.II/fe/component_mask.h
deal.II/include/deal.II/fe/fe.h
deal.II/include/deal.II/fe/fe_abf.h
deal.II/include/deal.II/fe/fe_base.h
deal.II/include/deal.II/fe/fe_bdm.h
deal.II/include/deal.II/fe/fe_dg_vector.h
deal.II/include/deal.II/fe/fe_dg_vector.templates.h
deal.II/include/deal.II/fe/fe_dgp.h
deal.II/include/deal.II/fe/fe_dgp_monomial.h
deal.II/include/deal.II/fe/fe_dgp_nonparametric.h
deal.II/include/deal.II/fe/fe_dgq.h
deal.II/include/deal.II/fe/fe_face.h
deal.II/include/deal.II/fe/fe_nedelec.h
deal.II/include/deal.II/fe/fe_nothing.h
deal.II/include/deal.II/fe/fe_poly.h
deal.II/include/deal.II/fe/fe_poly.templates.h
deal.II/include/deal.II/fe/fe_poly_face.h
deal.II/include/deal.II/fe/fe_poly_face.templates.h
deal.II/include/deal.II/fe/fe_poly_tensor.h
deal.II/include/deal.II/fe/fe_q.h
deal.II/include/deal.II/fe/fe_q_base.h
deal.II/include/deal.II/fe/fe_q_dg0.h
deal.II/include/deal.II/fe/fe_q_hierarchical.h
deal.II/include/deal.II/fe/fe_q_iso_q1.h
deal.II/include/deal.II/fe/fe_raviart_thomas.h
deal.II/include/deal.II/fe/fe_system.h
deal.II/include/deal.II/fe/fe_tools.h
deal.II/include/deal.II/fe/fe_update_flags.h
deal.II/include/deal.II/fe/fe_values.h
deal.II/include/deal.II/fe/fe_values_extractors.h
deal.II/include/deal.II/fe/mapping.h
deal.II/include/deal.II/fe/mapping_c1.h
deal.II/include/deal.II/fe/mapping_cartesian.h
deal.II/include/deal.II/fe/mapping_q.h
deal.II/include/deal.II/fe/mapping_q1.h
deal.II/include/deal.II/fe/mapping_q1_eulerian.h
deal.II/include/deal.II/fe/mapping_q_eulerian.h
deal.II/include/deal.II/grid/cell_id.h [new file with mode: 0644]
deal.II/include/deal.II/grid/filtered_iterator.h
deal.II/include/deal.II/grid/grid_generator.h
deal.II/include/deal.II/grid/grid_in.h
deal.II/include/deal.II/grid/grid_out.h
deal.II/include/deal.II/grid/grid_refinement.h
deal.II/include/deal.II/grid/grid_reordering.h
deal.II/include/deal.II/grid/grid_reordering_internal.h
deal.II/include/deal.II/grid/grid_tools.h
deal.II/include/deal.II/grid/intergrid_map.h
deal.II/include/deal.II/grid/magic_numbers.h
deal.II/include/deal.II/grid/persistent_tria.h
deal.II/include/deal.II/grid/tria.h
deal.II/include/deal.II/grid/tria_accessor.h
deal.II/include/deal.II/grid/tria_accessor.templates.h
deal.II/include/deal.II/grid/tria_boundary.h
deal.II/include/deal.II/grid/tria_boundary_lib.h
deal.II/include/deal.II/grid/tria_faces.h
deal.II/include/deal.II/grid/tria_iterator.h
deal.II/include/deal.II/grid/tria_iterator.templates.h
deal.II/include/deal.II/grid/tria_iterator_base.h
deal.II/include/deal.II/grid/tria_iterator_selector.h
deal.II/include/deal.II/grid/tria_levels.h
deal.II/include/deal.II/grid/tria_object.h
deal.II/include/deal.II/grid/tria_objects.h
deal.II/include/deal.II/hp/dof_faces.h
deal.II/include/deal.II/hp/dof_handler.h
deal.II/include/deal.II/hp/dof_levels.h
deal.II/include/deal.II/hp/dof_objects.h
deal.II/include/deal.II/hp/fe_collection.h
deal.II/include/deal.II/hp/fe_values.h
deal.II/include/deal.II/hp/mapping_collection.h
deal.II/include/deal.II/hp/q_collection.h
deal.II/include/deal.II/integrators/advection.h
deal.II/include/deal.II/integrators/divergence.h
deal.II/include/deal.II/integrators/elasticity.h
deal.II/include/deal.II/integrators/l2.h
deal.II/include/deal.II/integrators/laplace.h
deal.II/include/deal.II/integrators/local_integrators.h
deal.II/include/deal.II/integrators/maxwell.h
deal.II/include/deal.II/integrators/patches.h
deal.II/include/deal.II/lac/arpack_solver.h
deal.II/include/deal.II/lac/block_indices.h
deal.II/include/deal.II/lac/block_list.h
deal.II/include/deal.II/lac/block_matrix.h
deal.II/include/deal.II/lac/block_matrix_array.h
deal.II/include/deal.II/lac/block_matrix_base.h
deal.II/include/deal.II/lac/block_sparse_matrix.h
deal.II/include/deal.II/lac/block_sparse_matrix.templates.h
deal.II/include/deal.II/lac/block_sparse_matrix_ez.h
deal.II/include/deal.II/lac/block_sparse_matrix_ez.templates.h
deal.II/include/deal.II/lac/block_sparsity_pattern.h
deal.II/include/deal.II/lac/block_vector.h
deal.II/include/deal.II/lac/block_vector.templates.h
deal.II/include/deal.II/lac/block_vector_base.h
deal.II/include/deal.II/lac/chunk_sparse_matrix.h
deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h
deal.II/include/deal.II/lac/chunk_sparsity_pattern.h
deal.II/include/deal.II/lac/compressed_set_sparsity_pattern.h
deal.II/include/deal.II/lac/compressed_simple_sparsity_pattern.h
deal.II/include/deal.II/lac/compressed_sparsity_pattern.h
deal.II/include/deal.II/lac/constraint_matrix.h
deal.II/include/deal.II/lac/constraint_matrix.templates.h
deal.II/include/deal.II/lac/eigen.h
deal.II/include/deal.II/lac/exceptions.h
deal.II/include/deal.II/lac/filtered_matrix.h
deal.II/include/deal.II/lac/full_matrix.h
deal.II/include/deal.II/lac/full_matrix.templates.h
deal.II/include/deal.II/lac/generic_linear_algebra.h [new file with mode: 0644]
deal.II/include/deal.II/lac/householder.h
deal.II/include/deal.II/lac/identity_matrix.h
deal.II/include/deal.II/lac/iterative_inverse.h
deal.II/include/deal.II/lac/lapack_full_matrix.h
deal.II/include/deal.II/lac/lapack_support.h
deal.II/include/deal.II/lac/lapack_templates.h
deal.II/include/deal.II/lac/matrix_block.h
deal.II/include/deal.II/lac/matrix_iterator.h
deal.II/include/deal.II/lac/matrix_lib.h
deal.II/include/deal.II/lac/matrix_lib.templates.h
deal.II/include/deal.II/lac/matrix_out.h
deal.II/include/deal.II/lac/parallel_block_vector.h
deal.II/include/deal.II/lac/parallel_vector.h
deal.II/include/deal.II/lac/parallel_vector.templates.h
deal.II/include/deal.II/lac/petsc_block_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_block_vector.h
deal.II/include/deal.II/lac/petsc_full_matrix.h
deal.II/include/deal.II/lac/petsc_matrix_base.h
deal.II/include/deal.II/lac/petsc_matrix_free.h
deal.II/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_parallel_block_vector.h
deal.II/include/deal.II/lac/petsc_parallel_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_parallel_vector.h
deal.II/include/deal.II/lac/petsc_precondition.h
deal.II/include/deal.II/lac/petsc_solver.h
deal.II/include/deal.II/lac/petsc_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_vector.h
deal.II/include/deal.II/lac/petsc_vector_base.h
deal.II/include/deal.II/lac/pointer_matrix.h
deal.II/include/deal.II/lac/precondition.h
deal.II/include/deal.II/lac/precondition_block.h
deal.II/include/deal.II/lac/precondition_block.templates.h
deal.II/include/deal.II/lac/precondition_block_base.h
deal.II/include/deal.II/lac/precondition_selector.h
deal.II/include/deal.II/lac/relaxation_block.h
deal.II/include/deal.II/lac/relaxation_block.templates.h
deal.II/include/deal.II/lac/schur_matrix.h
deal.II/include/deal.II/lac/shifted_matrix.h
deal.II/include/deal.II/lac/slepc_solver.h
deal.II/include/deal.II/lac/slepc_spectral_transformation.h
deal.II/include/deal.II/lac/solver.h
deal.II/include/deal.II/lac/solver_bicgstab.h
deal.II/include/deal.II/lac/solver_cg.h
deal.II/include/deal.II/lac/solver_control.h
deal.II/include/deal.II/lac/solver_gmres.h
deal.II/include/deal.II/lac/solver_minres.h
deal.II/include/deal.II/lac/solver_qmrs.h
deal.II/include/deal.II/lac/solver_relaxation.h
deal.II/include/deal.II/lac/solver_richardson.h
deal.II/include/deal.II/lac/solver_selector.h
deal.II/include/deal.II/lac/sparse_decomposition.h
deal.II/include/deal.II/lac/sparse_decomposition.templates.h
deal.II/include/deal.II/lac/sparse_direct.h
deal.II/include/deal.II/lac/sparse_ilu.h
deal.II/include/deal.II/lac/sparse_ilu.templates.h
deal.II/include/deal.II/lac/sparse_matrix.h
deal.II/include/deal.II/lac/sparse_matrix.templates.h
deal.II/include/deal.II/lac/sparse_matrix_ez.h
deal.II/include/deal.II/lac/sparse_matrix_ez.templates.h
deal.II/include/deal.II/lac/sparse_mic.h
deal.II/include/deal.II/lac/sparse_mic.templates.h
deal.II/include/deal.II/lac/sparse_vanka.h
deal.II/include/deal.II/lac/sparse_vanka.templates.h
deal.II/include/deal.II/lac/sparsity_pattern.h
deal.II/include/deal.II/lac/sparsity_tools.h
deal.II/include/deal.II/lac/swappable_vector.h
deal.II/include/deal.II/lac/swappable_vector.templates.h
deal.II/include/deal.II/lac/transpose_matrix.h
deal.II/include/deal.II/lac/tridiagonal_matrix.h
deal.II/include/deal.II/lac/trilinos_block_sparse_matrix.h
deal.II/include/deal.II/lac/trilinos_block_vector.h
deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h
deal.II/include/deal.II/lac/trilinos_precondition.h
deal.II/include/deal.II/lac/trilinos_solver.h
deal.II/include/deal.II/lac/trilinos_sparse_matrix.h
deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h
deal.II/include/deal.II/lac/trilinos_vector.h
deal.II/include/deal.II/lac/trilinos_vector_base.h
deal.II/include/deal.II/lac/vector.h
deal.II/include/deal.II/lac/vector.templates.h
deal.II/include/deal.II/lac/vector_memory.h
deal.II/include/deal.II/lac/vector_view.h
deal.II/include/deal.II/matrix_free/dof_info.h
deal.II/include/deal.II/matrix_free/dof_info.templates.h
deal.II/include/deal.II/matrix_free/fe_evaluation.h
deal.II/include/deal.II/matrix_free/helper_functions.h
deal.II/include/deal.II/matrix_free/mapping_info.h
deal.II/include/deal.II/matrix_free/mapping_info.templates.h
deal.II/include/deal.II/matrix_free/matrix_free.h
deal.II/include/deal.II/matrix_free/matrix_free.templates.h
deal.II/include/deal.II/matrix_free/shape_info.h
deal.II/include/deal.II/matrix_free/shape_info.templates.h
deal.II/include/deal.II/meshworker/assembler.h
deal.II/include/deal.II/meshworker/dof_info.h
deal.II/include/deal.II/meshworker/dof_info.templates.h
deal.II/include/deal.II/meshworker/functional.h
deal.II/include/deal.II/meshworker/integration_info.h
deal.II/include/deal.II/meshworker/integration_info.templates.h
deal.II/include/deal.II/meshworker/local_integrator.h
deal.II/include/deal.II/meshworker/local_results.h
deal.II/include/deal.II/meshworker/loop.h
deal.II/include/deal.II/meshworker/output.h
deal.II/include/deal.II/meshworker/simple.h
deal.II/include/deal.II/meshworker/vector_selector.h
deal.II/include/deal.II/meshworker/vector_selector.templates.h
deal.II/include/deal.II/multigrid/mg_base.h
deal.II/include/deal.II/multigrid/mg_block_smoother.h
deal.II/include/deal.II/multigrid/mg_coarse.h
deal.II/include/deal.II/multigrid/mg_constrained_dofs.h
deal.II/include/deal.II/multigrid/mg_dof_accessor.h
deal.II/include/deal.II/multigrid/mg_dof_handler.h
deal.II/include/deal.II/multigrid/mg_dof_iterator_selector.h
deal.II/include/deal.II/multigrid/mg_matrix.h
deal.II/include/deal.II/multigrid/mg_smoother.h
deal.II/include/deal.II/multigrid/mg_tools.h
deal.II/include/deal.II/multigrid/mg_transfer.h
deal.II/include/deal.II/multigrid/mg_transfer.templates.h
deal.II/include/deal.II/multigrid/mg_transfer_block.h
deal.II/include/deal.II/multigrid/mg_transfer_block.templates.h
deal.II/include/deal.II/multigrid/mg_transfer_component.h
deal.II/include/deal.II/multigrid/mg_transfer_component.templates.h
deal.II/include/deal.II/multigrid/multigrid.h
deal.II/include/deal.II/multigrid/multigrid.templates.h
deal.II/include/deal.II/numerics/data_component_interpretation.h
deal.II/include/deal.II/numerics/data_out.h
deal.II/include/deal.II/numerics/data_out_faces.h
deal.II/include/deal.II/numerics/data_out_rotation.h
deal.II/include/deal.II/numerics/data_out_stack.h
deal.II/include/deal.II/numerics/data_postprocessor.h
deal.II/include/deal.II/numerics/derivative_approximation.h
deal.II/include/deal.II/numerics/dof_output_operator.h
deal.II/include/deal.II/numerics/dof_output_operator.templates.h
deal.II/include/deal.II/numerics/dof_print_solver_step.h
deal.II/include/deal.II/numerics/error_estimator.h
deal.II/include/deal.II/numerics/fe_field_function.h
deal.II/include/deal.II/numerics/fe_field_function.templates.h
deal.II/include/deal.II/numerics/histogram.h
deal.II/include/deal.II/numerics/matrix_tools.h
deal.II/include/deal.II/numerics/point_value_history.h
deal.II/include/deal.II/numerics/solution_transfer.h
deal.II/include/deal.II/numerics/time_dependent.h
deal.II/include/deal.II/numerics/vector_tools.h
deal.II/include/deal.II/numerics/vector_tools.templates.h
deal.II/source/CMakeLists.txt
deal.II/source/algorithms/CMakeLists.txt
deal.II/source/algorithms/operator.cc
deal.II/source/algorithms/operator.inst.in
deal.II/source/algorithms/timestep_control.cc
deal.II/source/base/CMakeLists.txt
deal.II/source/base/auto_derivative_function.cc
deal.II/source/base/conditional_ostream.cc
deal.II/source/base/config.cc
deal.II/source/base/convergence_table.cc
deal.II/source/base/data_out_base.cc
deal.II/source/base/dummy.cc
deal.II/source/base/event.cc
deal.II/source/base/exceptions.cc
deal.II/source/base/flow_function.cc
deal.II/source/base/function.cc
deal.II/source/base/function_derivative.cc
deal.II/source/base/function_lib.cc
deal.II/source/base/function_lib_cutoff.cc
deal.II/source/base/function_parser.cc
deal.II/source/base/function_time.cc
deal.II/source/base/geometry_info.cc
deal.II/source/base/index_set.cc
deal.II/source/base/job_identifier.cc
deal.II/source/base/logstream.cc
deal.II/source/base/memory_consumption.cc
deal.II/source/base/mpi.cc
deal.II/source/base/multithread_info.cc
deal.II/source/base/parallel.cc
deal.II/source/base/parameter_handler.cc
deal.II/source/base/parsed_function.cc
deal.II/source/base/partitioner.cc
deal.II/source/base/path_search.cc
deal.II/source/base/polynomial.cc
deal.II/source/base/polynomial_space.cc
deal.II/source/base/polynomials_abf.cc
deal.II/source/base/polynomials_adini.cc
deal.II/source/base/polynomials_bdm.cc
deal.II/source/base/polynomials_nedelec.cc
deal.II/source/base/polynomials_p.cc
deal.II/source/base/polynomials_piecewise.cc
deal.II/source/base/polynomials_raviart_thomas.cc
deal.II/source/base/quadrature.cc
deal.II/source/base/quadrature_lib.cc
deal.II/source/base/quadrature_selector.cc
deal.II/source/base/subscriptor.cc
deal.II/source/base/symmetric_tensor.cc
deal.II/source/base/table_handler.cc
deal.II/source/base/tensor_function.cc
deal.II/source/base/tensor_product_polynomials.cc
deal.II/source/base/tensor_product_polynomials_const.cc
deal.II/source/base/thread_management.cc
deal.II/source/base/timer.cc
deal.II/source/base/utilities.cc
deal.II/source/distributed/CMakeLists.txt
deal.II/source/distributed/grid_refinement.cc
deal.II/source/distributed/grid_refinement.inst.in
deal.II/source/distributed/solution_transfer.cc
deal.II/source/distributed/solution_transfer.inst.in
deal.II/source/distributed/tria.cc
deal.II/source/distributed/tria.inst.in
deal.II/source/dofs/CMakeLists.txt
deal.II/source/dofs/block_info.cc
deal.II/source/dofs/block_info.inst.in
deal.II/source/dofs/dof_accessor.cc
deal.II/source/dofs/dof_accessor.inst.in
deal.II/source/dofs/dof_faces.cc
deal.II/source/dofs/dof_handler.cc
deal.II/source/dofs/dof_handler.inst.in
deal.II/source/dofs/dof_handler_policy.cc
deal.II/source/dofs/dof_handler_policy.inst.in
deal.II/source/dofs/dof_objects.cc
deal.II/source/dofs/dof_objects.inst.in
deal.II/source/dofs/dof_renumbering.cc
deal.II/source/dofs/dof_renumbering.inst.in
deal.II/source/dofs/dof_tools.cc
deal.II/source/dofs/dof_tools.inst.in
deal.II/source/dofs/number_cache.cc
deal.II/source/fe/CMakeLists.txt
deal.II/source/fe/block_mask.cc
deal.II/source/fe/component_mask.cc
deal.II/source/fe/fe.cc
deal.II/source/fe/fe.inst.in
deal.II/source/fe/fe_abf.cc
deal.II/source/fe/fe_abf.inst.in
deal.II/source/fe/fe_bdm.cc
deal.II/source/fe/fe_bdm.inst.in
deal.II/source/fe/fe_data.cc
deal.II/source/fe/fe_dg_vector.cc
deal.II/source/fe/fe_dg_vector.inst.in
deal.II/source/fe/fe_dgp.cc
deal.II/source/fe/fe_dgp.inst.in
deal.II/source/fe/fe_dgp_monomial.cc
deal.II/source/fe/fe_dgp_monomial.inst.in
deal.II/source/fe/fe_dgp_nonparametric.cc
deal.II/source/fe/fe_dgp_nonparametric.inst.in
deal.II/source/fe/fe_dgq.cc
deal.II/source/fe/fe_dgq.inst.in
deal.II/source/fe/fe_face.cc
deal.II/source/fe/fe_face.inst.in
deal.II/source/fe/fe_nedelec.cc
deal.II/source/fe/fe_nedelec.inst.in
deal.II/source/fe/fe_nothing.cc
deal.II/source/fe/fe_nothing.inst.in
deal.II/source/fe/fe_poly.cc
deal.II/source/fe/fe_poly.inst.in
deal.II/source/fe/fe_poly_tensor.cc
deal.II/source/fe/fe_poly_tensor.inst.in
deal.II/source/fe/fe_q.cc
deal.II/source/fe/fe_q.inst.in
deal.II/source/fe/fe_q_base.cc
deal.II/source/fe/fe_q_base.inst.in
deal.II/source/fe/fe_q_dg0.cc
deal.II/source/fe/fe_q_dg0.inst.in
deal.II/source/fe/fe_q_hierarchical.cc
deal.II/source/fe/fe_q_hierarchical.inst.in
deal.II/source/fe/fe_q_iso_q1.cc
deal.II/source/fe/fe_q_iso_q1.inst.in
deal.II/source/fe/fe_raviart_thomas.cc
deal.II/source/fe/fe_raviart_thomas.inst.in
deal.II/source/fe/fe_raviart_thomas_nodal.cc
deal.II/source/fe/fe_raviart_thomas_nodal.inst.in
deal.II/source/fe/fe_system.cc
deal.II/source/fe/fe_system.inst.in
deal.II/source/fe/fe_tools.cc
deal.II/source/fe/fe_tools.inst.in
deal.II/source/fe/fe_values.cc
deal.II/source/fe/fe_values.decl.1.inst.in
deal.II/source/fe/fe_values.decl.2.inst.in
deal.II/source/fe/fe_values.impl.1.inst.in
deal.II/source/fe/fe_values.impl.2.inst.in
deal.II/source/fe/fe_values.inst.in
deal.II/source/fe/fe_values_inst2.cc
deal.II/source/fe/mapping.cc
deal.II/source/fe/mapping.inst.in
deal.II/source/fe/mapping_c1.cc
deal.II/source/fe/mapping_c1.inst.in
deal.II/source/fe/mapping_cartesian.cc
deal.II/source/fe/mapping_cartesian.inst.in
deal.II/source/fe/mapping_q.cc
deal.II/source/fe/mapping_q.inst.in
deal.II/source/fe/mapping_q1.cc
deal.II/source/fe/mapping_q1.inst.in
deal.II/source/fe/mapping_q1_eulerian.cc
deal.II/source/fe/mapping_q1_eulerian.inst.in
deal.II/source/fe/mapping_q_eulerian.cc
deal.II/source/fe/mapping_q_eulerian.inst.in
deal.II/source/grid/CMakeLists.txt
deal.II/source/grid/grid_generator.cc
deal.II/source/grid/grid_generator.inst.in
deal.II/source/grid/grid_in.cc
deal.II/source/grid/grid_in.inst.in
deal.II/source/grid/grid_out.cc
deal.II/source/grid/grid_out.inst.in
deal.II/source/grid/grid_refinement.cc
deal.II/source/grid/grid_refinement.inst.in
deal.II/source/grid/grid_reordering.cc
deal.II/source/grid/grid_tools.cc
deal.II/source/grid/grid_tools.inst.in
deal.II/source/grid/intergrid_map.cc
deal.II/source/grid/intergrid_map.inst.in
deal.II/source/grid/persistent_tria.cc
deal.II/source/grid/tria.cc
deal.II/source/grid/tria.inst.in
deal.II/source/grid/tria_accessor.cc
deal.II/source/grid/tria_accessor.inst.in
deal.II/source/grid/tria_boundary.cc
deal.II/source/grid/tria_boundary.inst.in
deal.II/source/grid/tria_boundary_lib.cc
deal.II/source/grid/tria_boundary_lib.inst.in
deal.II/source/grid/tria_faces.cc
deal.II/source/grid/tria_levels.cc
deal.II/source/grid/tria_objects.cc
deal.II/source/grid/tria_objects.inst.in
deal.II/source/hp/CMakeLists.txt
deal.II/source/hp/dof_faces.cc
deal.II/source/hp/dof_handler.cc
deal.II/source/hp/dof_handler.inst.in
deal.II/source/hp/dof_levels.cc
deal.II/source/hp/dof_objects.cc
deal.II/source/hp/fe_collection.cc
deal.II/source/hp/fe_collection.inst.in
deal.II/source/hp/fe_values.cc
deal.II/source/hp/fe_values.inst.in
deal.II/source/hp/mapping_collection.cc
deal.II/source/hp/mapping_collection.inst.in
deal.II/source/integrators/CMakeLists.txt
deal.II/source/lac/CMakeLists.txt
deal.II/source/lac/block_matrix_array.cc
deal.II/source/lac/block_sparse_matrix.cc
deal.II/source/lac/block_sparse_matrix.inst.in
deal.II/source/lac/block_sparse_matrix_ez.cc
deal.II/source/lac/block_sparsity_pattern.cc
deal.II/source/lac/block_vector.cc
deal.II/source/lac/block_vector.inst.in
deal.II/source/lac/chunk_sparse_matrix.cc
deal.II/source/lac/chunk_sparse_matrix.inst.in
deal.II/source/lac/chunk_sparsity_pattern.cc
deal.II/source/lac/compressed_set_sparsity_pattern.cc
deal.II/source/lac/compressed_simple_sparsity_pattern.cc
deal.II/source/lac/compressed_sparsity_pattern.cc
deal.II/source/lac/constraint_matrix.cc
deal.II/source/lac/constraint_matrix.inst.in
deal.II/source/lac/full_matrix.cc
deal.II/source/lac/full_matrix.inst.in
deal.II/source/lac/lapack_full_matrix.cc
deal.II/source/lac/lapack_full_matrix.inst.in
deal.II/source/lac/matrix_lib.cc
deal.II/source/lac/matrix_out.cc
deal.II/source/lac/parallel_vector.cc
deal.II/source/lac/parallel_vector.inst.in
deal.II/source/lac/petsc_block_sparse_matrix.cc
deal.II/source/lac/petsc_full_matrix.cc
deal.II/source/lac/petsc_matrix_base.cc
deal.II/source/lac/petsc_matrix_free.cc
deal.II/source/lac/petsc_parallel_block_sparse_matrix.cc
deal.II/source/lac/petsc_parallel_block_vector.cc
deal.II/source/lac/petsc_parallel_sparse_matrix.cc
deal.II/source/lac/petsc_parallel_vector.cc
deal.II/source/lac/petsc_precondition.cc
deal.II/source/lac/petsc_solver.cc
deal.II/source/lac/petsc_sparse_matrix.cc
deal.II/source/lac/petsc_vector.cc
deal.II/source/lac/petsc_vector_base.cc
deal.II/source/lac/precondition_block.cc
deal.II/source/lac/precondition_block.inst.in
deal.II/source/lac/precondition_block_ez.cc
deal.II/source/lac/relaxation_block.cc
deal.II/source/lac/relaxation_block.inst.in
deal.II/source/lac/slepc_solver.cc
deal.II/source/lac/slepc_spectral_transformation.cc
deal.II/source/lac/solver.cc
deal.II/source/lac/solver.inst.in
deal.II/source/lac/solver_control.cc
deal.II/source/lac/sparse_decomposition.cc
deal.II/source/lac/sparse_direct.cc
deal.II/source/lac/sparse_ilu.cc
deal.II/source/lac/sparse_matrix.cc
deal.II/source/lac/sparse_matrix.inst.in
deal.II/source/lac/sparse_matrix_ez.cc
deal.II/source/lac/sparse_matrix_ez.inst.in
deal.II/source/lac/sparse_mic.cc
deal.II/source/lac/sparse_vanka.cc
deal.II/source/lac/sparsity_pattern.cc
deal.II/source/lac/sparsity_tools.cc
deal.II/source/lac/swappable_vector.cc
deal.II/source/lac/tridiagonal_matrix.cc
deal.II/source/lac/trilinos_block_sparse_matrix.cc
deal.II/source/lac/trilinos_block_vector.cc
deal.II/source/lac/trilinos_precondition.cc
deal.II/source/lac/trilinos_solver.cc
deal.II/source/lac/trilinos_sparse_matrix.cc
deal.II/source/lac/trilinos_sparse_matrix.inst.in
deal.II/source/lac/trilinos_sparsity_pattern.cc
deal.II/source/lac/trilinos_vector.cc
deal.II/source/lac/trilinos_vector_base.cc
deal.II/source/lac/trilinos_vector_base.inst.in
deal.II/source/lac/vector.cc
deal.II/source/lac/vector.inst.in
deal.II/source/lac/vector_memory.cc
deal.II/source/lac/vector_memory.inst.in
deal.II/source/lac/vector_view.cc
deal.II/source/lac/vector_view.inst.in
deal.II/source/matrix_free/CMakeLists.txt
deal.II/source/matrix_free/matrix_free.cc
deal.II/source/matrix_free/matrix_free.inst.in
deal.II/source/meshworker/CMakeLists.txt
deal.II/source/meshworker/mesh_worker.cc
deal.II/source/meshworker/mesh_worker_info.cc
deal.II/source/meshworker/mesh_worker_info.inst.in
deal.II/source/meshworker/mesh_worker_vector_selector.cc
deal.II/source/meshworker/mesh_worker_vector_selector.inst.in
deal.II/source/multigrid/CMakeLists.txt
deal.II/source/multigrid/mg_base.cc
deal.II/source/multigrid/mg_base.inst.in
deal.II/source/multigrid/mg_dof_handler.cc
deal.II/source/multigrid/mg_dof_handler.inst.in
deal.II/source/multigrid/mg_tools.cc
deal.II/source/multigrid/mg_tools.inst.in
deal.II/source/multigrid/mg_transfer_block.cc
deal.II/source/multigrid/mg_transfer_block.inst.in
deal.II/source/multigrid/mg_transfer_component.cc
deal.II/source/multigrid/mg_transfer_component.inst.in
deal.II/source/multigrid/mg_transfer_prebuilt.cc
deal.II/source/multigrid/mg_transfer_prebuilt.inst.in
deal.II/source/multigrid/multigrid.cc
deal.II/source/multigrid/multigrid.inst.in
deal.II/source/numerics/CMakeLists.txt
deal.II/source/numerics/data_out.cc
deal.II/source/numerics/data_out.inst.in
deal.II/source/numerics/data_out_faces.cc
deal.II/source/numerics/data_out_faces.inst.in
deal.II/source/numerics/data_out_rotation.cc
deal.II/source/numerics/data_out_rotation.inst.in
deal.II/source/numerics/data_out_stack.cc
deal.II/source/numerics/data_out_stack.inst.in
deal.II/source/numerics/data_postprocessor.cc
deal.II/source/numerics/data_postprocessor.inst.in
deal.II/source/numerics/derivative_approximation.cc
deal.II/source/numerics/derivative_approximation.inst.in
deal.II/source/numerics/dof_output_operator.cc
deal.II/source/numerics/dof_output_operator.inst.in
deal.II/source/numerics/error_estimator.cc
deal.II/source/numerics/error_estimator.inst.in
deal.II/source/numerics/fe_field_function.cc
deal.II/source/numerics/fe_field_function.inst.in
deal.II/source/numerics/histogram.cc
deal.II/source/numerics/matrix_tools.cc
deal.II/source/numerics/matrix_tools.inst.in
deal.II/source/numerics/point_value_history.cc
deal.II/source/numerics/point_value_history.inst.in
deal.II/source/numerics/solution_transfer.cc
deal.II/source/numerics/solution_transfer.inst.in
deal.II/source/numerics/solution_transfer_inst2.cc
deal.II/source/numerics/time_dependent.cc
deal.II/source/numerics/time_dependent.inst.in
deal.II/source/numerics/vector_tools.cc
deal.II/source/numerics/vector_tools.inst.in

index b665897d70faaaadb86129e7303c8652a97fcd94..04dba539c696ceb060503a5d8e6d5094a214a21c 100644 (file)
@@ -1,30 +1,32 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
-##                                                                       ##
-#             The cmake build system for the deal.II project              #
-#                                                                         #
-#     See doc/readme.html and doc/development/cmake.html for further      #
-#     details on how to use the cmake build system of deal.II.            #
-##                                                                       ##
 
+##                                                                    ##
+#            The cmake build system for the deal.II project            #
+#                                                                      #
+#    See doc/readme.html and doc/development/cmake.html for further    #
+#    details on how to use the cmake build system of deal.II.          #
+##                                                                    ##
 
-###########################################################################
-#                                                                         #
-#                             Configuration:                              #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                            Configuration:                            #
+#                                                                      #
+########################################################################
 
 #
 # General configuration for cmake:
@@ -66,7 +68,10 @@ INCLUDE(setup_cached_variables)
 #
 # Now, set the project and set up the rest:
 #
-PROJECT(deal.II)
+PROJECT(deal.II CXX)
+ENABLE_LANGUAGE_OPTIONAL(C)
+ENABLE_LANGUAGE_OPTIONAL(Fortran)
+
 INCLUDE(setup_deal_ii)
 INCLUDE(setup_compiler_flags)
 
@@ -105,11 +110,11 @@ ENDFOREACH()
 INCLUDE(setup_finalize)
 
 
-###########################################################################
-#                                                                         #
-#                      Compilation and installation:                      #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                     Compilation and installation:                    #
+#                                                                      #
+########################################################################
 
 MESSAGE(STATUS "")
 MESSAGE(STATUS "Configuring done. Proceed to target definitions now.")
@@ -130,11 +135,6 @@ ADD_SUBDIRECTORY(cmake/config) # has to be included after source
 ADD_SUBDIRECTORY(contrib) # has to be included after source
 ADD_SUBDIRECTORY(examples)
 
-#
-# Define some custom targets for convenience
-#
-INCLUDE(setup_custom_targets)
-
 #
 # And finally, print the configuration:
 #
index 2d1d7b4a837a6ea21acf7a281f43d6a5a1f626ba..8b89d07dc609cafb2a916c4cb4ea7cdb7d3f7823 100644 (file)
@@ -477,47 +477,3 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 DAMAGES.
 
                      END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
index 941ceb5b07bd32bf444fb8ce4a2f1934cc491933..091a617214a9746679aa24cc692821ae90e151c2 100644 (file)
@@ -1 +1 @@
-8.0.pre
+8.1.pre
index 44418f02d46454eec0d833cb70e38e70ab7e5844..1e0d8a1e9bb4394f6321cf785db58dc5db481cdf 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Export information about bundled library locations and do the actual
index 7cc6272d6a6c3da8e365f2ea59993f2b11e95132..f908298647e4755421b03064449ea274b504a93a 100644 (file)
@@ -20,7 +20,7 @@ namespace boost {
 
 enum xtime_clock_types
 {
-    TIME_UTC=1
+    TIME_UTC_=1
 //    TIME_TAI,
 //    TIME_MONOTONIC,
 //    TIME_PROCESS,
@@ -68,7 +68,7 @@ inline xtime get_xtime(boost::system_time const& abs_time)
 
 inline int xtime_get(struct xtime* xtp, int clock_type)
 {
-    if (clock_type == TIME_UTC)
+    if (clock_type == TIME_UTC_)
     {
         *xtp=get_xtime(get_system_time());
         return clock_type;
index 3daeece5c41d7dc3a38d01f8515a5077c0ef6f51..b06ba8bd6e6daced561fbb15a0dd6c8336b09b80 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 SET(src_boost_serialization
   basic_archive.cpp
index 0ef2e0d32d39dc123644d5ccd6b94deda505bd76..b37c503498ec89949c36ca5bf190865e59937fa3 100644 (file)
@@ -50,7 +50,7 @@ public:
                       << "very hot ..." << std::endl;
         }
         boost::xtime xt;
-        boost::xtime_get(&xt, boost::TIME_UTC);
+        boost::xtime_get(&xt, boost::TIME_UTC_);
         xt.sec += 3;
         boost::thread::sleep(xt);
         m_chickens += value;
@@ -85,7 +85,7 @@ void chef()
             std::cout << "(" << clock() << ") Chef: cooking ..." << std::endl;
         }
         boost::xtime xt;
-        boost::xtime_get(&xt, boost::TIME_UTC);
+        boost::xtime_get(&xt, boost::TIME_UTC_);
         xt.sec += 2;
         boost::thread::sleep(xt);
         {
@@ -111,7 +111,7 @@ struct phil
             if (m_id > 0)
             {
                 boost::xtime xt;
-                boost::xtime_get(&xt, boost::TIME_UTC);
+                boost::xtime_get(&xt, boost::TIME_UTC_);
                 xt.sec += 3;
                 boost::thread::sleep(xt);
             }
index 798f55e5d8bb08a0ec9c306570bd21b81bc9a8d5..621d0891ce1d8c173059b4d59e6ef338872b06dc 100644 (file)
@@ -104,7 +104,7 @@ int main(int argc, char* argv[])
     boost::thread thrdb(thread_adapter(&player, (void*)PLAYER_B));
 
     boost::xtime xt;
-    boost::xtime_get(&xt, boost::TIME_UTC);
+    boost::xtime_get(&xt, boost::TIME_UTC_);
     xt.sec += 1;
     boost::thread::sleep(xt);
     {
index c21a3b5ea82212c384af3c695c1da057d9d35715..09aa05a0cd7aa7d27b53c9ef08e70cba8d6cec73 100644 (file)
@@ -14,7 +14,7 @@ struct thread_alarm
     void operator()()
     {
         boost::xtime xt;
-        boost::xtime_get(&xt, boost::TIME_UTC);
+        boost::xtime_get(&xt, boost::TIME_UTC_);
         xt.sec += m_secs;
 
         boost::thread::sleep(xt);
index a9b1933908742b7279d582ebdf8f9c75f8136194..0c4fb7150d7eb66ea8f270d887da6166ee3a3473 100644 (file)
@@ -10,7 +10,7 @@
 int main(int argc, char* argv[])
 {
     boost::xtime xt;
-    boost::xtime_get(&xt, boost::TIME_UTC);
+    boost::xtime_get(&xt, boost::TIME_UTC_);
     xt.sec += 1;
     boost::thread::sleep(xt); // Sleep for 1 second
 }
index 7a87dfb93181a30c6bef12a92213828ca60f9694..2e3eb8839f5ce1cdf1fda7a7c4029575656e49c7 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 IF(DEAL_II_USE_MT_POSIX)
   SET(src_boost_thread
index 07b8458bce8d2bce0287ca50433a08574ed32da7..847662b90f4552de5833c30e9581f9fe87c56162 100644 (file)
@@ -354,7 +354,7 @@ namespace boost
                     cond.timed_wait(lock, xt);
 #   endif
                     xtime cur;
-                    xtime_get(&cur, TIME_UTC);
+                    xtime_get(&cur, TIME_UTC_);
                     if (xtime_cmp(xt, cur) <= 0)
                         return;
                 }
@@ -369,7 +369,7 @@ namespace boost
             BOOST_VERIFY(!pthread_yield());
 #   else
             xtime xt;
-            xtime_get(&xt, TIME_UTC);
+            xtime_get(&xt, TIME_UTC_);
             sleep(xt);
 #   endif
         }
index 1c0a0cdca80abcf374e6e2a00796e100e74db8b3..cab7c55a7833ad4f82051f6e0ef8cdc6590acfa8 100644 (file)
@@ -20,8 +20,8 @@ const int NANOSECONDS_PER_MICROSECOND = 1000;
 inline void to_time(int milliseconds, boost::xtime& xt)
 {
     int res = 0;
-    res = boost::xtime_get(&xt, boost::TIME_UTC);
-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
+    res = boost::xtime_get(&xt, boost::TIME_UTC_);
+    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
 
     xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
     xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
@@ -56,8 +56,8 @@ inline void to_timespec_duration(const boost::xtime& xt, timespec& ts)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
 
     if (boost::xtime_cmp(xt, cur) <= 0)
     {
@@ -87,8 +87,8 @@ inline void to_duration(boost::xtime xt, int& milliseconds)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
 
     if (boost::xtime_cmp(xt, cur) <= 0)
         milliseconds = 0;
@@ -109,8 +109,8 @@ inline void to_microduration(boost::xtime xt, int& microseconds)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
 
     if (boost::xtime_cmp(xt, cur) <= 0)
         microseconds = 0;
index 5ec3b1798a42ec3658b5e690a33aea94643fd967..c6467832a7eff967fbe58c1f0c19a4a038cec30c 100644 (file)
@@ -17,8 +17,8 @@ const int NANOSECONDS_PER_MICROSECOND = 1000;
 inline void to_time(int milliseconds, boost::xtime& xt)
 {
     int res = 0;
-    res = boost::xtime_get(&xt, boost::TIME_UTC);
-    assert(res == boost::TIME_UTC);
+    res = boost::xtime_get(&xt, boost::TIME_UTC_);
+    assert(res == boost::TIME_UTC_);
 
     xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
     xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
@@ -54,8 +54,8 @@ inline void to_timespec_duration(const boost::xtime& xt, timespec& ts)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    assert(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    assert(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
     {
@@ -85,8 +85,8 @@ inline void to_duration(boost::xtime xt, int& milliseconds)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    assert(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    assert(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
         milliseconds = 0;
@@ -107,8 +107,8 @@ inline void to_microduration(boost::xtime xt, int& microseconds)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    assert(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    assert(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
         microseconds = 0;
index 45afe46683f51ce837daf04d7af8e6e73e110ad2..9fb68b95dc4fd98e83b44e90db3a84e99428a11c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Remove -Wall and -pedantic from CMAKE_CXX_FLAGS (in directory scope) to
index 3d5aa530b74295e48329e1738a93f96319d1745e..1551dc14de043a13cedf296f3cbca7ffe1369c77 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Remove -Wall and -pedantic from CMAKE_CXX_FLAGS (in directory scope) to
index 9739fd4fe4d0da9cd9e4d7612ccf4067325e7c31..5f3231de0111d484fc4f624af747f3c89e2e9f06 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 SET(src_amd
   amd_1.cc
index a413a247096676d28010707e1ab38445b711414e..4761b3c04137961a5f3b91a2de5a8bf3d87970b4 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Logic copied from the distributed UMFPACK Makefile.
diff --git a/deal.II/cmake/TODO.CMAKE b/deal.II/cmake/TODO.CMAKE
deleted file mode 100644 (file)
index 944e639..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Some last bits and thoughts:
-
-* A TECPLOT feature has to be written
-
-* Support debug;optimized;general for all FEATURES
-
-* document that we no longer need the two-lib installation of p4est
index 17063b529ea266812ef5001fc212b02452bb3ef8..c6678d6367c2871f8f7a8722b85bb66615c51e6d 100644 (file)
@@ -1,20 +1,24 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-#####
+## ---------------------------------------------------------------------
 
-###########################################################################
-#                                                                         #
-#                  Check for various compiler features:                   #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                 Check for various compiler features:                 #
+#                                                                      #
+########################################################################
 
 #
 # This file sets up:
@@ -148,8 +152,8 @@ CHECK_CXX_SOURCE_COMPILES(
   "
   HAVE_GLIBC_STACKTRACE)
 
-IF(HAVE_GLIBC_STACKTRACE)
-  ENABLE_IF_SUPPORTED(CMAKE_SHARED_LINKER_FLAGS "-rdynamic")
+IF(HAVE_GLIBC_STACKTRACE AND NOT DEAL_II_STATIC_EXECUTABLE)
+  ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-rdynamic")
 ENDIF()
 
 
index 81ac8f6a2e881dbb225592464985ae47ce66f4f8..d8c275b5783f8432e20c1f0f77926cf6b773c34b 100644 (file)
@@ -1,23 +1,25 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 
-###########################################################################
-#                                                                         #
-#                    Platform and CPU specific tests:                     #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                   Platform and CPU specific tests:                   #
+#                                                                      #
+########################################################################
 
 #
 # This file sets up
 #
 # Determine the Endianess of the platform:
 #
-INCLUDE(TestBigEndian)
-TEST_BIG_ENDIAN(DEAL_II_WORDS_BIGENDIAN)
+IF(CMAKE_C_COMPILER_WORKS)
+  INCLUDE(TestBigEndian)
+  TEST_BIG_ENDIAN(DEAL_II_WORDS_BIGENDIAN)
+ELSE()
+  MESSAGE(STATUS
+    "No suitable C compiler was found! Assuming little endian platform."
+    )
+ENDIF()
 
 
 IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
index 374d296e360f443ef0dafb3fa60e33cceef431d2..7fcf064bfb3b6778b93198b4ee57b1306c2802dd 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Check for various C++ language features
 #
 
 
-###########################################################################
-#                                                                         #
-#                              C++11 Support:                             #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                             C++11 Support:                           #
+#                                                                      #
+########################################################################
 
 #
 # See if there is a compiler flag to enable C++11 features
@@ -219,11 +221,11 @@ ELSE()
 ENDIF()
 
 
-###########################################################################
-#                                                                         #
-#                    Check for various C++ features:                      #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                   Check for various C++ features:                    #
+#                                                                      #
+########################################################################
 
 CHECK_CXX_SOURCE_COMPILES(
   "
index 4288bff50b15bf26782670ace74dea74c7137a73..25d54167f5ec48f8e11626840cb79c146c882e4f 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # This file sets up:
 #
 
 
-###########################################################################
-#                                                                         #
-#                     POSIX and Linux specific tests:                     #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                    POSIX and Linux specific tests:                   #
+#                                                                      #
+########################################################################
 
 #
 # Check for various posix (and linux) specific header files and symbols
@@ -56,24 +58,30 @@ CHECK_CXX_SYMBOL_EXISTS("rand_r" "stdlib.h" HAVE_RAND_R)
 #
 # Do we have the Bessel function jn?
 #
-FIND_LIBRARY(m_lib NAMES m)
-MARK_AS_ADVANCED(m_lib)
+# Switch the library preference back to prefer dynamic libraries if
+# DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In
+# this case system libraries should be linked dynamically.
+#
+SWITCH_LIBRARY_PREFERENCE()
+FIND_LIBRARY(m_LIBRARY NAMES m)
+SWITCH_LIBRARY_PREFERENCE()
+MARK_AS_ADVANCED(m_LIBRARY)
 
-IF(NOT m_lib MATCHES "-NOTFOUND")
-  SET(CMAKE_REQUIRED_LIBRARIES ${m_lib})
+IF(NOT m_LIBRARY MATCHES "-NOTFOUND")
+  SET(CMAKE_REQUIRED_LIBRARIES ${m_LIBRARY})
   CHECK_CXX_SYMBOL_EXISTS("jn" "math.h" HAVE_JN)
   SET(CMAKE_REQUIRED_LIBRARIES)
   IF(HAVE_JN)
-    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${m_lib})
+    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${m_LIBRARY})
   ENDIF()
 ENDIF()
 
 
-###########################################################################
-#                                                                         #
-#                         Mac OSX specific setup:                         #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                        Mac OSX specific setup:                       #
+#                                                                      #
+########################################################################
 
 IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   #
@@ -90,16 +98,16 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   #
   # TODO: MM: Check whether this is still necessary...
   #
-  STRIP_FLAG(CMAKE_SHARED_LINKER_FLAGS "-rdynamic")
+  STRIP_FLAG(DEAL_II_LINKER_FLAGS "-rdynamic")
 ENDIF()
 
 
 
-###########################################################################
-#                                                                         #
-#                    Windows and CYGWIN specific setup:                   #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                   Windows and CYGWIN specific setup:                 #
+#                                                                      #
+########################################################################
 
 IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
   #
@@ -122,9 +130,9 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
   # - Matthias Maier, 2012
   #
   STRIP_FLAG(DEAL_II_CXX_FLAGS_DEBUG "-ggdb")
-  STRIP_FLAG(DEAL_II_SHARED_LINKER_FLAGS_DEBUG "-ggdb")
+  STRIP_FLAG(DEAL_II_LINKER_FLAGS_DEBUG "-ggdb")
   STRIP_FLAG(DEAL_II_CXX_FLAGS_DEBUG "-g")
-  STRIP_FLAG(DEAL_II_SHARED_LINKER_FLAGS_DEBUG "-g")
+  STRIP_FLAG(DEAL_II_LINKER_FLAGS_DEBUG "-g")
 ENDIF()
 
 IF(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
index b33e40b11c34dd4ccb88982cdefb93e7d0b5710a..cf49fb0e579e65cc7a008799f60092e9117c96db 100644 (file)
@@ -1,20 +1,24 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-#####
+## ---------------------------------------------------------------------
 
-###########################################################################
-#                                                                         #
-#                    Check for various compiler bugs:                     #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                   Check for various compiler bugs:                   #
+#                                                                      #
+########################################################################
 
 
 #
@@ -96,38 +100,6 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
 ENDIF()
 
 
-#
-# Some gcc compiler versions have a problem when using an unsigned count
-# in the std::advance function. Unfortunately, this also happens
-# occasionally from within the standard library, so we can't prevent the
-# warning messages. Since this is annoying, switch of the flag -W which
-# causes this.
-#
-# - Matthias Maier, rewritten 2012
-#
-
-# TODO: We use the mpi.h header file for this check. We should test this
-# bug directly...
-CHECK_INCLUDE_FILE_CXX("mpi.h" HAVE_MPI_H)
-
-IF(HAVE_MPI_H)
-  PUSH_TEST_FLAG("-Wunused-parameter")
-  PUSH_TEST_FLAG("-Werror")
-  CHECK_CXX_COMPILER_BUG(
-    "
-    #include <mpi.h>
-    int main() { return 0; }
-    "
-    DEAL_II_ADVANCE_WARNING_BUG)
-  POP_TEST_FLAG()
-  POP_TEST_FLAG()
-
-  IF(DEAL_II_ADVANCE_WARNING_BUG)
-    ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-unused-parameter")
-  ENDIF()
-ENDIF()
-
-
 #
 # In some cases, we would like to name partial specializations
 # as friends. However, the standard forbids us to do so. But
@@ -256,7 +228,7 @@ CHECK_CXX_SOURCE_COMPILES(
     explicit X(T) {}
   };
   void f(X) {}
-  int main() { f(1) };
+  int main() { f(1); }
   "
   DEAL_II_EXPLICIT_CONSTRUCTOR_BUG
   )
index 206504899c169a3f227d22fd5c6e707fefec1028..037af96e8c22d816ab68a371d74843440a0a44f3 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 
 #
@@ -22,11 +24,11 @@ CONFIGURE_FILE(
   )
 
 
-###########################################################################
-#                                                                         #
-#               Setup and install the convenience macros:                 #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#              Setup and install the convenience macros:               #
+#                                                                      #
+########################################################################
 
 INSTALL(FILES
   ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake
@@ -37,11 +39,11 @@ INSTALL(FILES
   )
 
 
-###########################################################################
-#                                                                         #
-#         Configure and install the cmake project configuration:          #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#        Configure and install the cmake project configuration:        #
+#                                                                      #
+########################################################################
 
 #
 # Strip -Wno-deprecated from CMAKE_CXX_FLAGS so that deprecation warnings
@@ -136,11 +138,11 @@ INSTALL(FILES
   )
 
 
-###########################################################################
-#                                                                         #
-#          Configure and install the old Makefile configuration:          #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#         Configure and install the old Makefile configuration:        #
+#                                                                      #
+########################################################################
 
 
 IF(DEAL_II_COMPONENT_COMPAT_FILES)
@@ -241,7 +243,7 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
     # Set up our linker flags:
     #
     SET(MAKEFILE_LDFLAGS_${build}
-      "${CMAKE_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}} ${CMAKE_SHARED_LINKER_FLAGS} ${DEAL_II_SHARED_LINKER_FLAGS_${build}}"
+      "${CMAKE_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}} ${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${build}}"
       )
   ENDFOREACH()
 
index c28eb394956ef89b11ee58218eb6cc96ebffc8a2..150793f5cc781460b568550d2dce111d2c538be1 100644 (file)
@@ -1,23 +1,25 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 
-##########################################################################
-##                                                                      ##
-##                The deal.II project configuration file                ##
-##                                                                      ##
-##########################################################################
+########################################################################
+##                                                                    ##
+##               The deal.II project configuration file               ##
+##                                                                    ##
+########################################################################
 
 
 #
@@ -108,13 +110,13 @@ SET(DEAL_II_CXX_FLAGS_DEBUG "@DEAL_II_CXX_FLAGS_DEBUG@")
 SET(DEAL_II_CXX_FLAGS_RELEASE "@DEAL_II_CXX_FLAGS_RELEASE@")
 
 # used for all targets:
-SET(DEAL_II_LINKER_FLAGS "@CMAKE_SHARED_LINKER_FLAGS@")
+SET(DEAL_II_LINKER_FLAGS "@DEAL_II_LINKER_FLAGS@")
 
 # _additionally_ used for debug targets:
-SET(DEAL_II_LINKER_FLAGS_DEBUG "@DEAL_II_SHARED_LINKER_FLAGS_DEBUG@")
+SET(DEAL_II_LINKER_FLAGS_DEBUG "@DEAL_II_LINKER_FLAGS_DEBUG@")
 
 # _additionally_ used for release targets:
-SET(DEAL_II_LINKER_FLAGS_RELEASE "@DEAL_II_SHARED_LINKER_FLAGS_RELEASE@")
+SET(DEAL_II_LINKER_FLAGS_RELEASE "@DEAL_II_LINKER_FLAGS_RELEASE@")
 
 # used for all targets:
 SET(DEAL_II_USER_DEFINITIONS "@DEAL_II_USER_DEFINITIONS@")
@@ -126,6 +128,13 @@ SET(DEAL_II_USER_DEFINITIONS_DEBUG "@DEAL_II_USER_DEFINITIONS_DEBUG@")
 SET(DEAL_II_USER_DEFINITIONS_RELEASE "@DEAL_II_USER_DEFINITIONS_RELEASE@")
 
 
+#
+# Build a static executable:
+#
+
+SET(DEAL_II_STATIC_EXECUTABLE "@DEAL_II_STATIC_EXECUTABLE@")
+
+
 #
 # Information about include directories and libraries
 #
index 6445f6b1f1e6a5771a0663ae26af2bb3a5ba9889..a319fe155b5fdd9859aa01d7745a31834d77f132 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the lapack library:
 MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
   FIND_PACKAGE(LAPACK)
 
-  IF(LAPACK_FOUND)
-    MARK_AS_ADVANCED(
-      atlas_LIBRARY
-      blas_LIBRARY
-      gslcblas_LIBRARY
-      lapack_LIBRARY
-      m_LIBRARY
-      ptf77blas_LIBRARY
-      ptlapack_LIBRARY
-      refblas_LIBRARY
-      reflapack_LIBRARY
+  #
+  # So, well... LAPACK_LINKER_FLAGS and LAPACK_LIBRARIES should contain the
+  # complete link interface. But for invalid user overrides we include
+  # BLAS_LIBRARIES and BLAS_LINKER_FLAGS as well..
+  #
+  IF(NOT LAPACK_LINKER_FLAGS MATCHES "${BLAS_LINKER_FLAGS}")
+    MESSAGE(STATUS
+      "Manually adding BLAS_LINKER_FLAGS to LAPACK_LINKER_FLAGS"
       )
+    ADD_FLAGS(LAPACK_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
+  ENDIF()
+  IF(NOT "${LAPACK_LIBRARIES}" MATCHES "${BLAS_LIBRARIES}")
+    MESSAGE(STATUS
+      "Manually adding BLAS_LIBRARIES to LAPACK_LIBRARIES"
+      )
+    LIST(APPEND LAPACK_LIBRARIES ${BLAS_LIBRARIES})
+  ENDIF()
+
+  MARK_AS_ADVANCED(
+    atlas_LIBRARY
+    blas_LIBRARY
+    gslcblas_LIBRARY
+    lapack_LIBRARY
+    m_LIBRARY
+    ptf77blas_LIBRARY
+    ptlapack_LIBRARY
+    refblas_LIBRARY
+    reflapack_LIBRARY
+    )
+
+  IF(LAPACK_FOUND)
+    #
+    # Well, in case of static archives we have to manually pick up the
+    # complete link interface. *sigh*
+    #
+    # Do this unconditionally for the most common case:
+    # TODO: Non-GNU setups...
+    #
+    #
+    # Switch the library preference back to prefer dynamic libraries if
+    # DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In
+    # this case system libraries should be linked dynamically.
+    #
+    SWITCH_LIBRARY_PREFERENCE()
+    FOREACH(_lib gfortran m quadmath)
+      FIND_LIBRARY(${_lib}_LIBRARY
+        NAMES ${_lib}
+        HINTS ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
+      MARK_AS_ADVANCED(${_lib}_LIBRARY)
+
+      IF(NOT ${_lib}_LIBRARY MATCHES "-NOTFOUND")
+        LIST(APPEND LAPACK_LIBRARIES ${${_lib}_LIBRARY})
+      ENDIF()
+    ENDFOREACH()
+    SWITCH_LIBRARY_PREFERENCE()
+
     SET(${var} TRUE)
   ENDIF()
 ENDMACRO()
@@ -52,24 +98,29 @@ SET(DEAL_II_LAPACK_FUNCTIONS
 
 MACRO(CHECK_FOR_LAPACK_FUNCTIONS)
   SET(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
+  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
   #
-  # For some static lapack versions it is necessary to link with -lm.
-  # So link with it as well if -lm is already present in our link
-  # interface:
+  # Push -pthread as well:
   #
-  IF(NOT m_lib MATCHES "-NOTFOUND")
-    LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${m_lib})
+  ENABLE_IF_SUPPORTED(CMAKE_REQUIRED_FLAGS "-pthread")
+
+  IF(CMAKE_C_COMPILER_WORKS)
+    FOREACH(_func ${DEAL_II_LAPACK_FUNCTIONS})
+      STRING(TOUPPER ${_func} _func_uppercase)
+      CHECK_FUNCTION_EXISTS(${_func} HAVE_${_func_uppercase})
+    ENDFOREACH()
+  ELSE()
+    MESSAGE(STATUS
+      "No suitable C compiler was found! Skipping LAPACK symbol check."
+      )
+    FOREACH(_func ${DEAL_II_LAPACK_FUNCTIONS})
+      SET_IF_EMPTY(HAVE_${_func_uppercase} TRUE)
+    ENDFOREACH()
   ENDIF()
 
-  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
-
-  FOREACH(_func ${DEAL_II_LAPACK_FUNCTIONS})
-    STRING(TOUPPER ${_func} _func_uppercase)
-    CHECK_FUNCTION_EXISTS(${_func} HAVE_${_func_uppercase})
-  ENDFOREACH()
-
   SET(CMAKE_REQUIRED_LIBRARIES)
   STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
+  STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-pthread")
 ENDMACRO()
 
 
@@ -81,29 +132,12 @@ MACRO(RESET_LAPACK_FUNCTIONS_CACHE)
 ENDMACRO()
 
 
+
 MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL)
-  #
-  # So, well... LAPACK_LINKER_FLAGS and LAPACK_LIBRARIES should contain the
-  # complete link interface. But for invalid user overrides we include
-  # BLAS_LIBRARIES and BLAS_LINKER_FLAGS as well..
-  #
-  IF(NOT LAPACK_LINKER_FLAGS MATCHES "${BLAS_LINKER_FLAGS}")
-    MESSAGE(STATUS
-      "Manually adding BLAS_LINKER_FLAGS to LAPACK_LINKER_FLAGS"
-      )
-    ADD_FLAGS(LAPACK_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
-  ENDIF()
-  IF(NOT "${LAPACK_LIBRARIES}" MATCHES "${BLAS_LIBRARIES}")
-    MESSAGE(STATUS
-      "Manually adding BLAS_LIBRARIES to LAPACK_LIBRARIES"
-      )
-    LIST(APPEND LAPACK_LIBRARIES ${BLAS_LIBRARIES})
-  ENDIF()
 
-  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
+  ADD_FLAGS(DEAL_II_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
   LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${LAPACK_LIBRARIES})
 
-
   CHECK_FOR_LAPACK_FUNCTIONS()
 ENDMACRO()
 
index e0c1766d4151ba10803c2a5e0b5a8b405cc687ae..85de2a41c2ec721d2dc7ffe0911379e21545ef4a 100644 (file)
@@ -1,20 +1,25 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for mpi support:
 #
+# We look for the C and Fortran libraries as well because they are needed
+# by some external libraries:
+#
 
 MACRO(FEATURE_MPI_FIND_EXTERNAL var)
   #
@@ -31,7 +36,22 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var)
   # directly.
   #
   SET_IF_EMPTY(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
-  SET_IF_EMPTY(MPI_C_COMPILER ${CMAKE_C_COMPILER}) # for good measure
+  IF(CMAKE_C_COMPILER_WORKS)
+    SET_IF_EMPTY(MPI_C_COMPILER ${CMAKE_C_COMPILER}) # for good measure
+  ELSE()
+    MESSAGE(STATUS
+      "No suitable C compiler was found! MPI C interface can not be "
+      "autodetected"
+      )
+  ENDIF()
+  IF(CMAKE_Fortran_COMPILER_WORKS)
+    SET_IF_EMPTY(MPI_Fortran_COMPILER ${CMAKE_Fortran_COMPILER}) # for good measure
+  ELSE()
+    MESSAGE(STATUS
+      "No suitable Fortran compiler was found! MPI Fortran interface can "
+      "not be autodetected"
+      )
+  ENDIF()
   FIND_PACKAGE(MPI)
 
   IF(NOT MPI_CXX_FOUND)
@@ -48,14 +68,24 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var)
       SET(MPI_FOUND) # clear this value so that FIND_PACKAGE runs again.
       UNSET(MPI_CXX_COMPILER CACHE)
       UNSET(MPI_C_COMPILER CACHE)
+      UNSET(MPI_Fortran_COMPILER CACHE)
       FIND_PACKAGE(MPI)
     ENDIF()
   ENDIF()
 
-  IF(MPI_CXX_FOUND)
-    # Hide some variables:
-    MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY)
+  #
+  # Manually clean up variables:
+  #
+  FOREACH(_lang C CXX Fortran)
+    IF(MPI_${_lang}_LIBRARIES MATCHES "-NOTFOUND")
+      SET(MPI_${_lang}_LIBRARIES)
+    ENDIF()
+  ENDFOREACH()
 
+  # Hide some variables:
+  MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY)
+
+  IF(MPI_CXX_FOUND)
     SET(${var} TRUE)
   ENDIF()
 ENDMACRO()
@@ -63,7 +93,7 @@ ENDMACRO()
 
 MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL)
   ADD_FLAGS(CMAKE_CXX_FLAGS "${MPI_CXX_COMPILE_FLAGS}")
-  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}")
+  ADD_FLAGS(DEAL_II_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}")
 
   LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${MPI_CXX_LIBRARIES})
   INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
index f2df40515643a7a5861c5e7ee3df288bce70268f..8525ad770ea16b5c61560ce9c0203143e94c548b 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 
 #
 # The macro will be included in CONFIGURE_FEATURE_THREADS_EXTERNAL/BUNDLED.
 #
 MACRO(SETUP_THREADING)
-  FIND_PACKAGE(Threads)
+  #
+  # Unfortunately the FindThreads macro needs a working C compiler
+  #
+  IF(CMAKE_C_COMPILER_WORKS)
+    #
+    # Switch the library preference back to prefer dynamic libraries if
+    # DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In
+    # this case system libraries should be linked dynamically.
+    #
+    SWITCH_LIBRARY_PREFERENCE()
+    FIND_PACKAGE(Threads)
+    SWITCH_LIBRARY_PREFERENCE()
+
+  ELSE()
+
+    #
+    # We have no way to query for thread support. Just assume that it is
+    # provided by Pthreads...
+    #
+    MESSAGE(STATUS
+      "No suitable C compiler was found! Assuming threading is provided by Pthreads."
+      )
+    SET_IF_EMPTY(Threads_FOUND TRUE)
+    SET_IF_EMPTY(CMAKE_THREAD_LIBS_INIT "-lpthread")
+    SET_IF_EMPTY(CMAKE_USE_PTHREADS_INIT TRUE)
+  ENDIF()
 
   IF(NOT Threads_FOUND)
-    # TODO:
+    #
+    # TODO: This is a dead end. Threading might be setup with internal TBB
+    # so we have no way of returning unsuccessfully...
+    #
     MESSAGE(FATAL_ERROR
       "\nInternal configuration error: No Threading support found\n\n"
       )
@@ -50,7 +80,7 @@ MACRO(SETUP_THREADING)
     ENDIF()
   ENDIF()
 
-  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
+  ADD_FLAGS(DEAL_II_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
 
   #
   # Set up some posix thread specific configuration toggles:
@@ -135,15 +165,6 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL)
 ENDMACRO()
 
 
-#
-# Resolve a cache invalidation problem by searching for these flags
-# unconditionally. They're used in FEATURE_THREADS_CONFIGURE_BUNDLED
-# depending on cached variables.
-#
-ENABLE_IF_SUPPORTED(_dummy "-Wno-parentheses")
-ENABLE_IF_SUPPORTED(_dummy "-Wno-long-long")
-
-
 MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED)
   #
   # Setup threading (before configuring our build...)
@@ -168,10 +189,10 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED)
   #
   # tbb uses dlopen/dlclose, so link against libdl.so as well:
   #
-  FIND_LIBRARY(dl_lib NAMES dl)
-  MARK_AS_ADVANCED(dl_lib)
-  IF(NOT dl_lib MATCHES "-NOTFOUND")
-    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${dl_lib})
+  FIND_LIBRARY(dl_LIBRARY NAMES dl)
+  MARK_AS_ADVANCED(dl_LIBRARY)
+  IF(NOT dl_LIBRARY MATCHES "-NOTFOUND")
+    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${dl_LIBRARY})
   ENDIF()
 
   INCLUDE_DIRECTORIES(${TBB_FOLDER}/include)
index 0d8ebde0d4cde4cf3b36091d65b93f6da9cc6e68..56ac7e323d648fd83fe9671aa145903caaf85d05 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the umfpack library:
similarity index 51%
rename from deal.II/cmake/configure/configure_metis.cmake
rename to deal.II/cmake/configure/configure_2_metis.cmake
index 14f76ca5f5c416f494b25abc395d22649d1b9ea1..92a1f10880435ab8969ad5efba384b1b0e8c237a 100644 (file)
@@ -1,19 +1,21 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
-# Configuration for the netcdf library:
+# Configuration for the metis library:
 #
 
 MACRO(FEATURE_METIS_FIND_EXTERNAL var)
similarity index 66%
rename from deal.II/cmake/configure/configure_petsc.cmake
rename to deal.II/cmake/configure/configure_2_petsc.cmake
index eaad928c7d7e2e8bd0218ad06dc259362306feb7..a78757796a2f85a0da8c64ce3d9a471848b2d14c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the petsc library:
@@ -45,7 +47,7 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
     # Petsc has to be configured with the same MPI configuration as
     # deal.II.
     #
-    # petscconf.h should export PETSC_HAVE_MPIUNI 1 in case  mpi support is
+    # petscconf.h should export PETSC_HAVE_MPIUNI 1 in case mpi support is
     # _NOT_ enabled.
     # So we check for this:
     #
@@ -65,6 +67,33 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
       SET(${var} FALSE)
     ENDIF()
 
+
+    #
+    # Petsc has to be configured with the same number of bits for indices as
+    # deal.II.
+    #
+    # petscconf.h should export PETSC_WITH_64BIT_INDICES 1 in case 64bits
+    # indices support is enabled.
+    # So we check for this:
+    #
+    IF( (NOT PETSC_WITH_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES)
+         OR
+         (PETSC_WITH_64BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES))
+      MESSAGE(STATUS "Could not find a sufficient PETSc installation: "
+        "PETSc has to be configured to use the same number of bits for the "
+        "global indices as deal.II."
+        )
+      SET(PETSC_ADDITIONAL_ERROR_STRING
+        ${PETSC_ADDITIONAL_ERROR_STRING}
+        "Could not find a sufficient PETSc installation:\n"
+        "PETSc has to be configured to use the same number of bits for the "
+        "global indices as deal.II, but found:\n"
+        "  DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+        "  PETSC_WITH_64BIT_INDICES = (${PETSC_WITH_64BIT_INDICES})\n"
+        )
+      SET(${var} FALSE)
+    ENDIF()
+
     IF(NOT ${var})
       UNSET(PETSC_INCLUDE_DIR_ARCH CACHE)
       UNSET(PETSC_INCLUDE_DIR_COMMON CACHE)
@@ -80,13 +109,6 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-#
-# Resolve a cache invalidation problem by searching for this flag
-# unconditionally. It is used in FEATURE_PETSC_CONFIGURE_EXTERNAL
-# depending on cached variables.
-#
-ENABLE_IF_SUPPORTED(_dummy "-Wno-long-long")
-
 MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL)
   INCLUDE_DIRECTORIES(${PETSC_INCLUDE_DIRS})
 
similarity index 74%
rename from deal.II/cmake/configure/configure_trilinos.cmake
rename to deal.II/cmake/configure/configure_2_trilinos.cmake
index 346d2165fb3c55b3fefc73d69f872f4fee083232..41a5f93bf5bd9988242059a9ee8498f70284f711 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the trilinos library:
@@ -115,9 +117,47 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
       SET(${var} FALSE)
     ENDIF()
 
+    #
+    # Trilinos has to be configured with 32bit indices if deal.II uses unsigned long
+    # long int.
+    #
+    IF(TRILINOS_WITH_NO_32BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES)
+      MESSAGE(STATUS "deal.II was configured to use 32bit global indices but "
+        "Trilinos was not."
+        ) 
+      SET(TRILINOS_ADDITIONAL_ERROR_STRING
+        ${TRILINOS_ADDITIONAL_ERROR_STRING}
+        "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n"
+        "has to be configured to use the same number of bits as deal.II, but "
+        "found:\n"
+        "  DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+        "  TRILINOS_WITH_NO_32BIT_INDICES = ${TRILINOS_WITH_NO_32_BIT_INDICES}\n" 
+        )
+      SET(${var} FALSE)
+    ENDIF()  
 
     #
-    # Some verions of Sacado_cmath.hpp does things that aren't compatible
+    # Trilinos has to be configured with 64bit indices if deal.II uses unsigned long
+    # long int.
+    #
+    IF(TRILINOS_WITH_NO_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES)
+      MESSAGE(STATUS "deal.II was configured to use 64bit global indices but "
+        "Trilinos was not."
+        ) 
+      SET(TRILINOS_ADDITIONAL_ERROR_STRING
+        ${TRILINOS_ADDITIONAL_ERROR_STRING}
+        "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n"
+        "has to be configured to use the same number of bits as deal.II, but "
+        "found:\n"
+        "  DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+        "  TRILINOS_WITH_NO_64BIT_INDICES = ${TRILINOS_WITH_NO_64_BIT_INDICES}\n" 
+        )
+      SET(${var} FALSE)
+    ENDIF()  
+
+
+    #
+    # Some versions of Sacado_cmath.hpp do things that aren't compatible
     # with the -std=c++0x flag of GCC, see deal.II FAQ.
     # Test whether that is indeed the case
     #
@@ -177,15 +217,6 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-#
-# Resolve a cache invalidation problem by searching for these flags
-# unconditionally. They're used in FEATURE_TRILINOS_CONFIGURE_EXTERNAL
-# depending on cached variables.
-#
-ENABLE_IF_SUPPORTED(_dummy "-Wno-unused")
-ENABLE_IF_SUPPORTED(_dummy "-Wno-extra")
-ENABLE_IF_SUPPORTED(_dummy "-Wno-overloaded-virtual")
-
 MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL)
   #
   # *Boy* Sanitize the include paths given by TrilinosConfig.cmake...
@@ -200,13 +231,7 @@ MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL)
   # The user has to know the location of the trilinos headers as well:
   LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${TRILINOS_INCLUDE_DIRS})
 
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES
-    # The Trilinos libraries:
-    ${TRILINOS_LIBRARIES}
-    # All external libraries necessary for the Trilinos libraries. Nice and
-    # easy :-)
-    ${Trilinos_TPL_LIBRARIES}
-    )
+  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${TRILINOS_LIBRARIES})
 
   SET(DEAL_II_EXPAND_TRILINOS_VECTOR "TrilinosWrappers::Vector")
   SET(DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR "TrilinosWrappers::BlockVector")
index 2ce985674b4fc7ead9f424efc41963900bbff856..bf2f5f4acac233fe5c5f2cb84f5d20dabe53bc17 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the ARPACK library:
index 8e28bf83e58d6b96f179836e8b7be8c970137e92..7d017236b4c2bb19bbdb995eb32923e7e4fbafa3 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the boost library:
@@ -35,21 +37,39 @@ SET(DEAL_II_WITH_BOOST ON # Always true. We need it :-]
 
 
 MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
-  #
-  # We require at least version 1.44
-  #
+
   IF(DEAL_II_WITH_THREADS)
-    FIND_PACKAGE(Boost 1.44 COMPONENTS serialization system thread)
+    SET(_boost_components serialization system thread)
   ELSE()
-    FIND_PACKAGE(Boost 1.44 COMPONENTS serialization system)
+    SET(_boost_components serialization system)
+  ENDIF()
+
+  #
+  # Prefer static libs if BUILD_SHARED_LIBS=OFF:
+  #
+  IF(NOT BUILD_SHARED_LIBS)
+    SET(Boost_USE_STATIC_LIBS TRUE)
   ENDIF()
 
+  FIND_PACKAGE(Boost 1.44 COMPONENTS ${_boost_components})
+
+  #
+  # Fall back to dynamic libraries if no static libraries could be found:
+  #
+  IF( Boost_USE_STATIC_LIBS AND
+      (NOT Boost_SERIALIZATION_FOUND OR NOT Boost_SYSTEM_FOUND)
+    )
+    SET(Boost_USE_STATIC_LIBS FALSE)
+    FIND_PACKAGE(Boost 1.44 COMPONENTS ${_boost_components})
+  ENDIF()
+
+  MARK_AS_ADVANCED(Boost_DIR)
+
   IF( Boost_SERIALIZATION_FOUND AND
       Boost_SYSTEM_FOUND AND
       (NOT DEAL_II_WITH_THREADS OR Boost_THREAD_FOUND)
     )
     SET(${var} TRUE)
-    MARK_AS_ADVANCED(Boost_DIR)
   ENDIF()
 ENDMACRO()
 
index 191c33164ed616299fb513147211f18a6740bfcd..c9abde129dc68f5ff79d86f56c78e455c262ec16 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for functionparser
index ff85fe9080d6dc31df4d5d7eb074c9c21504ddcf..d46c23409b3a688e64d103012cd095179dcc460f 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the hdf5 library:
index 3757724b5972060c5955716ce25255ebbc04e80d..f4a9a27446f7b43bba9ec0848dfd54b85458ab99 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the MUMPS library:
index a8fb4ebc5740da644a21abbdbb034a45e7237004..b29db310d42159a3488cf30af47e21892d550d74 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the netcdf library:
index a31ff138dd64da7ac2f5369405d3edcce61a1cf8..3773a88b12576ec6de4b7591aace8ba199ed435c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the p4est and sc libraries:
index cc1ff2b65ee6266105f3bb9096632f00bdc8d524..269f85daa1a0cf3f0e815d6c6c41800eb400cfb0 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the SLEPC library:
index 88fb2551119ec058001ee0ff9474e8d142c14d39..250210beac118a5fbf5a3c27cf97fc9ba368666d 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configuration for the zlib library:
index a56bb3ae30794456f682d678a4233cb9928919ef..db70587a7d4652fc6b5ddc219e1706c6ca366b1d 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small macro used for (string-)appending a string "${flags}" to a
index ea2c41b433f07a7cccfaaf1a7f25538d989ecc10..6c600a27294efbcd3a48c96f4769d5c8cdf7b2e1 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Check for a compiler bug.
index a0b6e40438d590c8f9aae395cbdc59d831b618dd..2eb3efaebc166513b0671e3b23cbb6955de763d5 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # If bool is "true" (in a cmake fashion...), set variable to "yes",
index 991531e19b03ea7d9d992e39d76a9ff6f259b58c..0ae79de3c0543b01f308a85d8210b13956c4f206 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # This macro is used for the feature configuration in deal.II
 #
 
 
-###########################################################################
-#                                                                         #
-#                             Helper Macros:                              #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                            Helper Macros:                            #
+#                                                                      #
+########################################################################
 
 #
 # Some black magic to have substitution in command names:
@@ -143,16 +145,16 @@ MACRO(FEATURE_CONFIGURE_EXTERNAL _feature)
     LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${${_feature}_LIBRARIES})
   ENDIF()
   IF(DEFINED ${_feature}_LINKER_FLAGS)
-    ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${${_feature}_LINKER_FLAGS}")
+    ADD_FLAGS(DEAL_II_LINKER_FLAGS "${${_feature}_LINKER_FLAGS}")
   ENDIF()
 ENDMACRO()
 
 
-###########################################################################
-#                                                                         #
-#                           CONFIGURE_FEATURE:                            #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                          CONFIGURE_FEATURE:                          #
+#                                                                      #
+########################################################################
 
 MACRO(CONFIGURE_FEATURE _feature)
   #
index d626feafc85799a0bbb788ff890ff92dcd44048e..01969882a1c10787eb6807a87341c73e9c2da169 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small wrapper around
index 87ea359076f9cf0ea2fdb6970306866818a55121..037885ff159dbdf513203f9b146fe6df4fa84191 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small wrapper around ADD_DEPENDENCIES to add the specified dependencies
index a86d4dba44759d8c4aee1d0cd102e6cfc127c123..26c7ee3b81436b67beb33652ab683e82b9fa732a 100644 (file)
@@ -1,28 +1,30 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small wrapper around ADD_LIBRARY that will define a target for each
 # build type specified in DEAL_II_BUILD_TYPES
 #
 # It is assumed that the desired compilation configuration is set via
-#   DEAL_II_SHARED_LINKER_FLAGS_${build}
+#   DEAL_II_LINKER_FLAGS_${build}
 #   DEAL_II_CXX_FLAGS_${build}
 #   DEAL_II_DEFINITIONS_${build}
 #
 # as well as the global (for all build types)
-#   CMAKE_SHARED_LINKER_FLAGS
+#   DEAL_II_LINKER_FLAGS
 #   CMAKE_CXX_FLAGS
 #   DEAL_II_DEFINITIONS
 #
@@ -37,7 +39,7 @@ MACRO(DEAL_II_ADD_LIBRARY _library)
       )
 
     SET_TARGET_PROPERTIES(${_library}.${_build_lowercase} PROPERTIES
-      LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_${_build}}"
+      LINK_FLAGS "${DEAL_II_LINKER_FLAGS};${DEAL_II_LINKER_FLAGS_${_build}}"
       COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}"
       COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${_build}}"
       LINKER_LANGUAGE "CXX"
index 6aa654d35b9116ea47beb6aa78de18ddc542fa8f..bcd842eb097fcd5ef0ccdac9a02fa98d705f5411 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # This file implements the DEAL_II_INITIALIZE_VARIABLES macro, which is
@@ -49,24 +51,34 @@ MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES)
   ENDIF()
 
   #
-  # Bail out if build type is unknown...
-  #
-  IF( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND
-      NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
-    MESSAGE(FATAL_ERROR
-      "\nCMAKE_BUILD_TYPE does neither match Release nor Debug!\n\n"
-      )
-  ENDIF()
-  #
-  # ... or unsupported
+  # Reset build type if unsupported:
   #
   IF(NOT DEAL_II_BUILD_TYPE MATCHES "${CMAKE_BUILD_TYPE}")
-    MESSAGE(FATAL_ERROR "\n"
-      "CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\" unsupported by current installation!\n"
-      "deal.II was build with \"${DEAL_II_BUILD_TYPE}\" only build type.\n\n"
+    IF("${DEAL_II_BUILD_TYPE}" STREQUAL "DebugRelease")
+      SET(_new_build_type "Debug")
+    ELSE()
+      SET(_new_build_type "${DEAL_II_BUILD_TYPE}")
+    ENDIF()
+
+    MESSAGE(
+"###
+#
+#  WARNING:
+#
+#  CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\" unsupported by current installation!
+#  deal.II was built with CMAKE_BUILD_TYPE \"${DEAL_II_BUILD_TYPE}\".
+#
+#  CMAKE_BUILD_TYPE is forced to \"${_new_build_type}\".
+#
+###"
+      )
+    SET(CMAKE_BUILD_TYPE "${_new_build_type}" CACHE STRING
+      "Choose the type of build, options are: Debug, Release"
+      FORCE
       )
   ENDIF()
 
+
   SET(CMAKE_CXX_COMPILER ${DEAL_II_CXX_COMPILER} CACHE STRING
     "CXX Compiler.")
 
index e643446317817784650321d1267fa817c7565bbb..a895702cd69f61d83e506e5efe90050a1e004d55 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # This file implements the DEAL_II_INVOKE_AUTOPILOT macro, which is
@@ -81,22 +83,22 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT)
     ENDIF()
 
     # Define custom targets to easily switch the build type:
-    IF(${DEAL_II_BUILD_TYPE} MATCHES "Debug")
-      ADD_CUSTOM_TARGET(debug
-        COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
-        COMMENT "Switch CMAKE_BUILD_TYPE to Debug"
-        )
-      SET(_switch_targets
-        "#      $ make debug          - to switch the build type to \"Debug\"\n"
-        )
-    ENDIF()
-    IF(${DEAL_II_BUILD_TYPE} MATCHES "Release")
-      ADD_CUSTOM_TARGET(release
-        COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
-        COMMENT "Switch CMAKE_BUILD_TYPE to Release"
-        )
+    ADD_CUSTOM_TARGET(debug
+      COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
+      COMMENT "Switch CMAKE_BUILD_TYPE to Debug"
+      )
+
+    ADD_CUSTOM_TARGET(release
+      COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
+      COMMENT "Switch CMAKE_BUILD_TYPE to Release"
+      )
+
+    # Only mention release and debug targets if it is actuallay possible to
+    # switch between them:
+    IF(${DEAL_II_BUILD_TYPE} MATCHES "DebugRelease")
       SET(_switch_targets
-        "${_switch_targets}#      $ make release        - to switch the build type to \"Release\"\n"
+"#      $ make debug          - to switch the build type to \"Debug\"
+#      $ make release        - to switch the build type to \"Release\"\n"
         )
     ENDIF()
 
index ef17eb7e7fca95fa7d32773a8007b53c9ef556ba..e98bd2557632d6ca15e6cf9749bf275b560ece09 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # This file implements the DEAL_II_SETUP_TARGET macro, which is
@@ -68,7 +70,7 @@ MACRO(DEAL_II_SETUP_TARGET _target)
   #
   # If the global property DEBUG_CONFIGURATIONS is set all build
   # types that (case insensitive) match one of the listed build types is
-  # considered a "debug" build. Ther rest is "optimized".
+  # considered a "debug" build. The rest is "optimized".
   #
   # Otherwise every build type that (case insensitively) matches "debug" is
   # considered a debug build.
@@ -116,4 +118,14 @@ MACRO(DEAL_II_SETUP_TARGET _target)
   #
   TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET})
 
+  #
+  # If DEAL_II_STATIC_EXECUTABLE is set, switch the final link type to
+  # static:
+  #
+  IF(DEAL_II_STATIC_EXECUTABLE)
+    SET_PROPERTY(TARGET ${_target} PROPERTY
+      LINK_SEARCH_END_STATIC TRUE
+      )
+  ENDIF()
+
 ENDMACRO()
index e2d2a2b9e3711404a1c7ce148417e8f93e734e4e..0f4ef07e965dd60217f757a4ba4df91f94f88735 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Tests whether it is possible to compile and link a dummy program with a
index 9c98c9155ea74fca9b8c45d135074d6aa0b3e253..8e26c7b0c77c91f20876b9268586d8a4c36779c1 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Tests whether the cxx compiler understands a flag.
@@ -26,6 +28,7 @@ MACRO(ENABLE_IF_SUPPORTED _variable _flag)
     STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}")
     STRING(REPLACE "," "" _flag_name "${_flag_name}")
     STRING(REPLACE "--" "__" _flag_name "${_flag_name}")
+    STRING(REPLACE "++" "__" _flag_name "${_flag_name}")
     CHECK_CXX_COMPILER_FLAG(
       "${_flag_stripped}"
       DEAL_II_HAVE_FLAG_${_flag_name}
diff --git a/deal.II/cmake/macros/macro_enable_language_optional.cmake b/deal.II/cmake/macros/macro_enable_language_optional.cmake
new file mode 100644 (file)
index 0000000..885b960
--- /dev/null
@@ -0,0 +1,66 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+
+#
+# Test whether a usable language compiler is available and if yes, call
+# ENABLE_LANGUAGE(language)
+#
+# This works around a severe bug [1] in
+#
+#   ENABLE_LANGUAGE(Fortran OPTIONAL)
+#
+# [1] http://public.kitware.com/Bug/view.php?id=9220
+#
+# Usage:
+#     ENABLE_LANGUAGE_FORTRAN_OPTIONAL(language)
+#
+# where language is either C or Fortran
+#
+
+MACRO(ENABLE_LANGUAGE_OPTIONAL _language)
+  #
+  # Run this check exactly once:
+  #
+  IF(NOT ${_language}_CHECKED)
+    SET(${_language}_CHECKED TRUE CACHE INTERNAL "" FORCE)
+
+    SET(_tmp ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/${_language}_test)
+    file(REMOVE ${_tmp})
+
+    IF(DEFINED CMAKE_${_language}_COMPILER)
+      SET(_hint "-DCMAKE_${_language}_COMPILER=${CMAKE_${_language}_COMPILER}")
+    ENDIF()
+
+    FILE(WRITE ${_tmp}/CMakeLists.txt
+      "PROJECT(foobar ${_language})"
+      )
+
+    EXECUTE_PROCESS(
+      COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_hint} .
+      WORKING_DIRECTORY ${_tmp}
+      RESULT_VARIABLE _result
+      OUTPUT_QUIET
+      ERROR_QUIET
+      )
+
+    IF("${_result}" STREQUAL "0")
+      ENABLE_LANGUAGE(${_language})
+    ELSE()
+      MESSAGE(STATUS "No working ${_language} compiler found, disabling ${_language}")
+    ENDIF()
+  ENDIF()
+ENDMACRO()
index f083500249dc8e0732739548fcc7cf0c6973e378..5516eb01de9e9ccbd23b1913dbd1d1015062e59b 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A macro for the inst.in file expansion
index 01adf7a2bcddf23bd9cc3f886f1e6aaa95b20335..c7e65fbe8502710984a63f24177871637cadc52a 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
 ## Copyright (C) 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small wrapper around FIND_PACKAGE.
index 748661a2e6366261a1ff7c1c674ba5620baaa3a6..3e747bb4c43eebce34f549a2327ce70e376f265f 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small macro to test whether a given list contains an element.
index c39529c40e09f25234d0471a41d7e9dc56dd2797..045fe43e2f5244589e51bd394382c9f16cfd08aa 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small macro used in the platform checks to remove the right most flag in
index 23f6f30f87990cd49cd89e85e4396a2fad30fccc..905ce92e169e0ecf52c730ab7287c02c9f878f7c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small macro used in the platform checks to easily add a flag to
index 5ab43cac497f424161dea2a661fe008a8bfcbfaf..22dd7bafa0699d58a2b4504c555fa828a6273af7 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Replace all occurences of "${flag}" with "${replacement}" in the string
index 98031b0492643a60e52800faa919bf7e5714aebc..43f0125445561f44fa0d6ffb96fddc6d9053c7b8 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # If 'variable' is empty it will be set to 'value'
index c39c5fb4c53a2edfb418dc6022adfc20670df60a..dd05b98c9cc056e3c38fb9b1bc97821ed93a5245 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
 ## Copyright (C) 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 
 #
index d90979ad9b61c11d16f7250c509df8bfc36eaa97..c1eb32d8e00275747f44b781315c3541ec0077d8 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Remove all occurences of "${flag}" in the string variable.
diff --git a/deal.II/cmake/macros/macro_switch_library_preference.cmake b/deal.II/cmake/macros/macro_switch_library_preference.cmake
new file mode 100644 (file)
index 0000000..9f61f9b
--- /dev/null
@@ -0,0 +1,33 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# This macro toggles the preference for static/shared libraries if
+# DEAL_II_PREFER_STATIC_LIBS=TRUE but the final executable will still be
+# dynamically linked, i.e. DEAL_II_STATIC_EXECUTABLE=OFF
+#
+# Usage:
+#     SWITCH_LIBRARY_PREFERENCE()
+#
+
+MACRO(SWITCH_LIBRARY_PREFERENCE)
+  IF(DEAL_II_PREFER_STATIC_LIBS AND NOT DEAL_II_STATIC_EXECUTABLE)
+    #
+    # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS
+    # is set. This will prefer static archives instead of shared libraries:
+    LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
+  ENDIF()
+ENDMACRO()
index 7f52449d381502898037444d8247c2f50cc5da52..95b6b06aea9e3bfecfbd6d43956c254f0f940997 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small macro used for converting a list into a space
index 8a7214f114f093ac854ead0fc94ff07bae399d84..f382578a97a969835d1e62165d168da11e8b9e4b 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A small macro used for converting a cmake list into a space
index a57f307961e6bf37390da493386cf9bf741a2ac8..243899b9e0062937cc1d597f3b7c888ca46b5465 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the ARPACK library
@@ -46,21 +48,23 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ARPACK DEFAULT_MSG
   LAPACK_FOUND
   )
 
+MARK_AS_ADVANCED(
+  lapack_LIBRARY
+  atlas_LIBRARY
+  blas_LIBRARY
+  ARPACK_LIBRARY
+  )
+
 IF(ARPACK_FOUND)
   SET(ARPACK_LIBRARIES
-    ${ARPACK_LIBRARY} ${LAPACK_LIBRARIES}
+    ${ARPACK_LIBRARY}
+    ${LAPACK_LIBRARIES}
     )
   SET(ARPACK_LINKER_FLAGS
     ${LAPACK_LINKER_FLAGS}
     )
 
-  MARK_AS_ADVANCED(
-    lapack_LIBRARY
-    atlas_LIBRARY
-    blas_LIBRARY
-    ARPACK_LIBRARY
-    ARPACK_DIR
-  )
+  MARK_AS_ADVANCED(ARPACK_DIR)
 ELSE()
   SET(ARPACK_DIR "" CACHE PATH
     "An optional hint to an ARPACK installation"
index 12675f7ed2407a811b87a54d37c71617586589c8..bac83af2d6fa94ab469d53f36bb7a75db154e888 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the HDF5 library
@@ -47,9 +49,15 @@ FIND_LIBRARY(HDF5_HL_LIBRARY NAMES hdf5_hl
     lib${LIB_SUFFIX} lib64 lib
   )
 
-SET(_output ${HDF5_LIBRARY} ${HDF5_HL_LIBRARY})
+SET(_output ${HDF5_HL_LIBRARY} ${HDF5_LIBRARY})
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDF5 DEFAULT_MSG
   _output # Cosmetic: Gives nice output
+  HDF5_HL_LIBRARY
+  HDF5_LIBRARY
+  HDF5_INCLUDE_DIR
+  )
+
+MARK_AS_ADVANCED(
   HDF5_LIBRARY
   HDF5_HL_LIBRARY
   HDF5_INCLUDE_DIR
@@ -60,8 +68,9 @@ IF(HDF5_FOUND)
     ${HDF5_INCLUDE_DIR}
     )
   SET(HDF5_LIBRARIES
-    ${HDF5_LIBRARY}
     ${HDF5_HL_LIBRARY}
+    ${HDF5_LIBRARY}
+    ${MPI_C_LIBRARIES} # for good measure
     )
 
   #
@@ -75,12 +84,7 @@ IF(HDF5_FOUND)
     SET(HDF5_WITH_MPI TRUE)
   ENDIF()
 
-  MARK_AS_ADVANCED(
-    HDF5_DIR
-    HDF5_LIBRARY
-    HDF5_HL_LIBRARY
-    HDF5_INCLUDE_DIR
-    )
+  MARK_AS_ADVANCED(HDF5_DIR)
 ELSE()
   SET(HDF5_DIR "" CACHE PATH
     "An optional hint to an hdf5 directory"
index b0a92789ee3618228b5046314b34dc69b293c3a6..f0cfa9eba7c7271bbc5a774510af4b9729c51849 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the (serial) METIS library
@@ -26,8 +28,10 @@ INCLUDE(FindPackageHandleStandardArgs)
 SET_IF_EMPTY(METIS_DIR "$ENV{METIS_DIR}")
 
 #
-# TODO: Metis is usually pretty self contained. So no external dependencies
-# so far... But there could be dependencies on pcre and mpi...
+# Metis is usually pretty self contained. So no external dependencies
+# so far. But there could be dependencies on pcre and mpi...
+#
+# Link in MPI unconditionally (if found).
 #
 
 FIND_PATH(METIS_INCLUDE_DIR metis.h
@@ -47,13 +51,37 @@ FIND_LIBRARY(METIS_LIBRARY
     build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libmetis
   )
 
+FIND_LIBRARY(PARMETIS_LIBRARY
+  NAMES parmetis
+  HINTS
+    ${METIS_DIR}
+  PATH_SUFFIXES
+    lib${LIB_SUFFIX} lib64 lib
+    # This is a hint, isn't it?
+    build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libmetis
+  )
+
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG
   METIS_LIBRARY
   METIS_INCLUDE_DIR
   )
 
+MARK_AS_ADVANCED(
+  METIS_LIBRARY
+  PARMETIS_LIBRARY
+  METIS_INCLUDE_DIR
+  )
+
 IF(METIS_FOUND)
-  SET(METIS_LIBRARIES ${METIS_LIBRARY})
+
+  IF(NOT PARMETIS_LIBRARY MATCHES "-NOTFOUND")
+    SET(METIS_LIBRARIES ${PARMETIS_LIBRARY})
+  ENDIF()
+
+  LIST(APPEND METIS_LIBRARIES
+    ${METIS_LIBRARY}
+    ${MPI_C_LIBRARIES} # for good measure
+    )
   SET(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
 
   #
@@ -67,11 +95,7 @@ IF(METIS_FOUND)
     REGEX "METIS_VER_MINOR")
   STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" METIS_MINOR "${METIS_MINOR_STRING}")
 
-  MARK_AS_ADVANCED(
-    METIS_LIBRARY
-    METIS_INCLUDE_DIR
-    METIS_DIR
-  )
+  MARK_AS_ADVANCED(METIS_DIR)
 ELSE()
   SET(METIS_DIR "" CACHE PATH
     "An optional hint to a metis directory"
index 0c3bcf2952e2136acf95e6bb749a5cc37e9f1ede..24e48975de730fd6087634f502926b43b50a9620 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the MUMPS library
@@ -31,11 +33,8 @@ INCLUDE(FindPackageHandleStandardArgs)
 # (We'll rely on the user of FindMUMPS, setting up mpi *cough*)
 #
 FIND_PACKAGE(SCALAPACK) # which will also include lapack and blas
+FIND_PACKAGE(METIS)
 
-#
-# TODO: mumps might link to scotch and or metis as well. Ignore this for
-#       now. :-]
-#
 
 FIND_PATH(MUMPS_INCLUDE_DIR dmumps_c.h
   HINTS
@@ -62,7 +61,7 @@ FIND_LIBRARY(MUMPS_COMMON_LIBRARY
 # If we can find libport.so (or similiar), link it in as well:
 #
 FIND_LIBRARY(PORD_LIBRARY
-  NAMES port
+  NAMES pord
   HINTS
     ${MUMPS_DIR}
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
@@ -82,6 +81,13 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUMPS DEFAULT_MSG
   SCALAPACK_FOUND
   )
 
+MARK_AS_ADVANCED(
+  DMUMPS_LIBRARY
+  MUMPS_COMMON_LIBRARY
+  MUMPS_INCLUDE_DIR
+  PORT_LIBRARY
+  )
+
 IF(MUMPS_FOUND)
   SET(MUMPS_INCLUDE_DIRS
     ${MUMPS_INCLUDE_DIR}
@@ -89,19 +95,16 @@ IF(MUMPS_FOUND)
   SET(MUMPS_LIBRARIES
     ${DMUMPS_LIBRARY}
     ${MUMPS_COMMON_LIBRARY}
+    ${PORD_LIBRARY}
     ${SCALAPACK_LIBRARIES}
-    ${MPI_CXX_LIBRARIES} # For good measure
+    ${METIS_LIBRARIES}       # for good measure
+    ${MPI_Fortran_LIBRARIES} # for good measure
     )
   SET(MUMPS_LINKER_FLAGS
     ${SCALAPACK_LINKER_FLAGS}
     )
 
-  MARK_AS_ADVANCED(
-    DMUMPS_LIBRARY
-    MUMPS_COMMON_LIBRARY
-    MUMPS_INCLUDE_DIR
-    PORT_LIBRARY
-  )
+  MARK_AS_ADVANCED(MUMPS_DIR)
 ELSE()
   SET(MUMPS_DIR "" CACHE PATH
     "An optional hint to a mumps directory"
index 0ae1cf535c192a123ac317b6fe33365e5dea68aa..066decd95edf984707e5b18ede8479408c47d434 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the NETCDF C and C++ libraries
@@ -61,6 +63,12 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETCDF DEFAULT_MSG
   NETCDF_INCLUDE_DIR
   )
 
+MARK_AS_ADVANCED(
+  NETCDF_CPLUSPLUS_LIBRARY
+  NETCDF_C_LIBRARY
+  NETCDF_INCLUDE_DIR
+  )
+
 IF(NETCDF_FOUND)
   SET(NETCDF_INCLUDE_DIRS
     ${NETCDF_INCLUDE_DIR}
@@ -70,12 +78,7 @@ IF(NETCDF_FOUND)
     ${NETCDF_C_LIBRARY}
     )
 
-  MARK_AS_ADVANCED(
-    NETCDF_CPLUSPLUS_LIBRARY
-    NETCDF_C_LIBRARY
-    NETCDF_INCLUDE_DIR
-    NETCDF_DIR
-  )
+  MARK_AS_ADVANCED(NETCDF_DIR)
 ELSE()
   SET(NETCDF_DIR "" CACHE PATH
     "An optional hint to a NETCDF installation"
index e2c0727dc8bddb5493acd215e34c911292636552..06e031198a2c8214f0c1ad1530ff966a1d466f5a 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the P4EST library
@@ -82,16 +84,26 @@ FIND_LIBRARY(SC_LIBRARY
 
 SET(_output ${P4EST_LIBRARY} ${SC_LIBRARY})
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG
+  _output # Cosmetic: Gives nice output
   P4EST_LIBRARY
   SC_LIBRARY
   P4EST_INCLUDE_DIR
   SC_INCLUDE_DIR
   )
 
+MARK_AS_ADVANCED(
+  P4EST_LIBRARY
+  P4EST_INCLUDE_DIR
+  SC_LIBRARY
+  SC_INCLUDE_DIR
+  )
+
 IF(P4EST_FOUND)
   SET(P4EST_LIBRARIES
     ${P4EST_LIBRARY}
     ${SC_LIBRARY}
+    ${LAPACK_LIBRARIES} # for good measure
+    ${MPI_C_LIBRARIES} # for good measure
     )
   SET(P4EST_INCLUDE_DIRS
     ${P4EST_INCLUDE_DIR}
@@ -109,13 +121,7 @@ IF(P4EST_FOUND)
     SET(P4EST_WITH_MPI TRUE)
   ENDIF()
 
-  MARK_AS_ADVANCED(
-    P4EST_DIR
-    P4EST_LIBRARY
-    P4EST_INCLUDE_DIR
-    SC_LIBRARY
-    SC_INCLUDE_DIR
-  )
+  MARK_AS_ADVANCED(P4EST_DIR)
 ELSE()
   SET(P4EST_DIR "" CACHE PATH
     "An optional hint to a p4est installation/directory"
index e61211b6f0a160df99cc6b787215ed2dc098ac09..119fa42026a9d27e7e6b43d3ad35766239990ab4 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the petsc library
@@ -26,6 +28,7 @@
 #     PETSC_VERSION_SUBMINOR
 #     PETSC_VERSION_PATCH
 #     PETSC_WITH_MPIUNI
+#     PETSC_WITH_64BIT_INDICES
 #
 
 INCLUDE(FindPackageHandleStandardArgs)
@@ -51,8 +54,8 @@ FIND_LIBRARY(PETSC_LIBRARY
 FIND_FILE(PETSC_PETSCVARIABLES
   NAMES petscvariables
   HINTS
-    ${PETSC_DIR}
     ${PETSC_DIR}/${PETSC_ARCH}
+    ${PETSC_DIR}
   PATH_SUFFIXES conf
   )
 
@@ -74,7 +77,7 @@ IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")
       IF(NOT _token MATCHES "(petsc|stdc\\+\\+|gcc_s)")
         FIND_LIBRARY(PETSC_LIBRARY_${_token}
           NAMES ${_token}
-          HINTS ${_hintes}
+          HINTS ${_hints}
           )
         IF(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND")
           LIST(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}})
@@ -129,6 +132,14 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PETSC DEFAULT_MSG
   PETSC_INCLUDE_DIR_COMMON
   )
 
+MARK_AS_ADVANCED(
+  PETSC_INCLUDE_DIR_ARCH
+  PETSC_INCLUDE_DIR_COMMON
+  PETSC_INCLUDE_DIRS
+  PETSC_LIBRARY
+  PETSC_PETSCVARIABLES
+  )
+
 IF(PETSC_FOUND)
   SET(PETSC_LIBRARIES
     ${PETSC_LIBRARY}
@@ -153,6 +164,17 @@ IF(PETSC_FOUND)
     SET(PETSC_WITH_MPIUNI TRUE)
   ENDIF()
 
+  #
+  # Is petsc compiled with support for 64BIT_INDICES?
+  #
+  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_64BIT_INDICES_STRING
+    REGEX "#define.*PETSC_USE_64BIT_INDICES 1")
+  IF("${PETSC_64BIT_INDICES_STRING}" STREQUAL "")
+    SET(PETSC_WITH_64BIT_INDICES FALSE)
+  ELSE()
+    SET(PETSC_WITH_64BIT_INDICES TRUE)
+  ENDIF()
+
   FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING
     REGEX "#define.*PETSC_VERSION_MAJOR")
   STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1"
@@ -179,15 +201,7 @@ IF(PETSC_FOUND)
 
   SET(PETSC_VERSION "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}")
 
-  MARK_AS_ADVANCED(
-    PETSC_ARCH
-    PETSC_DIR
-    PETSC_INCLUDE_DIR_ARCH
-    PETSC_INCLUDE_DIR_COMMON
-    PETSC_INCLUDE_DIRS
-    PETSC_LIBRARY
-    PETSC_PETSCVARIABLES
-  )
+  MARK_AS_ADVANCED(PETSC_ARCH PETSC_DIR)
 ELSE()
   SET(PETSC_DIR "" CACHE PATH
     "An optional hint to a PETSc directory"
index 5b06ce3233b8c1526f86a6b1b36fb2ff81c526d4..4cd616dbaee956bba9a5d4d2b7b7dc7158422f6c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the SCALAPACK library
@@ -49,7 +51,7 @@ FIND_PACKAGE(LAPACK)
 FOREACH(_lib blacs blacsCinit blacsF77init)
   STRING(TOUPPER "${_lib}" _lib_upper)
   FIND_LIBRARY(${_lib_upper}_LIBRARY
-    NAMES ${_lib} ${_lib}_MPI-LINUX-0
+    NAMES ${_lib} ${_lib}_MPI-LINUX-0 ${_lib}_MPI-DARWIN-0
     HINTS
       ${BLACS_DIR}
       ${SCALAPACK_DIR}
@@ -71,27 +73,28 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCALAPACK DEFAULT_MSG
   LAPACK_FOUND
   )
 
+MARK_AS_ADVANCED(
+  lapack_LIBRARY
+  atlas_LIBRARY
+  blas_LIBRARY
+  SCALAPACK_LIBRARY
+  BLACS_LIBRARY
+  BLACSCINIT_LIBRARY
+  BLACSF77INIT_LIBRARY
+  )
+
 IF(SCALAPACK_FOUND)
   SET(SCALAPACK_LIBRARIES
     ${SCALAPACK_LIBRARY}
     ${LAPACK_LIBRARIES}
     ${BLACS_LIBRARIES}
+    ${MPI_Fortran_LIBRARIES} # for good measure
     )
   SET(SCALAPACK_LINKER_FLAGS
     ${LAPACK_LINKER_FLAGS}
     )
 
-  MARK_AS_ADVANCED(
-    lapack_LIBRARY
-    atlas_LIBRARY
-    blas_LIBRARY
-    SCALAPACK_DIR
-    SCALAPACK_LIBRARY
-    BLACS_DIR
-    BLACS_LIBRARY
-    BLACSCINIT_LIBRARY
-    BLACSF77INIT_LIBRARY
-    )
+  MARK_AS_ADVANCED(SCALAPACK_DIR BLACS_DIR)
 ELSE()
   SET(SCALAPACK_DIR "" CACHE PATH
     "An optional hint to a SCALAPACK directory"
index b4c5c04676dfe5a7e777a922ba04dd2d4754774d..ddb706d05b4b47998254d9f9d144585a5b7d258c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the SLEPC library
@@ -75,6 +77,14 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SLEPC DEFAULT_MSG
   PETSC_FOUND
   )
 
+MARK_AS_ADVANCED(
+  SLEPC_DIR
+  SLEPC_INCLUDE_DIR_ARCH
+  SLEPC_INCLUDE_DIR_COMMON
+  SLEPC_INCLUDE_DIRS
+  SLEPC_LIBRARY
+  )
+
 IF(SLEPC_FOUND)
   SET(SLEPC_INCLUDE_DIRS
     ${SLEPC_INCLUDE_DIR_ARCH}
@@ -113,13 +123,7 @@ IF(SLEPC_FOUND)
 
   SET(SLEPC_VERSION "${SLEPC_VERSION_MAJOR}.${SLEPC_VERSION_MINOR}.${SLEPC_VERSION_SUBMINOR}")
 
-  MARK_AS_ADVANCED(
-    SLEPC_DIR
-    SLEPC_INCLUDE_DIR_ARCH
-    SLEPC_INCLUDE_DIR_COMMON
-    SLEPC_INCLUDE_DIRS
-    SLEPC_LIBRARY
-  )
+  MARK_AS_ADVANCED(SLEPC_DIR)
 ELSE()
   SET(SLEPC_DIR "" CACHE PATH
     "An optional hint to a SLEPC directory"
index b3bc3ad2881f2c43a381ba8d2bbdacd71d694804..4c45373cecd89e6ca8cbdf1d68347cee717b73fb 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the Threading Building Blocks library
@@ -57,8 +59,13 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB DEFAULT_MSG
   TBB_INCLUDE_DIR
   )
 
+MARK_AS_ADVANCED(
+  TBB_LIBRARY
+  TBB_DEBUG_LIBRARY
+  TBB_INCLUDE_DIR
+  )
+
 IF(TBB_FOUND)
-  MARK_AS_ADVANCED(TBB_LIBRARY TBB_DEBUG_LIBRARY TBB_INCLUDE_DIR)
 
   IF(NOT TBB_DEBUG_LIBRARY MATCHES "-NOTFOUND")
     SET(TBB_WITH_DEBUGLIB TRUE)
@@ -69,8 +76,8 @@ IF(TBB_FOUND)
 
   SET(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
 
+  MARK_AS_ADVANCED(TBB_DIR)
 ELSE()
-
   SET(TBB_DIR "" CACHE PATH
     "An optional hint to a TBB installation"
     )
index 0c30184f78fa58fe438c2837fb16ab4010e5ff4e..f5f8d2240df28728684876897210e93ed334ed34 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the Trilinos library
@@ -76,11 +78,21 @@ FOREACH(_library ${Trilinos_LIBRARIES})
   UNSET(TRILINOS_LIBRARY_${_library} CACHE)
 ENDFOREACH()
 
+#
+# Add the link interface:
+#
+LIST(APPEND TRILINOS_LIBRARIES
+  ${Trilinos_TPL_LIBRARIES}
+  ${MPI_CXX_LIBRARIES} # for good measure
+  )
+
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TRILINOS DEFAULT_MSG
   TRILINOS_LIBRARIES # cosmetic: Gives nice output
   TRILINOS_CONFIG_FOUND
   )
 
+MARK_AS_ADVANCED(TRILINOS_CONFIG_DIR)
+
 
 IF(TRILINOS_FOUND)
   #
@@ -99,7 +111,7 @@ IF(TRILINOS_FOUND)
     TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}")
 
   #
-  # Determine whether Trilinos was configured with MPI:
+  # Determine whether Trilinos was configured with MPI and 64bit indices:
   #
   FIND_FILE(EPETRA_CONFIG_H Epetra_config.h
     HINTS ${TRILINOS_INCLUDE_DIRS}
@@ -117,16 +129,25 @@ IF(TRILINOS_FOUND)
   ELSE()
     SET(TRILINOS_WITH_MPI TRUE)
   ENDIF()
+  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_32BIT_STRING
+    REGEX "#define EPETRA_NO_32BIT_GLOBAL_INDICES")
+  IF("${EPETRA_64BIT_STRING}" STREQUAL "")
+    SET(TRILINOS_WITH_NO_32BITS_INDICES TRUE)
+  ELSE()
+    SET(TRILINOS_WITH_NO_32BITS_INDICES FALSE)
+  ENDIF()
+  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_64BIT_STRING
+    REGEX "#define EPETRA_NO_64BIT_GLOBAL_INDICES")
+  IF("${EPETRA_64BIT_STRING}" STREQUAL "")
+    SET(TRILINOS_WITH_NO_64BITS_INDICES TRUE)
+  ELSE()
+    SET(TRILINOS_WITH_NO_64BITS_INDICES FALSE)
+  ENDIF()
 
   UNSET(EPETRA_CONFIG_H CACHE)
 
-  MARK_AS_ADVANCED(
-    TRILINOS_DIR
-    TRILINOS_CONFIG_DIR
-    )
-
+  MARK_AS_ADVANCED(TRILINOS_DIR)
 ELSE()
-
   SET(TRILINOS_DIR "" CACHE PATH
     "An optional hint to a Trilinos installation"
     )
index 029e8708db09da0da2307f0f645768d1193d0706..378b68cb565078cc8d15a9f8aa125414bada7eb4 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Try to find the UMFPACK library
@@ -35,6 +37,7 @@ ENDFOREACH()
 # now.
 #
 FIND_PACKAGE(LAPACK)
+FIND_PACKAGE(METIS)
 
 #
 # Two macros to make life easier:
@@ -103,9 +106,11 @@ FIND_UMFPACK_LIBRARY(UMFPACK umfpack REQUIRED)
 FIND_UMFPACK_LIBRARY(AMD amd REQUIRED)
 FIND_UMFPACK_LIBRARY(CHOLMOD cholmod)
 FIND_UMFPACK_LIBRARY(COLAMD colamd)
+FIND_UMFPACK_LIBRARY(CCOLAMD ccolamd)
+FIND_UMFPACK_LIBRARY(CAMD camd)
 FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig)
 
-SET(_output ${UMFPACK_LIBRARY} ${CHOLMOD_LIBRARY} ${COLAMD_LIBRARY} ${AMD_LIBRARY} ${SuiteSparse_config_LIBRARY})
+SET(_output ${UMFPACK_LIBRARY} ${CHOLMOD_LIBRARY} ${CCOLAMD_LIBRARY} ${COLAMD_LIBRARY} ${CAMD_LIBRARY} ${AMD_LIBRARY} ${SuiteSparse_config_LIBRARY})
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG
   _output # Cosmetic: Gives nice output
   UMFPACK_LIBRARY
@@ -116,27 +121,54 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG
   LAPACK_FOUND
   )
 
+MARK_AS_ADVANCED(
+  AMD_INCLUDE_DIR
+  AMD_LIBRARY
+  atlas_LIBRARY
+  blas_LIBRARY
+  CAMD_LIBRARY
+  CHOLMOD_LIBRARY
+  CCOLAMD_LIBRARY
+  COLAMD_LIBRARY
+  SuiteSparse_config_INCLUDE_DIR
+  SuiteSparse_config_LIBRARY
+  UMFPACK_INCLUDE_DIR
+  UMFPACK_LIBRARY
+  )
+
 
 IF(UMFPACK_FOUND)
   SET(UMFPACK_LIBRARIES
     ${UMFPACK_LIBRARY}
     ${CHOLMOD_LIBRARY}
+    ${CCOLAMD_LIBRARY}
     ${COLAMD_LIBRARY}
+    ${CAMD_LIBRARY}
     ${AMD_LIBRARY}
     ${SuiteSparse_config_LIBRARY}
-    ${LAPACK_LIBRARIES}
     )
 
+  #
+  # For good measure:
+  #
+  IF(METIS_FOUND)
+    LIST(APPEND UMFPACK_LIBRARIES ${METIS_LIBRARIES})
+  ENDIF()
+
+  LIST(APPEND UMFPACK_LIBRARIES ${LAPACK_LIBRARIES})
+
   #
   # Add rt to the link interface as well (for whatever reason,
   # libsuitesparse.so depends on clock_gettime but the shared
   # lib does not record its dependence on librt.so as evidenced
   # by ldd :-( ):
   #
-  FIND_LIBRARY(rt_lib NAMES rt)
-  MARK_AS_ADVANCED(rt_lib)
-  IF(NOT rt_lib MATCHES "-NOTFOUND")
-    LIST(APPEND UMFPACK_LIBRARIES ${rt_lib})
+  SWITCH_LIBRARY_PREFERENCE()
+  FIND_LIBRARY(rt_LIBRARY NAMES rt)
+  SWITCH_LIBRARY_PREFERENCE()
+  MARK_AS_ADVANCED(rt_LIBRARY)
+  IF(NOT rt_LIBRARY MATCHES "-NOTFOUND")
+    LIST(APPEND UMFPACK_LIBRARIES ${rt_LIBRARY})
   ENDIF()
 
   SET(UMFPACK_INCLUDE_DIRS
@@ -148,20 +180,7 @@ IF(UMFPACK_FOUND)
     ${LAPACK_LINKER_FLAGS}
     )
 
-  MARK_AS_ADVANCED(
-    atlas_LIBRARY
-    blas_LIBRARY
-    UMFPACK_LIBRARY
-    AMD_LIBRARY
-    CHOLMOD_LIBRARY
-    COLAMD_LIBRARY
-    SuiteSparse_config_LIBRARY
-    UMFPACK_INCLUDE_DIR
-    AMD_INCLUDE_DIR
-    SuiteSparse_config_INCLUDE_DIR
-    UMFPACK_DIR
-    SUITESPARSE_DIR
-  )
+  MARK_AS_ADVANCED(UMFPACK_DIR SUITESPARSE_DIR)
 ELSE()
   SET(UMFPACK_DIR "" CACHE PATH
     "An optional hint to an UMFPACK directory"
index 80272980de53d522672a5a29f5f35016ee45923d..5ac93c43cc2bb55b93e560efbad9b899558550d4 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 ADD_EXECUTABLE(expand_instantiations expand_instantiations.cc)
 IF(NOT CMAKE_CROSSCOMPILING)
@@ -49,12 +51,31 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
   ADD_EXECUTABLE(report_features
     ${CMAKE_CURRENT_BINARY_DIR}/report_features.cc
     )
+
+  #
+  # Link report_features in the same way as the library/final executable:
+  #
   TARGET_LINK_LIBRARIES(report_features ${DEAL_II_EXTERNAL_LIBRARIES})
   SET_TARGET_PROPERTIES(report_features
     PROPERTIES
-    LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}"
+    LINK_FLAGS "${DEAL_II_LINKER_FLAGS}"
     COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS}"
     )
+  IF(DEAL_II_STATIC_EXECUTABLE)
+    SET_PROPERTY(TARGET report_features PROPERTY
+      LINK_SEARCH_END_STATIC TRUE
+      )
+  ENDIF()
+
+  #
+  # A custom target with the same name as the component:
+  #
+  ADD_CUSTOM_TARGET(compat_files
+    DEPENDS
+      expand_instantiations
+      make_dependencies
+      report_features
+    )
 
   IF(NOT CMAKE_CROSSCOMPILING)
     ADD_CUSTOM_TARGET(run_report_features COMMAND report_features)
index 8f62d4ed7141c8c6ebf6e15f7b4886980cc8e905..6f89828b701e3a8f54645796f88a79c202996464 100644 (file)
@@ -1,15 +1,19 @@
-//----------------------------  expand_instantiations.cc  -------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2009, 2010, 2011 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  expand_instantiations.cc  -------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 // This is the program that we use to generate explicit instantiations for a
 // variety of template arguments. It takes two kinds of input files. The first
index 1e6e2bb2f6e2a9da41aa05a9b523ec4d6acf0b1e..b7796338bf24598f50d66740439f479e6f46616b 100644 (file)
@@ -1,15 +1,19 @@
-//----------------------------  make_dependencies.cc  ------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2007, 2008, 2010, 2011 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  make_dependencies.cc  ------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 // Make a dependency file tree
 // usage: make_depencies -Iinc_path1 -Iinc_path2 ... -Bbasepath files
index 6e9570453f8501b9d95809c85108dddb41db8c95..457d226e04b8b62faa63922a4455f5d58ba0bd3f 100644 (file)
@@ -1,15 +1,18 @@
-//----------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/config.h>
 
@@ -61,7 +64,7 @@ int main()
   if(${_shared_libs})
     std::cout << "dealii-feature: shared_libs=yes" << std::endl;
   else
-    std::cout << "dealii-feature: shared_libs=yes" << std::endl;
+    std::cout << "dealii-feature: shared_libs=no" << std::endl;
 
 #ifdef DEAL_II_WITH_ARPACK
   std::cout << "dealii-feature: ARPACK=yes" << std::endl;
@@ -166,4 +169,7 @@ std::cout << "dealii-feature: BOOST="
   std::cout << "dealii-feature: LibZ=yes" << std::endl;
 #endif
 
+#ifdef DEAL_II_WITH_64BIT_INDICES
+  std::cout << "dealii-feature: 64bit_indices=yes" <<std::endl;
+#endif  
 }
index 22162329563aeeebd94fdeb29a0ed97c2376f0d9..e8667e17c112c9ed1fe5c66061a79c5294002e0a 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Setup cached variables (prior to the PROJECT(deal.II) call)
 #
 # Options regarding compilation and linking:
 #
+#     CMAKE_BUILD_TYPE
 #     DEAL_II_ALLOW_PLATFORM_INTROSPECTION
 #     DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
-#     CMAKE_BUILD_TYPE
 #     BUILD_SHARED_LIBS
+#     DEAL_II_PREFER_STATIC_LIBS
+#     DEAL_II_STATIC_EXECUTABLE
 #     CMAKE_INSTALL_RPATH_USE_LINK_PATH
-#     CMAKE_C_FLAGS
+#     CMAKE_C_FLAGS                     *)
 #     CMAKE_CXX_FLAGS                   *)
-#     CMAKE_SHARED_LINKER_FLAGS         *)
+#     DEAL_II_LINKER_FLAGS              *)
 #     DEAL_II_CXX_FLAGS_DEBUG
-#     DEAL_II_SHARED_LINKER_FLAGS_DEBUG
+#     DEAL_II_LINKER_FLAGS_DEBUG
 #     DEAL_II_CXX_FLAGS_RELEASE
-#     DEAL_II_SHARED_LINKER_FLAGS_RELEASE
+#     DEAL_II_LINKER_FLAGS_RELEASE
+#     DEAL_II_WITH_64BIT_INDICES
 #
 # *)  May also be set via environment variable (CFLAGS, CXXFLAGS, LDFLAGS)
-#     (nonempty cached variable has precedence will not be overwritten by
-#     environment)
+#     (a nonempty cached variable has precedence and will not be
+#     overwritten by environment)
 #
 
 
-###########################################################################
-#                                                                         #
-#                     General configuration options:                      #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                    General configuration options:                    #
+#                                                                      #
+########################################################################
 
 If(DEAL_II_HAVE_BUNDLED_DIRECTORY)
   OPTION(DEAL_II_ALLOW_BUNDLED
@@ -108,23 +113,11 @@ IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
 ENDIF()
 
 
-###########################################################################
-#                                                                         #
-#                        Compilation and linking:                         #
-#                                                                         #
-###########################################################################
-
-OPTION(DEAL_II_ALLOW_PLATFORM_INTROSPECTION
-  "Allow platform introspection for CPU command set, SSE and AVX"
-  ON
-  )
-MARK_AS_ADVANCED(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
-
-OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
-  "Configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
-  ON
-  )
-MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+########################################################################
+#                                                                      #
+#                       Compilation and linking:                       #
+#                                                                      #
+########################################################################
 
 #
 # Setup CMAKE_BUILD_TYPE:
@@ -147,10 +140,46 @@ IF( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND
     )
 ENDIF()
 
+
+OPTION(DEAL_II_ALLOW_PLATFORM_INTROSPECTION
+  "Allow platform introspection for CPU command set, SSE and AVX"
+  ON
+  )
+MARK_AS_ADVANCED(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
+
+OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
+  "Configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
+  ON
+  )
+MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+
 SET(BUILD_SHARED_LIBS "ON" CACHE BOOL
   "Build a shared library"
   )
-MARK_AS_ADVANCED(BUILD_SHARED_LIBS)
+
+OPTION(DEAL_II_PREFER_STATIC_LIBS
+  "Prefer static libraries over dynamic libraries when searching for features and corresponding link interface"
+  OFF
+  )
+MARK_AS_ADVANCED(DEAL_II_PREFER_STATIC_LIBS)
+
+OPTION(DEAL_II_STATIC_EXECUTABLE
+  "Provide a link interface that is suitable for static linkage of executables. Enabling this option forces BUILD_SHARED_LIBS=OFF and DEAL_II_PREFER_STATIC_LIBS=ON"
+  OFF
+  )
+MARK_AS_ADVANCED(DEAL_II_STATIC_EXECUTABLE)
+
+IF(DEAL_II_STATIC_EXECUTABLE)
+  SET(BUILD_SHARED_LIBS "OFF" CACHE BOOL
+    "Build a shared library"
+    FORCE
+    )
+  SET(DEAL_II_PREFER_STATIC_LIBS "ON" CACHE BOOL
+    "Prefer static libraries over dynamic libraries when searching for features and corresponding link interface"
+    FORCE
+    )
+ENDIF()
+
 
 #
 # Set CMAKE_INSTALL_RPATH_USE_LINK_PATH to default to ON and promote to
@@ -161,6 +190,18 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL
   )
 MARK_AS_ADVANCED(CMAKE_INSTALL_RPATH_USE_LINK_PATH)
 
+
+#
+# Define the variable that defines whether we should use 32- or 64-bit
+# global DoF indices.
+#
+OPTION(DEAL_II_WITH_64BIT_INDICES
+  "If set to ON, then use 64-bit data types to represent global degree of freedom indices. The default is to OFF. You only want to set this to ON if you will solve problems with more than 2^31 (approximately 2 billion) unknowns. If set to ON, you also need to ensure that both Trilinos and/or PETSc support 64-bit indices."
+  OFF
+  )
+
+
+
 #
 # Tell the user very prominently, that we're doing things differently w.r.t
 # CMAKE_(C|CXX)_FLAGS_(DEBUG|RELEASE)
@@ -191,6 +232,11 @@ FOREACH(_flag
   CMAKE_C_FLAGS_DEBUG
   CMAKE_C_FLAGS_MINSIZEREL
   CMAKE_C_FLAGS_RELWITHDEBINFO
+  CMAKE_Fortran_FLAGS_RELEASE
+  CMAKE_Fortran_FLAGS_DEBUG
+  CMAKE_Fortran_FLAGS_MINSIZEREL
+  CMAKE_Fortran_FLAGS_RELWITHDEBINFO
+  CMAKE_SHARED_LINKER_FLAGS
   CMAKE_SHARED_LINKER_FLAGS_DEBUG
   CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
   CMAKE_SHARED_LINKER_FLAGS_RELEASE
@@ -204,13 +250,12 @@ ENDFOREACH()
 # Set cached compiler flags to an empty string:
 #
 SET(DEAL_II_USED_FLAGS
-  CMAKE_C_FLAGS
   CMAKE_CXX_FLAGS
   DEAL_II_CXX_FLAGS_DEBUG
   DEAL_II_CXX_FLAGS_RELEASE
-  CMAKE_SHARED_LINKER_FLAGS
-  DEAL_II_SHARED_LINKER_FLAGS_DEBUG
-  DEAL_II_SHARED_LINKER_FLAGS_RELEASE
+  DEAL_II_LINKER_FLAGS
+  DEAL_II_LINKER_FLAGS_DEBUG
+  DEAL_II_LINKER_FLAGS_RELEASE
   )
 
 FOREACH(_flag ${DEAL_II_USED_FLAGS})
@@ -236,41 +281,38 @@ FOREACH(_flag ${DEAL_II_USED_FLAGS})
   MARK_AS_ADVANCED(${_flag})
 ENDFOREACH()
 
+
 #
-# Finally, read in CFLAGS, CXXFLAGS and LDFLAGS from environment and
-# prepend them to the saved variables:
+# Finally, read in CXXFLAGS and LDFLAGS from environment and prepend them
+# to the saved variables:
 #
-SET(CMAKE_C_FLAGS_SAVED "$ENV{CFLAGS} ${CMAKE_C_FLAGS_SAVED}")
 SET(CMAKE_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_SAVED}")
-SET(CMAKE_SHARED_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${CMAKE_SHARED_LINKER_FLAGS_SAVED}")
-UNSET(ENV{CFLAGS})
+SET(DEAL_II_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${DEAL_II_LINKER_FLAGS_SAVED}")
 UNSET(ENV{CXXFLAGS})
 UNSET(ENV{LDFLAGS})
 
 
-###########################################################################
-#                                                                         #
-#                          Miscellanious setup:                           #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                         Miscellaneous setup:                         #
+#                                                                      #
+########################################################################
 
 GET_CMAKE_PROPERTY(_res VARIABLES)
 FOREACH(_var ${_res})
   #
-  # Rename WITH_* by DEAL_II_WITH_*
+  # Rename (ALLOW|WITH|FORCE|COMPONENT)_* by DEAL_II_(ALLOW|WITH|FORCE|COMPONENT)_*
   #
-  IF(_var MATCHES "^WITH_")
-    SET(DEAL_II_${_var} ${${_var}} CACHE BOOL "" FORCE)
-    UNSET(${_var} CACHE)
-  ENDIF()
+  FOREACH(_match ALLOW_ WITH_ FORCE_ COMPONENT_)
+    IF(_var MATCHES "^${_match}")
+      SET(DEAL_II_${_var} ${${_var}} CACHE BOOL "" FORCE)
+      UNSET(${_var} CACHE)
+    ENDIF()
+  ENDFOREACH()
 
   #
   # Same for components:
   #
-  IF(_var MATCHES "^COMPONENT_")
-    SET(DEAL_II_${_var} ${${_var}} CACHE BOOL "" FORCE)
-    UNSET(${_var} CACHE)
-  ENDIF()
   IF(_var MATCHES "^(COMPAT_FILES|DOCUMENTATION|EXAMPLES|MESH_CONVERTER|PARAMETER_GUI)")
     SET(DEAL_II_COMPONENT_${_var} ${${_var}} CACHE BOOL "" FORCE)
     UNSET(${_var} CACHE)
@@ -280,7 +322,9 @@ FOREACH(_var ${_res})
   # If DEAL_II_FORCE_AUTODETECTION is set undefine all feature toggles
   # DEAL_II_WITH_* prior to configure:
   #
-  IF(DEAL_II_FORCE_AUTODETECTION AND _var MATCHES "^DEAL_II_WITH_")
+  IF(DEAL_II_FORCE_AUTODETECTION AND _var MATCHES "^DEAL_II_WITH_"
+     # Exclude FEATURES that do not represent external libraries:
+     AND NOT _var MATCHES "^DEAL_II_WITH_64BIT_INDICES" )
     UNSET(${_var} CACHE)
   ENDIF()
 ENDFOREACH()
index db784362b44d4333fec714a7880a4fbf334df0dd..4815abf65fafa4af54fa8ac1da7d89f2afa25a42 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Setup default compiler flags: This file sets up sensible default compiler
 #   CMAKE_CXX_FLAGS
 #   DEAL_II_CXX_FLAGS_DEBUG
 #   DEAL_II_CXX_FLAGS_RELEASE
-#   CMAKE_SHARED_LINKER_FLAGS
-#   DEAL_II_SHARED_LINKER_FLAGS_DEBUG
-#   DEAL_II_SHARED_LINKER_FLAGS_RELEASE
+#   DEAL_II_LINKER_FLAGS
+#   DEAL_II_LINKER_FLAGS_DEBUG
+#   DEAL_II_LINKER_FLAGS_RELEASE
 #
 # All modifications shall be guarded with the ENABLE_IF_SUPPORTED
 # or ENABLE_IF_LINKS macro, e.g.
 #
 #   ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-fpic")
-#   ENABLE_IF_LINKS(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
+#   ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--as-needed")
 #
 # Checks for compiler features (such as C++11 support) and compiler
 # specific bugs that
 #
 
 
-###########################################################################
-#                                                                         #
-#                             Sanity checks:                              #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                            Sanity checks:                            #
+#                                                                      #
+########################################################################
 
 #
-# Check the user provided C and CXX flags:
+# Check the user provided CXX flags:
 #
-
-IF(NOT "${CMAKE_C_FLAGS_SAVED}" STREQUAL "${DEAL_II_C_FLAGS_SAVED}")
-  UNSET(DEAL_II_HAVE_USABLE_C_FLAGS CACHE)
-ENDIF()
-SET(DEAL_II_C_FLAGS_SAVED "${CMAKE_C_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)
-
-SET(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS_SAVED}")
-CHECK_C_SOURCE_COMPILES(
-  "int main(){ return 0; }"
-  DEAL_II_HAVE_USABLE_C_FLAGS)
-SET(CMAKE_REQUIRED_FLAGS "")
-
-IF(NOT DEAL_II_HAVE_USABLE_C_FLAGS)
-  UNSET(DEAL_II_HAVE_USABLE_C_FLAGS CACHE)
-  MESSAGE(FATAL_ERROR "\n"
-    "Configuration error: Cannot compile with the specified C flags: "
-    "${CMAKE_C_FLAGS_SAVED}\n"
-    )
-ENDIF()
-
-
+MESSAGE(STATUS "")
 IF(NOT "${CMAKE_CXX_FLAGS_SAVED}" STREQUAL "${DEAL_II_CXX_FLAGS_SAVED}")
   UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
 ENDIF()
@@ -104,25 +86,11 @@ IF(NOT DEAL_II_HAVE_USABLE_CXX_FLAGS)
 ENDIF()
 
 
-#
-# CMAKE_C_COMPILER and CMAKE_CXX_COMPILER have to be of the same brand.
-#
-IF(NOT ( "${CMAKE_C_COMPILER_ID}" STREQUAL "${CMAKE_CXX_COMPILER_ID}" AND
-         "${CMAKE_C_COMPILER_VERSION}" STREQUAL "${CMAKE_CXX_COMPILER_VERSION}" ) )
-    MESSAGE(FATAL_ERROR "\n"
-      "Configuration error: The specified C and CXX compiler have to be of the "
-      "same family, but cmake found:\n"
-      "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}\n"
-      "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}\n"
-      )
-ENDIF()
-
-
-###########################################################################
-#                                                                         #
-#                            Compiler setup:                              #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                           Compiler setup:                            #
+#                                                                      #
+########################################################################
 
 IF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
   #
index 0b35afc511fdb4fc28af9c075e182a5dc1a301fc..63bf98e31a7f024c6096f90b16289caacb1c8761 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # General setup for GCC and compilers sufficiently close to GCC
@@ -51,7 +53,7 @@ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-fpic")
 # Check whether the -as-needed flag is available. If so set it to link
 # the deal.II library with it.
 #
-ENABLE_IF_LINKS(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
+ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--as-needed")
 
 #
 # Setup various warnings:
@@ -79,6 +81,11 @@ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-deprecated-declarations")
 
 
 IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  #
+  # Silence Clang warnings about unused parameters:
+  #
+  SET(CMAKE_CXX_FLAGS "-Qunused-arguments ${CMAKE_CXX_FLAGS}")
+
   #
   # *Boy*, clang seems to be the very definition of "pedantic" in
   # "-pedantic" mode, so disable a bunch of harmless warnings
@@ -95,6 +102,16 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 ENDIF()
 
 
+IF(DEAL_II_STATIC_EXECUTABLE)
+  #
+  # To produce a static executable, we have to statically link libstdc++
+  # and gcc's support libraries and glibc:
+  #
+  ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static")
+  ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-pthread")
+ENDIF()
+
+
 #############################
 #                           #
 #    For Release target:    #
@@ -108,6 +125,7 @@ IF (CMAKE_BUILD_TYPE MATCHES "Release")
   ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O2")
 
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-loops")
+  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-all-loops")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-fstrict-aliasing")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-felide-constructors")
 
@@ -126,16 +144,22 @@ IF (CMAKE_BUILD_TYPE MATCHES "Debug")
   LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG")
   LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG")
 
-  ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0")
+  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-Og")
+  #
+  # If -Og is not available, fall back to -O0:
+  #
+  IF(NOT DEAL_II_HAVE_FLAG_O0)
+    ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0")
+  ENDIF()
 
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-ggdb")
-  ENABLE_IF_SUPPORTED(DEAL_II_SHARED_LINKER_FLAGS_DEBUG "-ggdb")
+  ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-ggdb")
   #
   # If -ggdb is not available, fall back to -g:
   #
   IF(NOT DEAL_II_HAVE_FLAG_ggdb)
     ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-g")
-    ENABLE_IF_SUPPORTED(DEAL_II_SHARED_LINKER_FLAGS_DEBUG "-g")
+    ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-g")
   ENDIF()
 ENDIF()
 
index 1c82c3ef5cfa0ec09b11733d1a871ac88e4dbbe7..e08b7a382a9398f0b944535cf867aaee9cfdb2df 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # General setup for the Intel C++ Compiler
@@ -42,7 +44,7 @@ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-fpic")
 # Check whether the -as-needed flag is available. If so set it to link
 # the deal.II library with it.
 #
-ENABLE_IF_LINKS(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
+ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--as-needed")
 
 #
 # Set ansi mode:
@@ -80,6 +82,18 @@ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-wd1478")
 ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-wd1572")
 
 
+IF(DEAL_II_STATIC_EXECUTABLE)
+  #
+  # To produce a static executable, we have to statically link intel's
+  # support libraries:
+  #
+  ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static")
+  ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static-intel")
+  ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static-gcc")
+  ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-pthread")
+ENDIF()
+
+
 #############################
 #                           #
 #    For Release target:    #
@@ -90,7 +104,7 @@ IF (CMAKE_BUILD_TYPE MATCHES "Release")
   #
   # General optimization flags:
   #
-  ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O2")
+  ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O1")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-ip")
 
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-loops")
index b8871633f5e8dcf0fb888bb60f27e70fc1ca02ed..6aeaceb16d6c566f7c135d76bb18af5a689bfbf4 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Timo Heister
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # General setup for the Microsoft Visual Studio C++ Compiler (Windows)
diff --git a/deal.II/cmake/setup_custom_targets.cmake b/deal.II/cmake/setup_custom_targets.cmake
deleted file mode 100644 (file)
index 2f7b56e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#####
-##
-## Copyright (C) 2012, 2013 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
-##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
-
-#
-# Setup some convenience custom targets for the build system:
-#
-
-
-###########################################################################
-#                                                                         #
-#  Custom targets for library, documentation and compat_files components: #
-#                                                                         #
-###########################################################################
-
-ADD_CUSTOM_TARGET(library)
-FOREACH(_build ${DEAL_II_BUILD_TYPES})
-  ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
-ENDFOREACH()
-
-IF(DEAL_II_COMPONENT_DOCUMENTATION)
-  ADD_CUSTOM_TARGET(documentation
-    DEPENDS doxygen
-    )
-ENDIF()
-
-IF(DEAL_II_COMPONENT_COMPAT_FILES)
-  ADD_CUSTOM_TARGET(compat_files
-    DEPENDS
-      expand_instantiations
-      make_dependencies
-      report_features
-    )
-ENDIF()
index 5b82eedd223bbf758b4a95081d6fba4d974ca775..931bf618f37b6ec91cff891645806c1c5b78b99e 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Set up deal.II specific definitions
 # *)  Can be overwritten by the command line via -D<...>
 #
 
-###########################################################################
-#                                                                         #
-#                   General information about deal.II:                    #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                  General information about deal.II:                  #
+#                                                                      #
+########################################################################
 
 SET_IF_EMPTY(DEAL_II_PACKAGE_NAME "deal.II")
 
@@ -83,11 +85,11 @@ STRING(REGEX REPLACE
 SET(DEAL_II_VERSION ${DEAL_II_VERSION_MAJOR}.${DEAL_II_VERSION_MINOR})
 
 
-###########################################################################
-#                                                                         #
-#          Information about paths, install locations and names:          #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#         Information about paths, install locations and names:        #
+#                                                                      #
+########################################################################
 
 SET(DEAL_II_PROJECT_CONFIG_NAME "${DEAL_II_PACKAGE_NAME}")
 
@@ -145,11 +147,11 @@ IF(CMAKE_BUILD_TYPE MATCHES "Release")
 ENDIF()
 
 
-###########################################################################
-#                                                                         #
-#  Cleanup and Includes that have to happen after the call to PROJECT():  #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#   Cleanup and setup that has to happen after the call to PROJECT():  #
+#                                                                      #
+########################################################################
 
 #
 # Cleanup some files used for storing the names of all object targets that
@@ -164,6 +166,14 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
     )
 ENDFOREACH()
 
+IF(DEAL_II_PREFER_STATIC_LIBS)
+  #
+  # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS
+  # is set. This will prefer static archives instead of shared libraries:
+  #
+  # TODO: Does this work on a Windows or CYGWIN target?
+  LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
+ENDIF()
 
 #
 # Cross compilation stuff:
@@ -180,5 +190,5 @@ IF(CMAKE_CROSSCOMPILING)
   SET(DEAL_II_NATIVE "DEAL_II_NATIVE-NOTFOUND" CACHE FILEPATH
     "A pointer to a native deal.Ii build directory"
     )
-  INCLUDE(${DEAL_II_NATIVE}/cmake/scripts//importExecutables.cmake)
+  INCLUDE(${DEAL_II_NATIVE}/cmake/scripts/importExecutables.cmake)
 ENDIF()
index f5c3a150a16ccfdf807fa73d8c6012f926ab1135..89dc60e9e484508b884fc1ced49164b294072175 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Include all external (cmake) macros that we will use:
@@ -18,7 +20,6 @@
 
 INCLUDE(CheckCXXCompilerFlag)
 INCLUDE(CheckCXXSourceCompiles)
-INCLUDE(CheckCSourceCompiles)
 INCLUDE(CheckCXXSourceRuns)
 INCLUDE(CheckCXXSymbolExists)
 INCLUDE(CheckIncludeFileCXX)
index d30d86744e545f83215f803a8882bfb058aae747..e2f919a30944e71da64ecfa2648e472807f629c5 100644 (file)
@@ -1,23 +1,25 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 
-###########################################################################
-#                                                                         #
-#                       Finalize the configuration:                       #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#                      Finalize the configuration:                     #
+#                                                                      #
+########################################################################
 
 #
 # Hide some cmake specific cached variables. This is annoying...
@@ -59,11 +61,11 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
 ENDFOREACH()
 
 
-###########################################################################
-#                                                                         #
-#             And write a nice configuration summary to file:             #
-#                                                                         #
-###########################################################################
+########################################################################
+#                                                                      #
+#            And write a nice configuration summary to file:           #
+#                                                                      #
+########################################################################
 
 SET(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log")
 SET(_log_summary  "${CMAKE_BINARY_DIR}/summary.log")
@@ -99,30 +101,36 @@ _both(
   )
 IF(CMAKE_CROSSCOMPILING)
   _both(
-    "#        CROSSCOMPILING!\n"
+    "#\n#        CROSSCOMPILING!\n"
     "#        DEAL_II_NATIVE:         ${DEAL_II_NATIVE}\n"
     )
 ENDIF()
 
+IF(DEAL_II_STATIC_EXECUTABLE)
+  _both(
+    "#\n#        STATIC LINKAGE!\n"
+    )
+ENDIF()
+
 _both("#\n")
 
 _detailed(
 "#  Compiler flags used for this build:
-#        CMAKE_CXX_FLAGS:                     ${CMAKE_CXX_FLAGS}
+#        CMAKE_CXX_FLAGS:              ${CMAKE_CXX_FLAGS}
 "
   )
 IF(CMAKE_BUILD_TYPE MATCHES "Release")
-  _detailed("#        DEAL_II_CXX_FLAGS_RELEASE:           ${DEAL_II_CXX_FLAGS_RELEASE}\n")
+  _detailed("#        DEAL_II_CXX_FLAGS_RELEASE:    ${DEAL_II_CXX_FLAGS_RELEASE}\n")
 ENDIF()
 IF(CMAKE_BUILD_TYPE MATCHES "Debug")
-  _detailed("#        DEAL_II_CXX_FLAGS_DEBUG:             ${DEAL_II_CXX_FLAGS_DEBUG}\n")
+  _detailed("#        DEAL_II_CXX_FLAGS_DEBUG:      ${DEAL_II_CXX_FLAGS_DEBUG}\n")
 ENDIF()
-_detailed("#        CMAKE_SHARED_LINKER_FLAGS:           ${CMAKE_SHARED_LINKER_FLAGS}\n")
+_detailed("#        DEAL_II_LINKER_FLAGS:         ${DEAL_II_LINKER_FLAGS}\n")
 IF(CMAKE_BUILD_TYPE MATCHES "Release")
-  _detailed("#        DEAL_II_SHARED_LINKER_FLAGS_RELEASE: ${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}\n")
+  _detailed("#        DEAL_II_LINKER_FLAGS_RELEASE: ${DEAL_II_LINKER_FLAGS_RELEASE}\n")
 ENDIF()
 IF(CMAKE_BUILD_TYPE MATCHES "Debug")
-  _detailed("#        DEAL_II_SHARED_LINKER_FLAGS_DEBUG:   ${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}\n")
+  _detailed("#        DEAL_II_LINKER_FLAGS_DEBUG:   ${DEAL_II_LINKER_FLAGS_DEBUG}\n")
 ENDIF()
 _detailed("#\n")
 
@@ -189,6 +197,8 @@ FOREACH(_var ${_features})
       ELSE()
         _both("#        ${_var} set up with bundled packages\n")
       ENDIF()
+    ELSE()
+     _both("#        ${_var} = ${${_var}}\n")
     ENDIF()
   ELSE()
     # FEATURE is disabled
index c6569084fbebbde9fe3fc399b9261860f5d5d368..f507b519ebb5fed97dea9d097298cb690646a22e 100644 (file)
@@ -1,22 +1,26 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 IF(DEAL_II_COMPONENT_MESH_CONVERTER)
   ADD_SUBDIRECTORY(mesh_conversion)
 ENDIF()
 
 IF(DEAL_II_COMPONENT_PARAMETER_GUI)
-  ADD_SUBDIRECTorY(parameter_gui)
+  ADD_SUBDIRECTORY(parameter_gui)
 ENDIF()
 
+#ADD_SUBDIRECTORY(test_affinity)
+
index fa77d9ed1b60370c745903dff56e5a125f6b6356..108cad18f33e4afbe4d6b6aec1e6dd903da6898d 100644 (file)
@@ -1,3 +1,19 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
 ADD_CUSTOM_COMMAND(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/lapack_templates.h
   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/
index cbad825c04a17bf1a78dfee418271743386c57ab..acfd48c119d3395c5b954281fcbb2315af9b1861 100644 (file)
@@ -1,15 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id$
-#    Version: $Name$
-#
-#    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2005 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 #---------------------------------------------------------------------------
 # This perl script translates lapack_templates.h.in to lapack_templates.h
@@ -37,19 +40,21 @@ my $double;
 
 
 print << 'EOT'
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file was automatically generated from lapack_templates.h.in
-//    See blastemplates in the deal.II contrib directory
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 by the deal authors
+// This file is part of the deal.II library.
 //
-//    This file is subject to QPL and may not be distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
 //
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
 
 #ifndef __LAPACK_TEMPLATES_H
 #define __LAPACK_TEMPLATES_H
index c19810410340b2cf552d2a6f3401e8639918c6ea..2c8dbc4c8ff5591cdec20bf7923354fda420502c 100644 (file)
@@ -1,18 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is multi licensed under
-##   - QPL 1.0,
-##   - GPL 2.0 or any later version,
-##   - LGL 2.1 or any later version.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 #PROJECT(mesh_converter)
index 929bb5e2a141dde23f60379342eb37e820fc41cb..542b9a57666d50012cfa1d79322867fc78e775bd 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by Martin Steigemann and Wolfgang Bangerth
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 #PROJECT(parameter_gui)
index 43f041a2bdbec5338174a63e57d27616303eb6d9..963da457f99e29ec76389d603de585125fd04e60 100644 (file)
@@ -1,4 +1,4 @@
-This subdirectory contains the parameterr_gui project.
+This subdirectory contains the parameter_gui project.
 
 It is copyrighted by Martin Steigemann and Wolfgang Bangerth and
 distributed under the same license as the deal.II library, i.e.
index 33e89864c1fa3cb1af0dfd73125faa3c28c9814a..29d1db3ca066c3887b9bf3875bf32ad0d8766091 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <QtGui>
 
index 2c0a97fadaed43e98821a351fdd53c4ed4e52dc5..b03c7a6f8bce03209fa359a8bb4a26dfdf489bd7 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef BROWSELINEEDIT_H
 #define BROWSELINEEDIT_H
index db753bc0b1fe937bc172913bb76091eafbbce108..ca5614c5ce5d77819ae9b0b49c913ddbfc026830 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <QtGui>
 
index f3ad3711e70a790aa111fef448cc742627254557..78969ef0c46e4c13347c69f28dfbfee43a9472d0 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef INFOMESSAGE_H
 #define INFOMESSAGE_H
index 461cd0c0aae657e22e74e268e1ecd49631afc1c4..f7d134048211c9823eea27014a88041ebaa80660 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <QApplication>
 #include <QSplashScreen>
index 4cef562f34db210ba31859cc1d25b9b18abd58df..dbd2f430f0e9d1f856685ae4b7e203a24d4a35c2 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <QtGui>
 
index 54deeae047b3049cbcd516df905aeaf4d008d43e..617c3e3422b50ce8c26ff703c0bc7181ae88ab07 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
index ec7106f526957e275dfc255f8fc8bf41783012e3..1add7f46e0d4a4a39b8f9f2258121097166d1d88 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <QtGui>
 
index a4bcb2b98f14dacd35c7fa6c6aa795db2cf7d156..155fa8edaa50baa7ad5d9b84591f66984ae4bcb4 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef PARAMETERDELEGATE_H
 #define PARAMETERDELEGATE_H
index 115da80d12383783452d4f7127e3a54cc5a23094..144dce7e6a928328a155df639a258fa8b5e08414 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <QtGui>
 
index 6d90fd4d759c29b85dd625b404c25c9769bb9a89..17d6f4a3d88e7d46b34a1ee31911c962b188fb5c 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef XMLPARAMETERREADER_H
 #define XMLPARAMETERREADER_H
index 553267d87308e3e29c26dd2da76142db05c45a52..6bd10fce988b61eb5e8a37ff07d4ac9d1d92f772 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <QtGui>
 
index 814b486b82b69118a24e3eb60e62b160ff521c67..f2597cd4ef608c942c7412e3ba1cdac5baed2da2 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef XMLPARAMETERWRITER_H
 #define XMLPARAMETERWRITER_H
diff --git a/deal.II/contrib/test_affinity/CMakeLists.txt b/deal.II/contrib/test_affinity/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8307515
--- /dev/null
@@ -0,0 +1,46 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+INCLUDE_DIRECTORIES(
+  BEFORE
+  ${CMAKE_SOURCE_DIR}/include/
+  ${CMAKE_BINARY_DIR}/include/
+  )
+
+ADD_EXECUTABLE(test_affinity
+  test_affinity.cc
+  )
+
+IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+  SET(_build "DEBUG")
+ELSE()
+  SET(_build "RELEASE")
+ENDIF()
+
+SET_TARGET_PROPERTIES(test_affinity PROPERTIES
+  LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}"
+  COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}"
+  COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${_build}}"
+  LINKER_LANGUAGE "CXX"
+  )
+
+TARGET_LINK_LIBRARIES(test_affinity ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
+
+IF(NOT CMAKE_CROSSCOMPILING)
+  ADD_CUSTOM_TARGET(run_test_affinity COMMAND test_affinity)
+ENDIF()
diff --git a/deal.II/contrib/test_affinity/test_affinity.cc b/deal.II/contrib/test_affinity/test_affinity.cc
new file mode 100644 (file)
index 0000000..81549ae
--- /dev/null
@@ -0,0 +1,29 @@
+#include <deal.II/grid/tria.h>
+#include <sched.h>
+
+int main ()
+{
+  // we need this, otherwise gcc will not link against deal.II
+  dealii::Triangulation<2> test;
+
+  cpu_set_t my_set;
+  CPU_ZERO(&my_set);
+
+  unsigned int len = sizeof(my_set);
+  int   ret = sched_getaffinity(0, len, &my_set);
+
+  if (ret!=0)
+    {
+      printf("sched_getaffinity() failed, return value: %d\n", ret);
+      return -1;
+    }
+
+  unsigned int bits_set = CPU_COUNT(&my_set);
+
+  if (bits_set==1)
+    {
+      printf("Warning: sched_getaffinity() returns that we can only use one CPU.\n");
+      return 1;
+    }
+  printf("ncpus=%d, mask=%08X\n", bits_set, *(unsigned int*)(&my_set));
+}
index 6d9e9412de74dcc47aaad0d8a98f5394cab0ce1c..eeb706492875cbfde6809c350db429d41d02564e 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 
 #
@@ -44,6 +46,11 @@ IF(DEAL_II_COMPONENT_DOCUMENTATION)
   #
   ADD_SUBDIRECTORY(doxygen)
 
+  #
+  # A custom target with the same name as the component:
+  #
+  ADD_CUSTOM_TARGET(documentation DEPENDS doxygen)
+
   #
   # Install the static elements of the html documentation:
   #
index 033fb196dc188a9581f8988bed21221336b172c6..1af8db86d0892dc3fe541b15ba3a879c23a41709 100644 (file)
@@ -59,7 +59,7 @@
        Step-29 tutorial program.
 
       <li><em>Fahad Alrashed:</em>
-       work in PETScWrappers.
+       work in PETScWrappers, various other fixes.
 
       <li><em>Michael Anderson:</em>
        Linear complexity grid reordering algorithm in 2d and 3d.
@@ -94,6 +94,9 @@
       <li><em>Chih-Che Chueh:</em>
        Step-43 tutorial program.
 
+      <li><em>Denis Davydov:</em>
+       FEValuesExtractors::Tensor and associated functionality, various other changes.
+
       <li><em>Kevin Dugan:</em>
        Fixes in VectorTools::interpolate.
 
        Eulerian mappings.
 
       <li><em>Martin Steigemann:</em>
-       Graphical user interface for the ParameterHandler class. ParaSails preconditioner.
+       Graphical user interface for the ParameterHandler
+       class. ParaSails preconditioner. Functionality in various
+       places of the library.
 
       <li><em>Franz-Theo Suttmeier:</em>
        Initial parts of the linear algebra libraries.
        Packaging and configuration issues.
 
       <li><em>Bruno Turcksin:</em>
-       Extending deal.ii for 64-bit integer support.
+       Extending deal.ii for 64-bit integer support, various other changes.
 
       <li><em>Kainan Wang:</em>
        Extending deal.ii for 64-bit integer support.
-       
+
       <li><em>Yaqi Wang:</em>
        The step-28 tutorial program;
        &nbsp;
       <li><em>Joshua White:</em>
        Arbitrary order Eulerian mappings.
 
+      <li><em>Christian W&uuml;lker:</em>
+       GridOut::write_svg.
+
       <li><em>Toby D. Young:</em>
        Interfaces to SLEPc; &nbsp; many changes in the interfaces to PETSc;
        &nbsp; MUMPS interface;
index 528eb299e88b10785a61c942802bee43255c2156..6f4ad89247bf0bfa16ed9fafe4c4a39b6f785e03 100644 (file)
 #   "C Compiler."
 #   )
 #
+# SET(CMAKE_Fortran_COMPILER "" CACHE STRING
+#   "Fortran Compiler."
+#   )
+#
 # SET(CMAKE_CXX_FLAGS "" CACHE STRING
 #   "The user supplied cache variable will be appended _at the end_ of the auto generated CMAKE_CXX_FLAGS variable"
 #   )
 #   "The user supplied cache variable will be appended _at the end_ of the auto generated DEAL_II_CXX_FLAGS_RELEASE variable"
 #   )
 #
-# SET(CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING
-#   "The user supplied cache variable will be appended _at the end_ of the auto generated CMAKE_SHARED_LINKER_FLAGS variable"
+# SET(DEAL_II_LINKER_FLAGS "" CACHE STRING
+#   "The user supplied cache variable will be appended _at the end_ of the auto generated DEAL_II_LINKER_FLAGS variable"
 #   )
 #
-# SET(DEAL_II_SHARED_LINKER_FLAGS_DEBUG "" CACHE STRING
-#   "The user supplied cache variable will be appended _at the end_ of the auto generated DEAL_II_SHARED_LINKER_FLAGS_DEBUG variable"
+# SET(DEAL_II_LINKER_FLAGS_DEBUG "" CACHE STRING
+#   "The user supplied cache variable will be appended _at the end_ of the auto generated DEAL_II_LINKER_FLAGS_DEBUG variable"
 #   )
 #
-# SET(DEAL_II_SHARED_LINKER_FLAGS_RELEASE "" CACHE STRING
-#   "The user supplied cache variable will be appended _at the end_ of the auto generated DEAL_II_SHARED_LINKER_FLAGS_RELEASE variable"
+# SET(DEAL_II_LINKER_FLAGS_RELEASE "" CACHE STRING
+#   "The user supplied cache variable will be appended _at the end_ of the auto generated DEAL_II_LINKER_FLAGS_RELEASE variable"
 #   )
 #
 # SET(BUILD_SHARED_LIBS "ON" CACHE BOOL
 #   "Build a shared library"
 #   )
 #
+# SET(DEAL_II_PREFER_STATIC_LIBS "OFF" CACHE BOOL
+#   "Prefer static libraries over dynamic libraries when searching for features and corresponding link interface"
+#   )
+#
+# OPTION(DEAL_II_STATIC_EXECUTABLE "OFF" CACHE BOOL
+#   "Provide a link interface that is suitable for static linkage of executables. Enabling this option forces BUILD_SHARED_LIBS=OFF and DEAL_II_PREFER_STATIC_LIBS=ON"
+#   )
+#
 # SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL
 #   "Set the rpath of the library to the external link pathes on installation"
 #   )
 #
+# SET(DEAL_II_WITH_64BIT_INDICES "OFF" CACHE BOOL
+#   "If set to ON, then use 64-bit data types to represent global degree of freedom indices. The default is to OFF. You only want to set this to ON if you will solve problems with more than 2^31 (approximately 2 billion) unknowns. If set to ON, you also need to ensure that both Trilinos and/or PETSc support 64-bit indices."
+#   )
+#
+#
 
 
 ###########################################################################
 # conservative. Only the current compiler and the variable MPI_CXX_COMPILER
 # is used to find MPI. (MPI_CXX_COMPILER takes precedence.)
 #
+# (MPI_C_COMPILER and MPI_Fortran_COMPILER are considered, too)
+#
+#
 # DEAL_II_WITH_MPI=ON will trigger a more sophisticated search for MPI.
 #
 # The best way to force a specific MPI implementation to be used is to set
-# CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the appropriate MPI wrapper
-# (See above).
+# CMAKE_CXX_COMPILER, CMAKE_C_COMPILER and CMAKE_Fortran_COMPILER to the
+# appropriate MPI wrapper (See above).
 #
 # Alternatively, specify the mpi wrapper that will be queried for the mpi
 # link interface:
 #
 # SET(MPI_CXX_COMPILER "mpicxx" CACHE STRING "")
 #
+# SET(MPI_C_COMPILER "mpicc" CACHE STRING "")
+# SET(MPI_Fortran_COMPILER "mpif90" CACHE STRING "")
+#
 #
 # Manual setup:
 #
 # SET(MPI_CXX_COMPILE_FLAGS "..." CACHE STRING "")
 # SET(MPI_CXX_LINK_FLAGS "..." CACHE STRING "")
 #
+# Additionally:
+#
+# SET(MPI_C_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
+# SET(MPI_Fortran_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
+#
+#
 
 
 #
index a21b8f0b797cc0085add9df11260bead5acefdca..cacc2e4bbe0126b59a68d3154603302eb8c9a212 100644 (file)
@@ -43,7 +43,6 @@
            <li><a href="#config.h.in"><code>./include/deal.II/base/config.h.in</code></a>
             <li><a href="#source"><code>./source/CMakeLists.txt</code></a>
             <li><a href="#projectconfig"><code>./cmake/config/CMakeLists.txt</code></a>
-            <li>TODO
           </ul>
        </td>
       </tr>
       PROPERTIES
       VERSION ${VERSION}
       SOVERSION ${VERSION}
-      LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_${build}}"
+      LINK_FLAGS "${DEAL_II_LINKER_FLAGS_${build}}"
       COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${build}}"
       COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${build}}"
       )
     #   CMAKE_CXX_FLAGS
     #   DEAL_II_CXX_FLAGS_DEBUG
     #   DEAL_II_CXX_FLAGS_RELEASE
-    #   CMAKE_SHARED_LINKER_FLAGS
-    #   DEAL_II_SHARED_LINKER_FLAGS_DEBUG
-    #   DEAL_II_SHARED_LINKER_FLAGS_RELEASE
+    #   DEAL_II_LINKER_FLAGS
+    #   DEAL_II_LINKER_FLAGS_DEBUG
+    #   DEAL_II_LINKER_FLAGS_RELEASE
     #
     # All modifications shall be guarded with the ENABLE_IF_SUPPORTED
     # or ENABLE_IF_LINKS macro, e.g.
     #
     #   ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-fpic")
-    #   ENABLE_IF_LINKS(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
+    #   ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--as-needed")
     #
     # Compiler flags for platform dependent optimization (such as
     # -march=native) must always be guarded with
        <li>
          For internal use, for setting necessary linker flags for the deal.II library:
          <ul>
-            <li> <code>CMAKE_SHARED_LINKER_FLAGS</code>
-            <li> <code>DEAL_II_SHARED_LINKER_FLAGS_DEBUG</code>
-            <li> <code>DEAL_II_SHARED_LINKER_FLAGS_RELEASE</code>
+            <li> <code>DEAL_II_LINKER_FLAGS</code>
+            <li> <code>DEAL_II_LINKER_FLAGS_DEBUG</code>
+            <li> <code>DEAL_II_LINKER_FLAGS_RELEASE</code>
          </ul>
 
        <li>
       two macros:
       <pre>
 
+    #
+    # Glob for all header files associated with the object target:
+    # As this list is only for cosmetic reasons, so that associated header
+    # files show up in IDEs, we don't manage an explicit list (with the
+    # tradeoff to have to run "make rebuild_cache" when a new header file
+    # emerges...)
+    #
+    FILE(GLOB _header
+      ${CMAKE_SOURCE_DIR}/include/deal.II/dofs/*.h
+      )
+
     #
     # A list of source files forming the object target:
     #
-    SET(src
+    SET(_src
       ...
       dof_tools.cc
       )
     #
     # A list of instantiations that must be expanded:
     #
-    SET(inst_in_files
+    SET(_inst
       ...
       dof_tools.inst.in
       )
     #   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_(debug/release)
     # so that it is available in global scope.
     #
-    DEAL_II_ADD_LIBRARY(obj_dofs OBJECT ${src})
+    # Header files and instatiation files (${_header}, ${_inst}) are added
+    # for cosmetic reasons, so that they show up in IDEs.
+    #
+    DEAL_II_ADD_LIBRARY(obj_dofs OBJECT ${_src} ${_header} ${_inst})
 
     #
     # This macro will set up an obj_dofs.inst target for expanding all
index e9e6643ea9d5e35c919ae985d1806511f258ac7a..05fe95d6e9b9c9627e625eb85589c9af404813dc 100644 (file)
     DEAL_II_WITH_TRILINOS
     DEAL_II_WITH_UMFPACK
     DEAL_II_WITH_ZLIB
+    DEAL_II_WITH_64BIT_INDICES
       </pre>
       They all have standard meaning with the exception of
       two:
           <code>BUILD_SHARED_LIBS</code>: If set (default),
           <acronym>deal.II</acronym> will be linked as a shared library
 
+        <li>
+        <code>DEAL_II_PREFER_STATIC_LIBS</code> (defaults to off): If set
+        to true, static archives will be preferred over dynamic libraries when
+        searching for features and corresponding link interface.
+
+       <li>
+          <code>DEAL_II_STATIC_EXECUTABLE</code> (defaults to off):
+          If set to true, <acronym>deal.II</acronym> will be configured in
+          a way to provide a link interface that is suitable for static
+          linkage of executables. Enabling this option forces
+          <code>BUILD_SHARED_LIBS=OFF</code> and
+          <code>DEAL_II_PERFER_STATIC_LIBS</code>.
+
        <li>
          <code>CMAKE_INSTALL_RPATH_USE_LINK_PATH</code>: If set
          (default), the <acronym>deal.II</acronym> library will be
 
     </p>
       Compilers can be switched either by command line or by setting
-      <code>CMAKE_(C|CXX)_COMPILER</code>:
+      <code>CMAKE_(C|CXX|Fortran)_COMPILER</code>:
       <pre>
 
      CC=mpicc CXX=mpicxx cmake &lt;...&gt;
 
-     cmake -DCMAKE_C_COMPILER="mpicc" -DCMAKE_CXX_COMPILER="mpicxx" &lt;...&gt;
+     cmake -DCMAKE_C_COMPILER="mpicc" -DCMAKE_CXX_COMPILER="mpicxx" -DCMAKE_Fortran_COMPILER="mpif90" &lt;...&gt;
       </pre>
       Please note that
       <ul>
           The compiler <i>must</i> be specified at the very first
           invokation of <code>cmake</code>.
         <li>
-          The specified C and CXX compilers must be the same compiler
-          brand and the same compiler version.
+          A working CXX compiler is needed. It is optional to provide a C
+          or Fortran compiler.
       </ul>
     </p>
 
     <p>
-      deal.II will configure sensible default <code>CFLAGS</code> and
-      <code>CXXFLAGS</code> depending on platform, compiler and build
-      target. There are two options to override this behaviour:
+      deal.II will configure sensible default <code>CXXFLAGS</code>
+      depending on platform, compiler and build target. There are two
+      options to override this behaviour:
 
       <ol>
        <li>
index e883492169dcc6cc32b0b7b27c781326e4c068ca..de8bad7977d84c2fa4b7849b65651eb49bc919ea 100644 (file)
 </head>
 
 <frameset rows="70,*">
-  <frame name="title" src="title.html">
-  <frameset cols="120,*">
-    <frame name="navbar" src="navbar.html">
-    <frame name="body" src="toc.html">
+  <frame name="title" src="title.html" frameborder="1">
+  <frameset cols="150,*">
+    <frame name="navbar" src="navbar.html" frameborder="0">
+    <frame name="body" src="toc.html" frameborder="0">
   </frameset>
   <noframes>
     <h1>deal.II Development Information</h1>
index 82aa59cfce24d07c1bc7065b050a6dd5c6e70cbe..fcfa429f456bb0b668b87024085dac092412764c 100644 (file)
 <body class="navbar">
 
   <p>
-    <a href="../index.html" target="_top">Homepage</a><br />
-    <a href="toc.html" target="body">Overview</a>
+    <a href="http://www.dealii.org"target="_top">http://www.dealii.org</a><br />
+    <a href="../index.html" target="_top">Home</a><br />
+  </p>
+
+  <hr>
+
+  <p>
+    <a href="index.html" target="_top">Development</a><br />
   </p>
 
   <hr>
   <b><small>Writing code</small></b>
 
   <p>
-    <a href="svn.html" target="body">SVN Archive</a>
-    <a href="makefiles.html" target="body">Makefiles</a><br />
-    <a href="writing-documentation.html"
-       target="body">Documentation</a><br />
+    <a href="svn.html" target="body">SVN Archive</a><br />
+    <a href="cmake.html" target="body">CMake documentation</a><br />
+    <a href="cmakelists.html" target="body">CMake in user projects</a><br />
+    <a href="cmake-internals.html" target="body">CMake internals</a><br />
+    <a href="writing-documentation.html" target="body">Writing documentation</a><br />
     <a href="porting.html" target="body">Porting</a><br />
-    <a href="../doxygen/deal.II/CodingConventions.html" target="body">Coding conventions</a><br />
     <a href="doxygen.html" target="body">Linking manuals</a><br />
+    <a href="../doxygen/deal.II/CodingConventions.html" target="body">Coding conventions</a><br />
   </p>
 
   <hr>
@@ -39,6 +46,8 @@
     <a href="http://www.dealii.org/websvn/log.php?repname=deal.II+Repository&path=%2F&isdir=1&" target="_top">Recent changes</a><br />
     <a href="http://www.dealii.org/mail.html" target="body">Mailing lists</a><br />
     <a href="http://www.dealii.org/testsuite.html" target="body">Test suite</a><br />
+    <a href="http://www.dealii.org/cgi-bin/regression_quick.pl" target="body">Regression tests</a><br />
+    <a href="http://www.dealii.org//cgi-bin/build.pl" target="body">Build tests</a><br />
     <a href="https://code.google.com/p/dealii/w/list" target="_top">Wiki</a><br />
     <a href="https://code.google.com/p/dealii/issues/list" target="_top">Bug tracker</a><br />
   </p>
index 27b34d04ab930bf758ea2e8019eecf25951fa724..e101dcf7ed9c21b80a24fca8fad7fb9cb7511aa0 100644 (file)
     For the testcase, we usually start from a template like this:
     <pre>
 
-//----------------------------  my_new_test.cc  ---------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005 by the deal.II authors
+// Copyright (C) 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  my_new_test.cc  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 
 // a short (a few lines) description of what the program does
index fcbda0eb42894feeacd3026f29e15e0c3f832e0a..beeb1046b6288e91539afbcc5994aba1cb790bb2 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # A glob. I'm sorry
index d09d6eb7b43c1056d145cea8f931af253b64d086..e848e926eae9b756580d9b3e2adfa8df56f89685 100644 (file)
@@ -12,9 +12,9 @@
     <script type="text/javascript" src="$relpath$jquery.js"></script>
     <script type="text/javascript" src="$relpath$dynsections.js"></script>
 
-    <link rel="SHORTCUT ICON" href="http://www.dealii.org/deal.ico">
+    <link rel="SHORTCUT ICON" href="http://www.dealii.org/favicon.ico">
     <meta name="author" content="the deal.II authors <authors@dealii.org>">
-    <meta name="copyright" content="Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors">
+    <meta name="copyright" content="Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors">
     <meta name="deal.II-version" content="@DEAL_II_PACKAGE_VERSION@">
   </head>
 
index 7ffad2ac01b171fa0b8690d7172ce5ff9127208a..adfe76abf79f01a183b407098cde960d82919146 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup boundary Boundary description for triangulations
index 1382e473901f9a735405a34046eeb8db418a71a7..f6fff10ef59e667e92badbcceae94b8a6fb84222 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 2007, 2008, 2011 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @page CodingConventions Coding conventions used throughout deal.II
index e4c4e6dbda06ecce2329f8dafcf8e3c322c458af..999a97659e60e4744cdfc3ca5b4d8facc87857f0 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup constraints Constraints on degrees of freedom
index 93830f4e6abb3c67337c7d1fc2749d3417b234f6..d5a76f785063ec4a09ccd54e54d52646ab8fad75 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup distributed Parallel computing with multiple processors using distributed memory
index 9a324be08178a66cb3f5b70c18f81a53ecd3afed..6448f2b9302c1a73251e42b44fd2d7e62f9ff150 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2010, 2011 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup dofs Degrees of Freedom
index c39d08dd41c2c9ded49b180c3cd1a82f035b5e1e..03594750c2195f96e50d7cda86b1799395ca1e38 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup Exceptions Exceptions and assertions
  *      do_something ();
  *    }
  *    catch (exception &e) {
- *      std::cerr << "Exception occured:" << std::endl
+ *      std::cerr << "Exception occurred:" << std::endl
  *           << e.what ()
  *           << std::endl;
  *      do_something_to_reciver ();
index 499e2476aa0df275bdfb1de78e606c80fbbefd3d..eb21a6d7b79ad28710f8150e67f2a2b53f4a94b2 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2007, 2008, 2011 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup feall Finite elements
index cb84efad75c5890d5919e5e5d5fc55cdd963a0f0..620fb2526089e02cfee069caa3968500f748dead 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup functions Functions
index 47afee7243fc2406c1ac22cbcbd63ec385879717..d67db9b198a59dbbfc0f9658e624ae3d0985599a 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
 @defgroup geodynamics The geodynamics demonstration suite
index aa90d31cb102096c87aac0d86c95137847a15ae6..e52cb5a4443aad666b7b1d84a55e36978a131b0b 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup geomprimitives Geometric and other primitives
diff --git a/deal.II/doc/doxygen/headers/global_dof_index.h b/deal.II/doc/doxygen/headers/global_dof_index.h
new file mode 100644 (file)
index 0000000..a4b5542
--- /dev/null
@@ -0,0 +1,70 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+/**
+ * @page GlobalDoFIndex When to use types::global_dof_index instead of unsigned int
+ *
+ * When the 64-bits version of deal.II is used, it becomes necessary to
+ * declare as types::global_dof_index (unsigned long long int) instead of
+ * unsigned int. Here, we want to clarify when types::global_dof_index must be
+ * used.
+ *
+ * <dl>
+ *
+ * <dt class="glossary">@anchor GlobalDoFIndexBlockIndices
+ * <b>BlockIndices</b></dt>
+ * <dd>
+ * The number of blocks is an unsigned int because the number is expected to
+ * be low, i.e less than four billions. However, the size of the block is a
+ * types::global_dof_index because each block can be arbitrary large.
+ * </dd>
+ *
+ * <dt class="glossary">@anchor GlobalDoFIndexCell <b>Cell</b></dt>
+ * <dd>
+ * The ID of cell is not unique. Cells with different levels of refinement
+ * and/or on different processors can have the same ID. Thus, all the data
+ * associated to cells can be unsigned int.
+ * </dd>
+ *
+ * <dt class="glossary">@anchor GlobalDoFIndexDoFHandler
+ * <b>DoFHandler</b></dt>
+ * <dd>
+ * The ID of each degree of freedom is unique. Therefore, degrees of freedom
+ * are types::global_dof_index.
+ * </dd>
+ *
+ * <dt class="glossary">@anchor GlobalDoFIndexFullMatrix
+ * <b>FullMatrix</b></dt>
+ * <dd>
+ * The numbers of row and column are types::global_dof_index even if it is not
+ * expected that someone will create a FullMatrix with so many entries.
+ * However, ConstraintMatrix is templated on the matrix type and thus, the
+ * size of a FullMatrix has to be of the same type than the size of
+ * SparseMatrix.
+ * </dd>
+ *
+ * <dt class="glossary">@anchor GlobalDoFIndexSparseMatrix
+ * <b>SparseMatrix</b></dt>
+ * <dd>
+ * The size of SparseMatrix can be arbitrary large therefore,
+ * types::global_do_index is used. However, even for a large complex problem we
+ * can solve now, there is no reason for the number of non-zero entries in a 
+ * sparse matrix to go over four billions. Thus, we still use unsigned int
+ * for, e.g., row_lengths in the object.
+ *
+ * 
+ */
index 688339494ab19ee837362fb913f8cc5a87f0ceaf..a84c1a6612c4f582d5f39f3b7299e9627a4222db 100644 (file)
@@ -1,16 +1,19 @@
-
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// This file is part of the deal.II library.
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
 //
-//-------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+
 
 /**
  * @page DEALGlossary Glossary
  * <dl>
  *
  * <dt class="glossary">@anchor GlossActive <b>Active cells</b></dt>
- * <dd>Mesh cells not refined any further in the hierarchy.</dd>
+ * <dd>A cell, face or edge is defined as <i>active</i> if it is not
+ * refined any further, i.e., if it does not have children. Unless
+ * working with a multigrid algorithm, active cells are the only
+ * ones carrying degrees of freedom.</dd>
  *
  *
  *
index cc800ac710a55867db0311644a8186988bc55982..61395d223c80609e7807e929b08f7ceff3cd3930 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup grid Grid classes
index 487e4dee4d49382dd8a7514ce44da2185465c075..2cd5ac1e52f423dcc8c9cca2dcdc3ea62edbcefd 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2007, 2011 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup hp hp finite element support
index f53e2ae151d6eb8877d9bd63c6e947ee27209242..91e95805d0469a08fcf5c6811df533646bb55465 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @page Instantiations Template instantiations
index 0a649fc5c3ae43cc23da736b4f93a02d047549c6..9f598c9684c66cf7792d8d127b5e5a77bebd7378 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup Integrators Integrators
index 4fed985a4e969c2b72ec7a6ec9a37e90076ebe2f..11382be961173e8a56a4209375f2d9f0bb911485 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2010 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup IO Input/Output
index 52f44bea81d9034311dc007d57d13379d3b0ee56..144ffeaa0f0789936c719f594e4a88aa596fe904 100644 (file)
@@ -1,3 +1,19 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 /**
  @defgroup Iterators Iterators on mesh-like containers
  @{
index 8f200ba5dbcaa6be47fe835e4a63b831d54bb9c1..e697d1eb7a234580357c0cefeb90a126d9ad09e0 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
index 965c5ae6185d3edcdc3d1a5a4a85367341c46c5d..8f4995fa9a26cf560dedc542c9bbdbf16e53c5b0 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @mainpage
index 1ec2f373fe95072354286ef2294312ce0f458b69..979bcaa9b02820b6f7a36956a085e886d9b71552 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
index 82d4748a2e4461944c630b839f34ea940cdbf4c8..413040165f5151ab7625b073683fc30e0dc1b38e 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup memory Memory handling
index c23e4d46fdcefaffc8508d37d005cc7fff451ff9..937675e30f3ecb4979df8a6be9e1f455ecbe99a2 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id: lac.h 12034 2006-01-15 21:16:14Z wolf $
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
index ab162e9d504aec0e53f1418b375db00441cf03d7..bebf6c7987858b9e77af825fbec550e0d9490192 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2009, 2010 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup mg Multilevel support
index e4e9d9922868ebd4e13aedde010cb796807890f2..ca73ffd0a5915279d5d6315ad3be0f93bbedc0e7 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup threads Parallel computing with multiple processors accessing shared memory
index 4edf5ab273bb7fb5062a0afc235622f4f5a7f16c..df80dbf7584f48245533ab0264d7e9f795a7097e 100644 (file)
@@ -1,3 +1,19 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 /**
  * This is the namespace in which everything in deal.II is. To avoid prefixing
  * every class and function call with the namespace name, the @ref Tutorial
index 34ac3d345a4d39396a20a784a630d70e2641b96e..86a018e324abaa557c91476db860b455b81cdbae 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup numerics Numerical algorithms
index 83334380ccdafebbbacdadd1929f1e06e0d7bf60..b169b7004396018add64584ddc7b915c4ca6a8dd 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup Parallel Parallel computing
index 6b1aa905323609a769cbf672cb98877011eaa84e..e47048c9a134a536631b5f3a0e34d0deba478fd8 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2010 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
index e56bf7a01502807e1ab3d3e8006627fb832fb5ec..f98b898bfeb7651bc547e8b4fd5e5dc19f0e608c 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup Polynomials Polynomials and polynomial spaces
index 0c7c7ccae0fa8c229070cc5c49c36c192cd900a9..a40f6ccde614c8641b4360cf85cb2c75009adbf3 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2007, 2009, 2010 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
index 5ef0b996ebb167222e4d9c557c26aa35254e3dfd..c40ac9b5f9a8efb778b207721db1c31e40e64e55 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup Quadrature Quadrature formulas
index b142d896f8bc6be0b96dc61ddd35391631511bb8..c9c227e3361c8b8965d2ce37d91e273d812ee0c3 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id: slepc.h 22855 2011-01-01 15:01:47Z young $
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
index 10b8fa076186695c5bb8f8a105f8606514da7b84..5057d7dae91013d3b1a05516f7a46c22c3654d36 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2007 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 /**
  * @defgroup Solvers Linear solver classes
  *
index 94333162bfb524e6aaff2dfc7663aa63f67ac837..5cc44b5fc5bbb3e20d95566bfd7422d5b57b3202 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * A namespace that contains a selection of classes and functions that will be part of the
index 8c4077afe0d636fbe0de482317a025b5f3cc57d1..7f1f5724bfc0d5ce94ce8ebe13ce21f8cac54ff1 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2010 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
index e967a2c12a15b32e51f6f62323d3fa2e31bb971e..0cb94932d63a31f202e4ceafe0ced764f3735838 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @page Tutorial Tutorial programs
index ed547b39cc5134f6fe77ef08da2e3ab1896b12ba..c1c6893cb2167b66ba0868d40891d64d85bb5442 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
 
index 7ecc871bb3807d1b2e1d1a60a1f083d81ec0f73f..3d0c87c15cfcef3e94423a3758aeedc44c6757f8 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup utilities Utility functions and classes
index 0c65f902b1d3697038762409f4ffe6ee775fea0e..3ab9499eed80c5e7b7d82443bb4430f04a9a65bb 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2008 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
index cf6c5ccdb5e7fba54381736053b76cd3090470e1..9c24a2f7c5a898b30df0b5a4b55f69737f4eb8b2 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 /**
   -
   (q, \mathrm{div}\ \mathbf u)
   =
-  (q,f) + (\mathbf n\cdot\mathbf v, p)_{\partial\Omega}.
+  (q,f) - (\mathbf n\cdot\mathbf v, p)_{\partial\Omega}.
 @f}
  *
  * It is this form that we will later use in assembling the discrete weak form
                                     fe_values[velocities].divergence (j, q)) *
                                     fe_values.JxW(q);
 
-            local_rhs(i) += fe_values[pressure].value (i, q)
-                              rhs_values[q] *
-                              fe_values.JxW(q);
+            local_rhs(i) += fe_values[pressure].value (i, q)
+                            rhs_values[q] *
+                            fe_values.JxW(q);
           }
  * @endcode
  *
  *        extractor. For example, <code>fe_values[pressure].gradient(i,q)</code>
  *        would represent the gradient of the scalar pressure component, which
  *        is of type <code>Tensor@<1,dim@></code>, whereas the gradient of the
- *        velocities components, <code>fe_values[velocities].value(i,q)</code>
+ *        velocities components, <code>fe_values[velocities].gradient(i,q)</code>
  *        is a <code>Tensor@<2,dim@></code>, i.e. a matrix $G_{ij}$ that consits
  *        of entries $G_{ij}=\frac{\partial\phi_i}{\partial x_j}$. Finally,
  *        both scalar and vector views can be asked for the second derivatives
index 24ed56085a65540d9b12fac831302f0b033f7dc2..a82529b300a0d8476df3b56ea936ce7e5e630ed3 100644 (file)
@@ -1,15 +1,19 @@
-//-------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 /**
  * @defgroup Vectors Vector classes
index ccb331317306f9e4b5c6ca8716d10171f10b19c9..54a65895264d03465d489351d8fed2dfc61d05e6 100644 (file)
@@ -1,3 +1,18 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 ADD_CUSTOM_COMMAND(
   OUTPUT
     ${CMAKE_CURRENT_BINARY_DIR}/structure.png
index 75fabccd1954bf7c36b3eb51a80436e00c3f92fb..0c1dcf57c9577baae24d26495136bf217596aa12 100644 (file)
@@ -1,15 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id: create_anchors 14782 2007-06-15 16:37:12Z kanschat $
-#    Version: $Name$
-#
-#    Copyright (C) 2007, 2012 by the deal.II authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2007 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 
 # If we find a heading in a .dox file, create an HTML anchor for it.
index 53839ab09a6f601371f960102b390436e4eb9b9e..0911ca1aee4b6760eca105debfd7148ec63d9684 100644 (file)
@@ -1,15 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id: intro2toc 14782 2007-06-15 16:37:12Z kanschat $
-#    Version: $Name$
-#
-#    Copyright (C) 2006, 2007, 2008 by the deal.II authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2006 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 print "    <ul>\n";
 
index 9c2569660e1a9069ccf08dc81f9e2ecf747cdb94..d4a39193a82c30c93bb88d9152bbfe7457df4e0d 100644 (file)
@@ -1,15 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id$
-#    Version: $Name$
-#
-#    Copyright (C) 2013 by the deal.II authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 if ($#ARGV != 1) {
   print "\nUsage: make_step.pl step cmake_source_dir\n";
index 662bc8c749352030fa3e524d599d512a39b022ef..67565a55130b14b4f6cfcadc1edfd877df5062cb 100644 (file)
@@ -1,16 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id$
-#    Version: $Name$
-#
-#    Copyright (C) 2006, 2007, 2010, 2013 by the deal.II authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
-
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2006 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 
 print " * <a name=\"CommProg\"></a>\n";
index 73782b71a1fe5653f601809e79fd459ba3518981..2d5529ed28e764438b7354739f8c30c7154c5d4c 100644 (file)
@@ -1,15 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id$
-#    Version: $Name$
-#
-#    Copyright (C) 2006, 2007 by the deal.II authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2006 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 
 print "\n";
index f5894dc8ffacf0c02eb8f45dd4979dbfb39ee339..9d3083c5f5a43c8eb86057b3079ccb5d4b1cf3b0 100644 (file)
@@ -1,15 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id$
-#    Version: $Name$
-#
-#    Copyright (C) 2006, 2007, 2010 by the deal.II authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2006 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 print "<a name=\"CommProg\"></a>\n";
 print "<h1> The commented program</h1>\n";
index d18bf8ca864e28722c9acdc6b7887af1a30365c2..7e2e0f0fc570430be7029874d315f365e487f531 100644 (file)
@@ -1,15 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id$
-#    Version: $Name$
-#
-#    Copyright (C) 2010, 2011 by the deal.II authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2010 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 # Remove all comments from the source file
 
index 8518966815e3b6879c7ceef81db5e2f62427e47d..5a5927999beb63d9b75186a06ed5afb4459def5d 100644 (file)
@@ -1,15 +1,18 @@
-#---------------------------------------------------------------------------
-#    $Id$
-#    Version: $Name$
-#
-#    Copyright (C) 2006, 2007 by the deal.II authors
-#
-#    This file is subject to QPL and may not be  distributed
-#    without copyright and license information. Please refer
-#    to the file deal.II/doc/license.html for the  text  and
-#    further information on this license.
-#
-#---------------------------------------------------------------------------
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2006 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
 
 print "    <ul>\n";
 
index 7a0050800caa5b8857ca7ac36d3778a076f9c3df..f0c45fc022d72c9bf8e69c0a9cd3d832ad556832 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 
 #
index ad74a1e469f81f17a19a3298a259ab7b035d9a2d..6f26ade6677ca8f383ffebb6df90b4ee1a15babe 100644 (file)
@@ -3,8 +3,8 @@
 
 <html>
   <head>
-    <title>The deal.II Readme on interfacing to PETSc and Trilinos</title>
-    <link href="screen.css" rel="StyleSheet">
+    <title>The deal.II Readme on interfacing to MUMPS</title>
+    <link href="../screen.css" rel="StyleSheet">
     <meta name="author" content="the deal.II authors <authors @ dealii.org>">
     <meta name="copyright" content="Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors">
     <meta name="date" content="$Date: 2010-05-05 (Thu, 05 May 2010) $">
     <p>
       You can override the autodetection by manually specifying
       <pre>
+
     -DDEAL_II_WITH_MUMPS=OFF|ON
       </pre>.
     </p>
index 6f24b8d7d86697c6ecac8d8e89b5d687d13b7a85..735d088210ded1c3d6b5a528c55a603304581afd 100644 (file)
@@ -2,8 +2,8 @@
    "http://www.w3.org/TR/REC-html40/frameset.dtd">
 <html>
   <head>
-    <link href="../screen.css" rel="StyleSheet" media="screen">
-    <title>The deal.II Readme</title>
+    <title>The deal.II Readme on interfacing to p4est</title>
+    <link href="../screen.css" rel="StyleSheet">
     <meta name="author" content="the deal.II authors <authors@dealii.org>">
     <meta name="keywords" content="deal.II">
   </head>
 
     <p>
       You need to install p4est before deal.II. To do so, you can
-      download it
-      from <a href="http://www.p4est.org/" target="_top">here</a>, copy it to
-      a fresh directory into which you should also copy
-      the <a href="p4est-setup.sh">p4est-setup.sh script</a> (the one
-      from this link, not one you may have gotten from the p4est webpage). Then
-      call the script as follows:
-      <code>
-       <pre>
-         ./p4est-setup.sh p4est-x-y-z.tar.gz /path/to/installation
-       </pre>
-      </code>
+      download it from <a href="http://www.p4est.org/" target="_top">here</a>.
+      You can either choose to manually compile and install p4est (as
+      explained in documentation of p4est), or alternatively use
+      <a href="p4est-setup.sh">a script</a> that will automatically compile
+      and install a debug and optimized version of p4est.
+
+    </p>
+
+    <p>
+      If you want to use the script, copy the tarball to a fresh directory
+      together with the <a href="p4est-setup.sh">p4est-setup.sh script</a>
+      (the one from this link, not one you may have gotten from the p4est
+      webpage). Then call the script as follows:
+      <pre>
+
+    ./p4est-setup.sh p4est-x-y-z.tar.gz /path/to/installation
+      </pre>
       where <code>p4est-x-y-z.tar.gz</code> is the name of the p4est
       distribution file, and <code>/path/to/installation</code> is a
       directory into which you want to install p4est.
     </p>
 
     <p>
-      After this, you need to configure <acronym>deal.II</acronym>
-      using a line like
-      <code>
-       <pre>
+      In both cases, you can configure <acronym>deal.II</acronym> using a
+      line like
+      <pre>
 
     cmake -DP4EST_DIR=/path/to/installation -DDEAL_II_WITH_P4EST=ON -DDEAL_II_WITH_MPI=ON <...>
-       </pre>
-      </code>
-      Obviously, you can also add additional flags to
-      <code>cmake</code> as described in the general <a
-      href="../readme.html">ReadMe file</a>.
+      </pre>
+      if the p4est library isn't picked up automatically. Obviously, you
+      can also add additional flags to <code>cmake</code> as described in
+      the general <a href="../readme.html">ReadMe file</a>.
     </p>
 
     <hr>
index 8fb7e4474abe753dc29f487b20d8bc35e979d78f..3fbc0b78f8df3e3b90ab9a3426744f3e6e7ba7fa 100644 (file)
@@ -38,9 +38,9 @@
 
     <h4>Installing <acronym>deal.II</acronym> with PETSc</h4>
 
-    <p>
-      For a general overview of building <acronym>deal.II</acronym> with
-      PETSc, first see the <a href="../readme.html">ReadMe file</a>.
+    <p style="color: red"><b>Note:</b> The latest version of PETSc tested is
+       3.4.2. Major releases after this version may cause problems, so we
+       recommend sticking to this version if at all possible.
     </p>
 
     <p>
       during configuration.
     </p>
 
-    <p>
-      <b>Note:</b> PETSc appears not to co-operate
-      well when using threads and some programs crash when deal.II is
-      compiled in its usual mode supporting multithreading. If you see
-      this sort of behavior, disable
-      multithreading upon configuration of <acronym>deal.II</acronym>
-      using the <code>-DDEAL_II_WITH_THREADS=OFF</code> switch for
-      <code>cmake</code>.
-    </p>
-
     <p><b>Note:</b> <acronym>deal.II</acronym> can be installed with both
       PETSc and Trilinos and they do not usually get in their
       respective ways. There are, however, occasions where this is not true
         cd petsc-x-y-z
        export PETSC_DIR=`pwd`
        export PETSC_ARCH=x86_64       # or any other identifying text for your machine
-       export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib:$LD_LIBRARY_PATH
        ./config/configure.py --with-shared=1 --with-x=0 --with-mpi=1 --download-hypre=1
        make
       </pre>
 
     <p>
       This automatically builds PETSc with both MPI and the algebraic
-      multigrid preconditioner package Hypre (which we use in step-40). 
+      multigrid preconditioner package Hypre (which we use in step-40).
       <br>
       Now let PETSc check his own sanity:
       <pre>
index 3009d4bdb7f09570485ad4e04d78e60fbd5d22bc..5fd4ff0563f911190f88713cdaa07b52e3c0e6dc 100644 (file)
 
        export SLEPC_DIR=/path/to/slepc-x-y-z
       </pre>
+      The <code>cmake</code> installation should then be able to pick
+      up where you installed SLEPc and include it automatically in the
+      deal.II build without any further need for instructions. You
+      will see at the bottom of the <code>cmake</code> output if that
+      is what actually happened.
     </p>
+
+
+
     <hr>
 
     <!-- TODO: <h4>Using the ARPACK solvers with SLEPc</4> -->
index f5ca147c63e0af73418fbad9923389e4311c746f..4efc8291a77e222dabb1c4bc6a1bc24ae4f907c4 100644 (file)
     <h5>Installing Trilinos</h5>
 
     <p style="color: red">
-      Note: Trilinos versions 10.8.0, 10.8.1, 10.10.2, 10.12.1 are not
-      compatible with deal.II. They contain subtle bugs related to (parallel)
-      matrices and vectors.  Versions tested to work are 10.8.5,
-      10.12.2, and 11.0.3. We recommend only using one of the tested versions
-      for the time being.
+      Note: Trilinos versions older than 10.12.2 can cause problems and are
+      therefore not recommended. The newest version tested to work is 11.4.1.
+      Major releases after this version may cause problems, so we recommend
+      sticking to this version if at all possible.
     </p>
 
     <p>
       reasonable configuration:
        <pre>
 
-    cd trilinos-10.12.2
+    cd trilinos-11.4.1
     mkdir build
     cd build
 
-    cmake -D Trilinos_ENABLE_OPTIONAL_PACKAGES:BOOL=ON \
-      -D Trilinos_ENABLE_Sacado:BOOL=ON \
-      -D Trilinos_ENABLE_Stratimikos:BOOL=ON \
-      -D CMAKE_BUILD_TYPE:STRING=RELEASE \
-      -D CMAKE_CXX_FLAGS:STRING="-g -O3" \
-      -D CMAKE_C_FLAGS:STRING="-g -O3" \
-      -D CMAKE_FORTRAN_FLAGS:STRING="-g -O5" \
-      -D Trilinos_EXTRA_LINK_FLAGS:STRING="-lgfortran" \
-      -D CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE \
-      -D Trilinos_VERBOSE_CONFIGURE:BOOL=FALSE \
-      -D TPL_ENABLE_MPI:BOOL=OFF \
-      -D CMAKE_INSTALL_PREFIX:PATH=/w/bangerth/share/x86_64/trilinos-10.12.2 \
-      -D BUILD_SHARED_LIBS:BOOL=ON ..
-
-    make
+    cmake -D Trilinos_ENABLE_Sacado=ON \
+      -D Trilinos_ENABLE_Stratimikos=ON \
+      -D CMAKE_BUILD_TYPE=RELEASE \
+      -D CMAKE_CXX_FLAGS="-g -O3" \
+      -D CMAKE_C_FLAGS="-g -O3" \
+      -D CMAKE_FORTRAN_FLAGS="-g -O5" \
+      -D Trilinos_EXTRA_LINK_FLAGS="-lgfortran" \
+      -D CMAKE_VERBOSE_MAKEFILE=FALSE \
+      -D Trilinos_VERBOSE_CONFIGURE=FALSE \
+      -D TPL_ENABLE_MPI=ON \
+      -D BUILD_SHARED_LIBS=ON \
+      -D CMAKE_INSTALL_PREFIX:PATH=$HOME/share/trilinos \
+      ..
+
     make install
        </pre>
       You will need to adjust the path into which you want to install Trilinos
-      in the second to last line of the cmake command.
-    </p>
-
-    <p>
-      <b>Using MPI:</b> If you
-      want to use Trilinos with MPI on parallel machines,
-      use <code>TPL_ENABLE_MPI=ON</code> instead.
+      in the CMAKE_INSTALL_PREFIX line.
     </p>
 
     <p>
       <b>Parallel builds:</b>
       If your computer has more than one processor core, use
-      <code>make -jN</code> instead of <code>make</code> in the last two lines
+      <code>make -jN</code> instead of <code>make</code> in the last line
       above, where <code>N</code> is the number of processors you have.
     </p>
 
index 409f112c4ddbd0ff69f76336667d867f92dd8960..71c9b6349a972ab49b0f678fa326d20fd7efdb7c 100644 (file)
@@ -23,7 +23,7 @@
 
   <frameset rows="70,*">
     <frame name="title" src="title.html" frameborder="1">
-    <frameset cols="120,*">
+    <frameset cols="150,*">
       <frame name="navbar" src="navbar.html" frameborder="0">
       <frame name="body" src="documentation.html" frameborder="0">
     </frameset>
diff --git a/deal.II/doc/license/adjust.pl b/deal.II/doc/license/adjust.pl
new file mode 100644 (file)
index 0000000..497170f
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/perl
+
+my $header=1;
+
+print << 'EOT'
+//----------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1998 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+//----------------------------------------------------------------------
+EOT
+    ;
+
+while(<>)
+{
+    $header=0 unless m/\/\//;
+    next if $header;
+    print;
+}
index baa3862da68d2fff8e98a4cb2d5e19293975c8ea..7e1eec4cec5878e39ec4a851970ab35c461ba3a3 100644 (file)
@@ -1,7 +1,7 @@
-//----------------------------------------------------------------------
+// ---------------------------------------------------------------------
 // $Id$
 //
-// Copyright (C) 1998 - 2013 by the deal.II authors
+// Copyright (C) @YEAR@ by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -12,4 +12,5 @@
 // The full text of the license can be found in the file LICENSE at
 // the top level of the deal.II distribution.
 //
-//----------------------------------------------------------------------
+// ---------------------------------------------------------------------
+
diff --git a/deal.II/doc/license/header-template.cmake b/deal.II/doc/license/header-template.cmake
new file mode 100644 (file)
index 0000000..f5567b7
--- /dev/null
@@ -0,0 +1,15 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
diff --git a/deal.II/doc/license/replace.sh b/deal.II/doc/license/replace.sh
new file mode 100755 (executable)
index 0000000..f43cf52
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+FILE=$1
+
+FIRST_YEAR=$(grep Copyright $FILE | perl -pi -e 's/.*?(\d{4}).*/\1/')
+if [ "$FIRST_YEAR" = "2013" ] || (! [[ "$FIRST_YEAR" =~ "^[0-9]+$" ]])
+then
+  YEAR="2013"
+else if
+  YEAR="$FIRST_YEAR - 2013"
+fi
+
+sed -e "s/@YEAR@/$YEAR/" doc/license/header-template > /tmp/foobar22.temp
+
+header_lines=1
+on_whitespace=true
+whitespace_detected=false
+while read line
+do
+  if $on_whitespace && [[ $line =~ "^$" ]]
+  then
+    whitespace_detected=true
+    header_lines=$[$header_lines+1]
+    continue
+  else
+    on_whitespace=false
+  fi
+
+  if ! [[ $line =~ "^//.*$" ]]
+  then
+    break
+  else
+    header_lines=$[$header_lines+1]
+  fi
+done < $FILE
+
+if $whitespace_detected
+then
+  echo "$FILE --> whitespace"
+  echo "$FILE --> $header_lines"
+else
+  if [ $header_lines -lt 10 ]
+  then
+    echo "$FILE --> $header_lines"
+  fi
+fi
+
+tail -n+$header_lines $FILE >> /tmp/foobar22.temp
+
+cp /tmp/foobar22.temp $FILE
+
index fcc7b54ec143b290cde409d27eaa5000c60b45e8..698b4cc17de693964ade4304103167dd0a8f285e 100644 (file)
   <body class="navbar">
 
     <p>
+      <a href="http://www.dealii.org"target="_top">http://www.dealii.org</a><br />
       <a href="index.html" target="_top">Home</a><br />
-      <a href="http://www.dealii.org"target="_top">dealii.org</a><br />
-      <a href="readme.html" target="body">README</a><br />
     </p>
 
     <hr>
 
+    <p>
+      <a href="readme.html" target="body">README</a><br />
+
+    </p>
+    <hr>
+
     <p>
       <a href="doxygen/tutorial/index.html" target="_top">Tutorial</a><br />
       <a href="doxygen/deal.II/index.html" target="_top">Manual</a><br />
diff --git a/deal.II/doc/news/7.3.0-vs-8.0.0.h b/deal.II/doc/news/7.3.0-vs-8.0.0.h
new file mode 100644 (file)
index 0000000..c720497
--- /dev/null
@@ -0,0 +1,627 @@
+/**
+ * @page changes_between_7_3_and_8_0 Changes between Version 7.3 and 8.0
+
+<p>
+This is the list of changes made between the release of
+deal.II version 7.3.0 and that of 8.0.0.
+All entries are signed with the names of the authors.
+</p>
+
+
+
+<!-- ----------- INCOMPATIBILITIES ----------------- -->
+
+<a name="incompatible"></a>
+<h3 style="color:red">Incompatibilities</h3>
+
+<p style="color:red">
+Following are a few modifications to the library that unfortunately
+are incompatible with previous versions of the library, but which we
+deem necessary for the future maintainability of the
+library. Unfortunately, some of these changes will require
+modifications to application programs. We apologize for the
+inconvenience this causes.
+</p>
+
+<ol>
+
+<li> Removed: it was possible to call get_dof_indices(), get_dof_values(),
+set_dof_values(), and distribute_local_to_global() for cells that were not
+active, if the finite element only had DoFs on vertices (i.e. Q1). This is
+no longer allowed.
+<br>
+(Timo Heister, 2013/06/02)
+
+<li> Changed: Internal structures of ExceptionBase are now thread safe. The
+Assert macro does not print an exception to deallog any more prior to
+throwing if deal_II_exceptions::abort_on_exception==false. Removed: A
+number of obsolete Exceptions that are not used in the library any more.
+<br>
+(Matthias Maier, 2013/04/16)
+
+<li> Removed: A number of header files that have been deprecated a long time
+ago have been removed. All of them had previously only included the header file
+that had superseded them. To upgrade, simply include the currently used
+header file. This is also backward compatible with deal.II 7.3.
+<br>
+(Guido Kanschat, 2013/04/12)
+
+<li> Removed: The interfaces to the obsolete direct solvers MA27 and MA47 from
+the Harwell Subroutine Library. Support for the HSL routines were not ported to
+the new build system. However, the sparse direct solver UMFPACK remains to be
+supported and is provided as part of the standard deal.II distribution, unlike
+the HSL functions.
+<br>
+(Matthias Maier, 2013/04/01)
+
+<li> Changed: The TimeDependent::end_sweep function with an argument indicating
+the number of threads has been removed. Use the corresponding function without
+an argument. Since the argument had a default value, few users will have used
+this function.
+<br>
+(Wolfgang Bangerth, 2013/03/17)
+
+</ol>
+
+
+<!-- ----------- GENERAL IMPROVEMENTS ----------------- -->
+
+<a name="general"></a>
+<h3>General</h3>
+
+
+<ol>
+  <li> Improvements on the CMake build system: A Working C (or Fortran) compiler
+  is now fully optional; Improved support for static linkage with a toggle
+  "DEAL_II_PREFER_STATIC_LIBS" that will prefer static archives for non system
+  libraries and "DEAL_II_STATIC_EXECUTABLE" that will switch the complete link
+  interface to static linkage.
+  <br>
+  (Matthias Maier, 2013/07/16)
+  </li>
+
+  <li> New: various functions for parallel computations got introduced to
+  make Trilinos and PETSc interfaces similar. Now step-40 can be used with
+  PETSc or Trilinos with just a few changes. This patch also introduces
+  better support for block systems in the PETSc interfaces.
+  <br>
+  (Timo Heister, 2013/07/15)
+  </li>
+
+  <li> New: deal.II can now be compiled to 64-bit global dof indices. To turn
+  this feature on, use the cmake option -DDEAL_II_WITH_64BIT_INDICES=ON. If
+  PETSc and/or Trilinos are used, they must be compiled to support 64-bit
+  indices. To write a code that can use 32-bit and 64-bit indices depending on
+  deal.II compilation option, use types::global_dof_index for all the global
+  dof indices.
+  <br>
+  (Kainan Wang and Bruno Turcksin, 2013/06/05)
+  </li>
+
+  <li> New: All vector classes now have a member function
+  <code>locally_owned_elements</code> that returns an index
+  set indicating which elements of this vector the current
+  processor owns.
+  <br>
+  (Wolfgang Bangerth, 2013/05/24)
+  </li>
+
+
+  <li> New: A new element FE_Q_iso_Q1 has been implemented that is defined by
+  a subdivision of the element into smaller Q1 elements. An element of order
+  @p p is similar to FE_Q of degree @p p with the same numbering of degrees of
+  freedom. The element is useful e.g. for defining a sparser preconditioner
+  matrix for AMG at higher order FE_Q elements or for representing a component
+  of a system of PDEs where higher resolution is preferred over high order.
+  <br>
+  (Martin Kronbichler, 2013/05/14)
+  </li>
+
+  <li> New: The step-49 tutorial program now also has a discussion on
+  what to do once you have a coarse mesh and want to refine it.
+  <br>
+  (Wolfgang Bangerth, 2013/04/03)
+  </li>
+
+  <li> New: The number of threads used by deal.II/TBB can now be limited at
+  run time. Using MPI based code using PETSc/Trilinos no longer requires you
+  to compile the library without threads. See MPI_InitFinalize and
+  MultithreadInfo::set_thread_limit for details.
+  <br>
+  (Timo Heister, 2013/03/26)
+  </li>
+
+  <li> New: The results section of step-36 now explains how to use ARPACK
+  as an alternative to SLEPc as eigenvalue solver.
+  <br>
+  (Juan Carlos Araujo Cabarcas, 2013/03/25)
+  </li>
+
+  <li> New: deal.II now uses <a href="http://www.cmake.org/">CMake</a>
+  as its configuration and build tool. Please read through the
+  readme and other installation files for information about how the
+  installation process has changed.
+  <br>
+  Because this touches the configuration of every external package we
+  interact with, there are a number of other changes as a result:
+  <ul>
+    <li>The minimum supported version for Trilinos is now 10.8.x.
+    <li>We no longer link with different versions of the p4est library
+        in debug and optimized mode. Rather, we now link with the same
+       library in both modes. The p4est installation instructions have
+       been updated. <blink>TODO TODO TODO</blink>
+  </ul>
+  <br>
+  (Matthias Maier, 2013/03/07)
+  </li>
+</ol>
+
+
+<!-- ----------- SPECIFIC IMPROVEMENTS ----------------- -->
+
+<a name="specific"></a>
+<h3>Specific improvements</h3>
+
+<ol>
+
+<li>New: VectorTools::project and a whole host of similar functions
+are now also available for objects of type hp::DoFHandler.
+<br>
+(Wolfgang Bangerth, 2013/07/21)
+</li>
+
+<li>Fixed: hp::DoFHandler::n_boundary_dofs() had a bug that always led
+to a failed assertion. This is now fixed.
+<br>
+(Wolfgang Bangerth, 2013/07/21)
+</li>
+
+<li>Fixed: VectorTools::project has an option to first project onto the
+boundary. However, the implementation of this option ignored the mapping
+that is provided to the function. This is now fixed.
+<br>
+(Wolfgang Bangerth, 2013/07/16)
+</li>
+
+<li>Improved: The WorkStream class used throughout deal.II is now using
+thread local variables and initializes temporary variables on the thread
+that uses them, leading to better cache locality.
+<br>
+(Wolfgang Bangerth, 2013/07/16)
+</li>
+
+<li>Improved: The "pure" functions in MeshWorker::LocalIntegrator are now implemented and throw
+an exception if not overloaded.
+<br>
+(Guido Kanschat, 2013/07/16)
+</li>
+
+<li> New: The function SparseDirectUMFPACK::Tvmult is now implemented.
+<br>
+(Matthias Maier, 2013/07/03)
+</li>
+
+<li> New: In addition to the FEValuesExtractors::Scalar,
+FEValuesExtractors::Vector, and FEValuesExtractors::SymmetricTensor classes,
+there are now also fully featured FEValuesExtractors::Tensor extractors
+for non-symmetric tensors of rank 2.
+<br>
+(Denis Davydov, 2013/07/02)
+</li>
+
+<li> New: There are now functions Tensor::component_to_unrolled_index()
+and Tensor::unrolled_to_component_indices() in the same way as they
+already exist for the SymmetricTensor class.
+<br>
+(Denis Davydov, 2013/07/02)
+</li>
+
+<li> New: There is now a read-write version of TableIndices::operator[].
+<br>
+(Denis Davydov, 2013/07/02)
+</li>
+
+<li> New: The function parallel::distributed::Triangulation::copy_triangulation() is
+now implemented.
+<br>
+(Martin Steigemann, 2013/07/02)
+</li>
+
+<li> New: TriaRawIterator::operator < (TriaRawIterator&) now implements a total ordering
+relation for cells even on distributed::parallel::Triangulation across processors.
+Additionally, TriaRawAccessor and CellAccessor now have an ordering relation.
+<br>
+(Guido Kanschat, 2013/06/24)
+</li>
+
+<li> New: CellAccessor::id() that returns a unique CellId that
+also works in parallel computations (where level and index is not
+useful).
+<br>
+(Timo Heister, 2013/06/24)
+</li>
+
+<li> New: added ConstantTensorFunction<rank, dim> and ZeroTensorFunction<rank, dim> to provide
+a tensor valued analogue to ConstantFunction and ZeroFunction.
+<br>
+(Matthias Maier, 2013/06/20)
+</li>
+
+<li> Fixed: BlockSparsityPattern::column_number was returning
+wrong values.
+<br>
+(Timo Heister, 2013/06/16)
+</li>
+
+<li> Fixed: The stabilization parameter for the artificial diffusion
+in the step-31 tutorial program has been increased slightly to avoid
+instabilities at later times (<i>t</i> > 60).
+<br>
+(Martin Kronbichler, 2013/06/04)
+</li>
+
+<li> Fixed: If an exception was generated on a task created by
+Threads::new_task, the program would terminate with a segmentation
+fault, leaving little trace of what had happened. This is now handled
+more gracefully.
+<br>
+(Wolfgang Bangerth, 2013/06/02)
+</li>
+
+<li> Changed: subdomain ids can now only be queried/set on active cells.
+Consequently, is_artificial(), is_ghost(), and is_locally_owned() is
+now restricted to active cells.
+<br>
+(Timo Heister, 2013/05/31)
+</li>
+
+<li> Improved: Triangulation::begin(level) and Triangulation::end(level) now return an
+empty iterator range if the level is larger than the maximal locally owned level,
+but still in the global level range of a distributed Triangulation.
+<br>
+(Timo Heister and Guido Kanschat, 2013/05/26)
+</li>
+
+<li> New: The IndexSet::add_indices function that takes another IndexSet
+object now has an additional argument <code>offset</code> that can be used
+to offset the indices of first argument.
+<br>
+(Wolfgang Bangerth, 2013/05/25)
+</li>
+
+<li> New: ConstraintMatrix::distribute is now also implemented for
+arguments of type PETScWrappers::MPI::BlockVector.
+<br>
+(Wolfgang Bangerth, 2013/05/25)
+</li>
+
+<li> Fixed: IndexSet::operator== returned the wrong results
+in some cases.
+<br>
+(Wolfgang Bangerth, 2013/05/25)
+</li>
+
+<li> New: The global function <code>complete_index_set()</code>
+creates and returns an index set of given size that contains
+every single index with this range.
+<br>
+(Wolfgang Bangerth, 2013/05/24)
+</li>
+
+<li> New: All vector classes now have a static member variable
+<code>supports_distributed_data</code> that indicates whether the
+vector class supports data that is distributed across multiple
+processors. This variable is provided as a <i>traits variable</i>
+to allow generic algorithms working on general vector types to
+query the capabilities of the vector class at compile time.
+<br>
+(Wolfgang Bangerth, 2013/05/23)
+</li>
+
+<li> Fixed: FETools::back_interpolate has been revised to work correctly
+also with parallel::distributed::Vector.
+<br>
+(Martin Steigemann, 2013/05/23)
+</li>
+
+<li> Removed: The file <code>mesh_worker/vector_info.h</code> was unused and
+untested. It has thus been removed.
+<br>
+(Wolfgang Bangerth, Guido Kanschat, 2013/05/21)
+</li>
+
+<li> Fixed: The method parallel::distributed::Vector::compress
+(VectorOperation::insert) previously set the elements of ghost elements
+unconditionally on the owning processor, even if they had not been touched.
+This led to a problem in certain library functions where vector entries became
+zero in a spurious way. This is now fixed by discarding the elements in ghost
+entries for the VectorOperation::insert operation. This is legitimate since we
+assume consistency of set elements across processors, so the owning processor
+sets the element already.
+<br>
+(Martin Kronbichler, 2013/05/21)
+</li>
+
+<li> Improved: DoFTools::make_periodicity_constraints now also works
+for meshes where the refinement level of the two sides of the domain
+is not the same, i.e., one side is more refined than the other.
+<br>
+(Wolfgang Bangerth, 2013/05/20)
+</li>
+
+<li> Improved: Through the fields DataOutBase::VtkFlags::time and
+DataOutBase::VtkFlags::cycle, it is now possible to encode the time and/or
+cycle within a nonlinear or other iteration in VTK and VTU files written
+via DataOutBase::write_vtk and DataOutBase::write_vtu.
+<br>
+(Wolfgang Bangerth, 2013/05/12)
+</li>
+
+<li> Fixed: The method ConvergenceTable::evaluate_convergence_rates with
+ reference column did not take the dimension of the reference column into
+ account, leading to wrong logarithmic rates for dim!=2. This can now be fixed
+ by specifying the dimension as a last argument.
+<br>
+(Martin Kronbichler, 2013/05/10)
+</li>
+
+<li> Improved: The functions MatrixTools::create_mass_matrix and
+MatrixTools::create_laplace_matrix take now an optional ConstraintMatrix
+argument that allows to directly apply the constraints. This also helps
+VectorTools::project. Note that not providing constraints remains the default
+and recommended way to ensure consistency when several matrices are combined.
+<br>
+(Martin Kronbichler, 2013/05/08)
+</li>
+
+<li> New: The classes TrilinosWrappers::SparseMatrix and
+TrilinosWrappers::BlockSparseMatrix now fully implement vmult and Tvmult with
+deal.II's own vector classes Vector<double> and
+parallel::distributed::Vector<double>.
+<br>
+(Martin Kronbichler, 2013/05/08)
+</li>
+
+<li> Improved: The matrix-vector product ChunkSparseMatrix::vmult now runs in
+parallel in shared memory.
+<br>
+(Martin Kronbichler, 2013/05/07)
+</li>
+
+<li> New: The class ChunkSparseMatrix and the associated
+ChunkSparsityPattern now offer iterator classes to iterate over rows of the
+matrix in an STL-like way.
+<br>
+(Martin Kronbichler, 2013/05/07)
+</li>
+
+<li> Fixed: The stopping criterion for early exit in SolverBicgstab did not
+work properly for systems with large values, leading to premature exit. This
+is now fixed.
+<br>
+(Martin Kronbichler, 2013/05/07)
+</li>
+
+<li> Changed: The SolverGMRES implementation previously applied two
+iterations of the modified Gram&ndash;Schmidt algorithm for
+orthogonalization. In many situations one iteration is enough. The algorithm
+can now detect loss of orthogonality and enables re-orthogonalization only if
+necessary. The second iteration (and, hence, old behavior) can be forced by
+the flag SolverGMRES::AdditionalData::force_re_orthogonalization.
+<br>
+(Martin Kronbichler, 2013/05/06)
+</li>
+
+<li> Changed: FETools::interpolate is now instantiated for all
+vector types, not just dealii::Vector and dealii::BlockVector.
+<br>
+(Wolfgang Bangerth, 2013/05/06)
+</li>
+
+<li> Fixed: setting values in TrilinosWrappers::SparseMatrix
+in parallel was adding the values instead.
+<br>
+(Bruno Turcksin, Timo Heister, 2013/05/03)
+</li>
+
+<li> Fixed: Generate an error if the user tries to refine a cell
+that is already on the maximum level in a distributed triangulation.
+<br>
+(Timo Heister, 2013/05/01)
+</li>
+
+<li> Fixed: The version of ParameterHandler::set that takes a boolean
+as second argument was broken and did not work. This is now fixed.
+<br>
+(Ashkan Dorostkar, Wolfgang Bangerth, 2013/04/30)
+</li>
+
+<li> Fixed: PETScWrappers::VectorBase::print now saves and restores
+the precision
+and width associated with the stream it prints to around setting
+the values passed as arguments.
+<br>
+(Fahad Alrashed, 2013/04/22)
+</li>
+
+<li> Fixed: FullMatrix::print now saves and restores the precision
+and width associated with the stream it prints to around setting
+the values passed as arguments.
+<br>
+(Fahad Alrashed, 2013/04/22)
+</li>
+
+<li> New: LogStream now has member functions LogStream::width,
+LogStream::precision and LogStream::flags that make it look more
+like normal objects of type <code>std::ostream</code>.
+<br>
+(Fahad Alrashed, 2013/04/22)
+</li>
+
+<li> New: SparseDirectUMFPACK has long had the ability to work with
+BlockSparseMatrix objects, but couldn't deal with BlockVector objects.
+This is now fixed.
+<br>
+(Wolfgang Bangerth, 2013/04/21)
+</li>
+
+<li> New: Class TimerOutput::Scope does automatic scope based enter/
+exit_section of a TimerOutput object.
+<br>
+(Timo Heister, 2013/04/18)
+</li>
+
+<li> Fixed: TimerOutput constructed with an MPI_COMM in wall_time
+mode now constructs synchronized Timer objects. This gives reliable
+parallel benchmark timings.
+<br>
+(Timo Heister, 2013/04/18)
+</li>
+
+<li> Improved and Fixed: LogStream (and deallog) now respect std::flush in
+addition to std::endl to write out content to the console/file.
+Furthermore, LogStream::push(...) and LogStream::pop() now work in a thread
+safe manner. Also allow to pop() the prefix "DEAL".
+<br>
+(Matthias Maier, 2013/04/18)
+</li>
+
+<li> Fixed: The HalfHyperShellBoundary class got refining
+the edges that sit at the perimeter of the circular face of the domain
+wrong. This is now fixed.
+<br>
+(Wolfgang Bangerth, J&ouml;rg Frohne, 2013/04/17)
+</li>
+
+<li> New: Functions::FEFieldFunction can now deal with
+parallel::distributed::Triangulation objects.
+<br>
+(Wolfgang Bangerth, 2013/04/15)
+</li>
+
+<li> New: There is now a version of SparseMatrix::copy_from that can copy
+from TrilinosWrappers::SparseMatrix.
+<br>
+(Wolfgang Bangerth, J&ouml;rg Frohne, 2013/04/15)
+</li>
+
+<li> Improved: The SolverCG implementation now uses only three auxiliary
+vectors, down from previously four. Also, there are some shortcuts in case
+PreconditionIdentity is used that improve the solver's performance.
+<br>
+(Martin Kronbichler, 2013/04/11)
+</li>
+
+<li> Fixed: The results section of step-23 did not show the movie in release 7.3
+due to a poor HTML markup. This is now fixed.
+<br>
+(Wolfgang Bangerth, 2013/04/10)
+</li>
+
+<li> Fixed: It is now possible to use the MeshWorker framework in 1d as well.
+<br>
+(Wolfgang Bangerth, Scott Miller, 2013/04/09)
+</li>
+
+<li> Fixed: It was not possible to create a default-constructed object of
+type Triangulation<1>::face_iterator. This is now fixed.
+<br>
+(Wolfgang Bangerth, Scott Miller, 2013/04/09)
+</li>
+
+<li> New: VectorTools::subtract_mean_value can now be called without a
+boolean mask. The vector type is templatified and instantiated for all
+non distributed vectors.
+<br>
+(Matthias Maier, 2013/04/08)
+</li>
+
+<li> Fixed: It is now possible to call ConvergenceTable::evaluate_convergence_rates
+multiple times.
+<br>
+(Matthias Maier, 2013/04/08)
+</li>
+
+<li> Fixed: GridTools::distort_random (previously called Triangulation::distort_random)
+had a bug where points were only ever moved in <i>positive</i> coordinate
+directions rather than with uniform probability in either direction. The 1d
+implementation also had the problem that it did not move vertices if the
+<i>cell</i> they were on was at the boundary, even if the <i>vertex</i>
+itself was not. All of these problems are now fixed.
+<br>
+(Wolfgang Bangerth, 2013/04/05)
+</li>
+
+<li> New: There is a class VectorFunctionFromTensorFunction that converts
+between objects of type TensorFunction and Function.
+<br>
+(Spencer Patty, 2013/4/2)
+</li>
+
+<li> Fixed: The ParameterHandler class could not deal with parameters named
+<code>"value"</code> (and a few other names). This is now fixed.
+<br>
+(Denis Davydov, Matthias Maier, Wolfgang Bangerth, 2013/3/31)
+</li>
+
+<li> Changed: TimerOutput no longer assumes that sections are not nested
+when outputting percentage and total run time.
+<br>
+(Timo Heister, 2013/3/28)
+</li>
+
+<li> New: MPI_InitFinalize can also initialize PETSc/Slepc when
+not compiling with MPI. This is now the preferred way to initialize
+MPI/PETSc/Slepc in all cases.
+<br>
+(Timo Heister, 2013/3/26)
+</li>
+
+<li> Added/fixed: IterativeInverse::vmult() can now handle vectors
+using a different number type than the matrix type. As usual, the
+number types must be compatible. Addtitionally, the initial guess is
+always set to zero, since starting with the incoming vector makes no
+sense.
+<br>
+(Guido Kanschat, 2013/03/21)
+</li>
+
+<li> Added GridOut::write_svg() to allow for the output of
+two-dimensional triangulations in two space dimensions in the SVG
+format (Scalable Vector Graphics, an generic XML-based vector image
+format developed and maintained by the World Wide Web Consortium W3C).
+This function also provides cell coloring and cell labeling for the
+visualization of basic cell properties. Pespective view is further
+possible and the cell level number may be converted into altitude,
+revealing the inactive cells lying below.
+<br>
+(Christian Wülker, 2013/03/21)
+</li>
+
+<li> Added TimerOutput::reset to remove the collected information so far and
+added a new frequency TimerOutput::never to only output information if
+triggered by print_summary().
+<br>
+(Timo Heister, 2013/03/20)
+</li>
+
+<li> Changed: FEValuesExtractors::Scalar, FEValuesExtractors::Vector and
+FEValuesExtractors::SymmetricTensor could not be default constructed, and
+consequently one could not easily put them into arrays (where they would
+be default constructed when changing the size, and later assigned useful
+values). These classes can now be default constructed to invalid
+values, but can of course not be used in any useful way.
+<br>
+(Wolfgang Bangerth, 2013/03/15)
+</li>
+
+<li> Fixed: FETools::interpolation_difference did not work with PETSc.
+This is now fixed.
+<br>
+(Timo Heister, 2013/03/01)
+</li>
+
+</ol>
+
+
+*/
index a29684ee60baabe19dbcb45118ccdc959688421e..59758c96011b47449da81db96d77db49b10b166d 100644 (file)
@@ -1,9 +1,9 @@
 /**
- * @page changes_after_7_3 Changes after Version 7.3
+ * @page changes_after_8_0 Changes after Version 8.0
 
 <p>
 This is the list of changes made after the release of
-deal.II version 7.3.0.
+deal.II version 8.0.0.
 All entries are signed with the names of the authors.
 </p>
 
@@ -25,35 +25,6 @@ inconvenience this causes.
 
 <ol>
 
-<li> Changed: Internal structures of ExceptionBase are now thread safe. The
-Assert macro does not print an exception to deallog any more prior to
-throwing if deal_II_exceptions::abort_on_exception==false. Removed: A
-number of obsolete Exceptions that are not used in the library any more.
-<br>
-(Matthias Maier, 2013/04/16)
-
-<li> Removed: A number of header files that have been deprecated a long time
-ago have been removed. All of them had previously only included the header file
-that had superseded them. To upgrade, simply include the currently used
-header file. This is also backward compatible with deal.II 7.3.
-<br>
-(Guido Kanschat, 2013/04/12)
-
-<li> Removed: The interfaces to the obsolete direct solvers MA27 and MA47 from
-the Harwell Subroutine Library. Support for the HSL routines were not ported to
-the new build system. However, the sparse direct solver UMFPACK remains to be
-supported and is provided as part of the standard deal.II distribution, unlike
-the HSL functions.
-<br>
-(Matthias Maier, 2013/04/01)
-
-<li> Changed: The TimeDependent::end_sweep function with an argument indicating
-the number of threads has been removed. Use the corresponding function without
-an argument. Since the argument had a default value, few users will have used
-this function.
-<br>
-(Wolfgang Bangerth, 2013/03/17)
-
 </ol>
 
 
@@ -64,63 +35,6 @@ this function.
 
 
 <ol>
-
-  <li> New: All vector classes now have a member function
-  <code>locally_owned_elements</code> that returns an index
-  set indicating which elements of this vector the current
-  processor owns.
-  <br>
-  (Wolfgang Bangerth, 2013/05/24)
-  </li>
-
-
-  <li> New: A new element FE_Q_iso_Q1 has been implemented that is defined by
-  a subdivision of the element into smaller Q1 elements. An element of order
-  @p p is similar to FE_Q of degree @p p with the same numbering of degrees of
-  freedom. The element is useful e.g. for defining a sparser preconditioner
-  matrix for AMG at higher order FE_Q elements or for representing a component
-  of a system of PDEs where higher resolution is preferred over high order.
-  <br>
-  (Martin Kronbichler, 2013/05/14)
-  </li>
-
-  <li> New: The step-49 tutorial program now also has a discussion on
-  what to do once you have a coarse mesh and want to refine it.
-  <br>
-  (Wolfgang Bangerth, 2013/04/03)
-  </li>
-
-  <li> New: The number of threads used by deal.II/TBB can now be limited at
-  run time. Using MPI based code using PETSc/Trilinos no longer requires you
-  to compile the library without threads. See MPI_InitFinalize and
-  MultithreadInfo::set_thread_limit for details.
-  <br>
-  (Timo Heister, 2013/03/26)
-  </li>
-
-  <li> New: The results section of step-36 now explains how to use ARPACK
-  as an alternative to SLEPc as eigenvalue solver.
-  <br>
-  (Juan Carlos Araujo Cabarcas, 2013/03/25)
-  </li>
-
-  <li> New: deal.II now uses <a href="http://www.cmake.org/">CMake</a>
-  as its configuration and build tool. Please read through the
-  readme and other installation files for information about how the
-  installation process has changed.
-  <br>
-  Because this touches the configuration of every external package we
-  interact with, there are a number of other changes as a result:
-  <ul>
-    <li>The minimum supported version for Trilinos is now 10.8.x.
-    <li>We no longer link with different versions of the p4est library
-        in debug and optimized mode. Rather, we now link with the same
-       library in both modes. The p4est installation instructions have
-       been updated. <blink>TODO TODO TODO</blink>
-  </ul>
-  <br>
-  (Matthias Maier, 2013/03/07)
-  </li>
 </ol>
 
 
@@ -130,347 +44,6 @@ this function.
 <h3>Specific improvements</h3>
 
 <ol>
-<li> New: ConstraintMatrix::distribute is now also implemented for
-arguments of type PETScWrappers::MPI::BlockVector.
-<br>
-(Wolfgang Bangerth, 2013/05/25)
-</li>
-
-<li> Fixed: IndexSet::operator== returned the wrong results
-in some cases.
-<br>
-(Wolfgang Bangerth, 2013/05/25)
-</li>
-
-<li> New: The global function <code>complete_index_set()</code>
-creates and returns an index set of given size that contains
-every single index with this range.
-<br>
-(Wolfgang Bangerth, 2013/05/24)
-</li>
-
-<li> New: All vector classes now have a static member variable
-<code>supports_distributed_data</code> that indicates whether the
-vector class supports data that is distributed across multiple
-processors. This variable is provided as a <i>traits variable</i>
-to allow generic algorithms working on general vector types to
-query the capabilities of the vector class at compile time.
-<br>
-(Wolfgang Bangerth, 2013/05/23)
-</li>
-
-<li> Fixed: FETools::back_interpolate has been revised to work correctly
-also with parallel::distributed::Vector.
-<br>
-(Martin Steigemann, 2013/05/23)
-</li>
-
-<li> Removed: The file <code>mesh_worker/vector_info.h</code> was unused and
-untested. It has thus been removed.
-<br>
-(Wolfgang Bangerth, Guido Kanschat, 2013/05/21)
-</li>
-
-<li> Fixed: The method parallel::distributed::Vector::compress
-(VectorOperation::insert) previously set the elements of ghost elements
-unconditionally on the owning processor, even if they had not been touched.
-This led to a problem in certain library functions where vector entries became
-zero in a spurious way. This is now fixed by discarding the elements in ghost
-entries for the VectorOperation::insert operation. This is legitimate since we
-assume consistency of set elements across processors, so the owning processor
-sets the element already.
-<br>
-(Martin Kronbichler, 2013/05/21)
-</li>
-
-<li> Improved: DoFTools::make_periodicity_constraints now also works
-for meshes where the refinement level of the two sides of the domain
-is not the same, i.e., one side is more refined than the other.
-<br>
-(Wolfgang Bangerth, 2013/05/20)
-</li>
-
-<li> Improved: Through the fields DataOutBase::VtkFlags::time and
-DataOutBase::VtkFlags::cycle, it is now possible to encode the time and/or
-cycle within a nonlinear or other iteration in VTK and VTU files written
-via DataOutBase::write_vtk and DataOutBase::write_vtu.
-<br>
-(Wolfgang Bangerth, 2013/05/12)
-</li>
-
-<li> Fixed: The method ConvergenceTable::evaluate_convergence_rates with
- reference column did not take the dimension of the reference column into
- account, leading to wrong logarithmic rates for dim!=2. This can now be fixed
- by specifying the dimension as a last argument.
-<br>
-(Martin Kronbichler, 2013/05/10)
-</li>
-
-<li> Improved: The functions MatrixTools::create_mass_matrix and
-MatrixTools::create_laplace_matrix take now an optional ConstraintMatrix
-argument that allows to directly apply the constraints. This also helps
-VectorTools::project. Note that not providing constraints remains the default
-and recommended way to ensure consistency when several matrices are combined.
-<br>
-(Martin Kronbichler, 2013/05/08)
-</li>
-
-<li> New: The classes TrilinosWrappers::SparseMatrix and
-TrilinosWrappers::BlockSparseMatrix now fully implement vmult and Tvmult with
-deal.II's own vector classes Vector<double> and
-parallel::distributed::Vector<double>.
-<br>
-(Martin Kronbichler, 2013/05/08)
-</li>
-
-<li> Improved: The matrix-vector product ChunkSparseMatrix::vmult now runs in
-parallel in shared memory.
-<br>
-(Martin Kronbichler, 2013/05/07)
-</li>
-
-<li> New: The class ChunkSparseMatrix and the associated
-ChunkSparsityPattern now offer iterator classes to iterate over rows of the
-matrix in an STL-like way.
-<br>
-(Martin Kronbichler, 2013/05/07)
-</li>
-
-<li> Fixed: The stopping criterion for early exit in SolverBicgstab did not
-work properly for systems with large values, leading to premature exit. This
-is now fixed.
-<br>
-(Martin Kronbichler, 2013/05/07)
-</li>
-
-<li> Changed: The SolverGMRES implementation previously applied two
-iterations of the modified Gram&ndash;Schmidt algorithm for
-orthogonalization. In many situations one iteration is enough. The algorithm
-can now detect loss of orthogonality and enables re-orthogonalization only if
-necessary. The second iteration (and, hence, old behavior) can be forced by
-the flag SolverGMRES::AdditionalData::force_re_orthogonalization.
-<br>
-(Martin Kronbichler, 2013/05/06)
-</li>
-
-<li> Changed: FETools::interpolate is now instantiated for all
-vector types, not just dealii::Vector and dealii::BlockVector.
-<br>
-(Wolfgang Bangerth, 2013/05/06)
-</li>
-
-<li> Fixed: setting values in TrilinosWrappers::SparseMatrix
-in parallel was adding the values instead.
-<br>
-(Bruno Turcksin, Timo Heister, 2013/05/03)
-</li>
-
-<li> Fixed: Generate an error if the user tries to refine a cell
-that is already on the maximum level in a distributed triangulation.
-<br>
-(Timo Heister, 2013/05/01)
-</li>
-
-<li> Fixed: The version of ParameterHandler::set that takes a boolean
-as second argument was broken and did not work. This is now fixed.
-<br>
-(Ashkan Dorostkar, Wolfgang Bangerth, 2013/04/30)
-</li>
-
-<li> Fixed: PETScWrappers::VectorBase::print now saves and restores
-the precision
-and width associated with the stream it prints to around setting
-the values passed as arguments.
-<br>
-(Fahad Alrashed, 2013/04/22)
-</li>
-
-<li> Fixed: FullMatrix::print now saves and restores the precision
-and width associated with the stream it prints to around setting
-the values passed as arguments.
-<br>
-(Fahad Alrashed, 2013/04/22)
-</li>
-
-<li> New: LogStream now has member functions LogStream::width,
-LogStream::precision and LogStream::flags that make it look more
-like normal objects of type <code>std::ostream</code>.
-<br>
-(Fahad Alrashed, 2013/04/22)
-</li>
-
-<li> New: SparseDirectUMFPACK has long had the ability to work with
-BlockSparseMatrix objects, but couldn't deal with BlockVector objects.
-This is now fixed.
-<br>
-(Wolfgang Bangerth, 2013/04/21)
-</li>
-
-<li> New: Class TimerOutput::Scope does automatic scope based enter/
-exit_section of a TimerOutput object.
-<br>
-(Timo Heister, 2013/04/18)
-</li>
-
-<li> Fixed: TimerOutput constructed with an MPI_COMM in wall_time
-mode now constructs synchronized Timer objects. This gives reliable
-parallel benchmark timings.
-<br>
-(Timo Heister, 2013/04/18)
-</li>
-
-<li> Improved and Fixed: LogStream (and deallog) now respect std::flush in
-addition to std::endl to write out content to the console/file.
-Furthermore, LogStream::push(...) and LogStream::pop() now work in a thread
-safe manner.
-<br>
-(Matthias Maier, 2013/04/18)
-</li>
-
-<li> Fixed: The HalfHyperShellBoundary class got refining
-the edges that sit at the perimeter of the circular face of the domain
-wrong. This is now fixed.
-<br>
-(Wolfgang Bangerth, J&ouml;rg Frohne, 2013/04/17)
-</li>
-
-<li> New: Functions::FEFieldFunction can now deal with
-parallel::distributed::Triangulation objects.
-<br>
-(Wolfgang Bangerth, 2013/04/15)
-</li>
-
-<li> New: There is now a version of SparseMatrix::copy_from that can copy
-from TrilinosWrappers::SparseMatrix.
-<br>
-(Wolfgang Bangerth, J&ouml;rg Frohne, 2013/04/15)
-</li>
-
-<li> Improved: The SolverCG implementation now uses only three auxiliary
-vectors, down from previously four. Also, there are some shortcuts in case
-PreconditionIdentity is used that improve the solver's performance.
-<br>
-(Martin Kronbichler, 2013/04/11)
-</li>
-
-<li> Fixed: The results section of step-23 did not show the movie in release 7.3
-due to a poor HTML markup. This is now fixed.
-<br>
-(Wolfgang Bangerth, 2013/04/10)
-</li>
-
-<li> Fixed: It is now possible to use the MeshWorker framework in 1d as well.
-<br>
-(Wolfgang Bangerth, Scott Miller, 2013/04/09)
-</li>
-
-<li> Fixed: It was not possible to create a default-constructed object of
-type Triangulation<1>::face_iterator. This is now fixed.
-<br>
-(Wolfgang Bangerth, Scott Miller, 2013/04/09)
-</li>
-
-<li> New: VectorTools::subtract_mean_value can now be called without a
-boolean mask. The vector type is templatified and instantiated for all
-non distributed vectors.
-<br>
-(Matthias Maier, 2013/04/08)
-</li>
-
-<li> Fixed: It is now possible to call ConvergenceTable::evaluate_convergence_rates
-multiple times.
-<br>
-(Matthias Maier, 2013/04/08)
-</li>
-
-<li> Fixed: GridTools::distort_random (previously called Triangulation::distort_random)
-had a bug where points were only ever moved in <i>positive</i> coordinate
-directions rather than with uniform probability in either direction. The 1d
-implementation also had the problem that it did not move vertices if the
-<i>cell</i> they were on was at the boundary, even if the <i>vertex</i>
-itself was not. All of these problems are now fixed.
-<br>
-(Wolfgang Bangerth, 2013/04/05)
-</li>
-
-<li> New: There is a class VectorFunctionFromTensorFunction that converts
-between objects of type TensorFunction and Function.
-<br>
-(Spencer Patty, 2013/4/2)
-</li>
-
-<li> Fixed: The ParameterHandler class could not deal with parameters named
-<code>"value"</code> (and a few other names). This is now fixed.
-<br>
-(Denis Davydov, Matthias Maier, Wolfgang Bangerth, 2013/3/31)
-</li>
-
-<li> Changed: TimerOutput no longer assumes that sections are not nested
-when outputting percentage and total run time.
-<br>
-(Timo Heister, 2013/3/28)
-</li>
-
-<li> New: MPI_InitFinalize can also initialize PETSc/Slepc when
-not compiling with MPI. This is now the preferred way to initialize
-MPI/PETSc/Slepc in all cases.
-<br>
-(Timo Heister, 2013/3/26)
-</li>
-
-<li> Added/fixed: IterativeInverse::vmult() can now handle vectors
-using a different number type than the matrix type. As usual, the
-number types must be compatible. Addtitionally, the initial guess is
-always set to zero, since starting with the incoming vector makes no
-sense.
-<br>
-(Guido Kanschat, 2013/03/21)
-</li>
-
-<li> Added GridOut::write_svg() to allow for the output of 
-two-dimensional triangulations in two space dimensions in the SVG 
-format (Scalable Vector Graphics, an generic XML-based vector image 
-format developed and maintained by the World Wide Web Consortium W3C). 
-This function also provides cell coloring and cell labeling for the 
-visualization of basic cell properties. Pespective view is further 
-possible and the cell level number may be converted into altitude, 
-revealing the inactive cells lying below. 
-<br>
-(Christian Wülker, 2013/03/21)
-</li>
-
-<li> Added TimerOutput::reset to remove the collected information so far and
-added a new frequency TimerOutput::never to only output information if
-triggered by print_summary().
-<br>
-(Timo Heister, 2013/03/20)
-</li>
-
-<li> Changed: FEValuesExtractors::Scalar, FEValuesExtractors::Vector and
-FEValuesExtractors::SymmetricTensor could not be default constructed, and
-consequently one could not easily put them into arrays (where they would
-be default constructed when changing the size, and later assigned useful
-values). These classes can now be default constructed to invalid
-values, but can of course not be used in any useful way.
-<br>
-(Wolfgang Bangerth, 2013/03/15)
-</li>
-
-<li> Fixed: FETools::interpolation_difference did not work with PETSc.
-This is now fixed.
-<br>
-(Timo Heister, 2013/03/01)
-</li>
-
-<li> Added DataOutBase::write_svg() to allow for the output of a given 
-list of patches in two space dimensions in the SVG format (Scalable Vector
-Graphics, an generic XML-based vector image format developed and maintained 
-by the World Wide Web Consortium W3C). An additional dimension (z-direction) 
-is employed for the visualization of data values taken from a data vector.
-This function also provides patch coloring for the visual enhancement.  
-<br>
-(Christian Wülker, 2013/05/10)
-</li>
 
 </ol>
 
index 21da046e26c40443fec1334ce30691fd0342fbc6..79fa7929fbfa1915971d391040e467b0fb18fd6d 100644 (file)
       <dt><strong>Recent changes</strong></dt>
       <dd>
        Changes in the library since the last major release are
-       <strong><a href="../doxygen/deal.II/changes_after_7_3.html">here.</a></strong>
+       <strong><a href="../doxygen/deal.II/changes_after_8_0.html">here.</a></strong>
       </dd>
     </p>
 
     <dl>
+      <dt>
+          <strong style="color:red">2013/07/24: Version 8.0 released</strong>
+      </dt>
+      <dd>
+          deal.II version 8.0 was released today. This is a major new
+         release, featuring the conversion of the configuration and
+         build system to <a href="http://www.cmake.org/">CMake</a>,
+         support for parallel computations with more than 4 billion
+         unknowns, and many more. A full list of changes can be
+         found <a href="../doxygen/deal.II/changes_between_7_3_and_8_0.html"
+         target="body">here</a>.
+      </dd>
+
+      <dt>
+          <strong>2013/06/05: 64-bit version of deal.II</strong>
+      </dt>
+      <dd>
+          Because the global dof index variables in deal.II were of type
+         unsigned int, it was not possible to create a dof_handler with more than
+         4.3 billions of unknowns. The 64-bit version of deal.II uses unsigned long
+         long int and thus, allows for 18e18 unknowns.
+      </dd>
+
+
       <dt>
           <strong>2013/03/07: Build system switched to CMake</strong>
       </dt>
       <dd>
           After having used Autoconf as the configuration and build system
-         since the beginning of deal.II in 1997, we have now switch to
+         since the beginning of deal.II in 1997, we have now switched to
          <a href="http://www.cmake.org/">CMake</a>. This implementation,
          contributed by Matthias Maier of Heidelberg University, has taken
          more than half a year, consists of more than 10,000 lines, and
index 77d0a3a83b440f31d815fc7006b204883e831277..eea2a46b95750906b106fb88589536f45e318161 100644 (file)
          submitted, 2013.
        </li>
 
+       <li> J. C. Araujo-Cabarcas
+         <br>
+          <strong>Numerical methods for glacial isostatic adjustment models
+          </strong>
+         <br>
+         MSc thesis, Uppsala University, Uppsala, Sweden, 2013.
+       </li>
+
+       <li> G. Alam
+         <br>
+          <strong>Fast iterative solution of large scale statistical
+          inverse problems
+          </strong>
+         <br>
+         Master Thesis, Stockholm University, 2013.
+       </li>
+
+       <li> D. Arndt
+         <br>
+          <strong>Augmented Taylor-Hood Elements for Incompressible Flow
+          </strong>
+         <br>
+         Msc thesis, University of G&ouml;ttingen, Germany, 2013.
+       </li>
+
+       <li> P. Benner, M. Stoll
+         <br>
+         <strong>Optimal control for Allen-Cahn equations enhanced by model predictive control</strong>
+         <br>
+         Preprint, MPI Magdeburg, 2013.
+       </li>
+
        <li> A. Bonito, R. DeVore, R. H. Nochetto
          <br>
          <strong>Adaptive Finite Element Methods for Elliptic Problems with Discontinuous Coefficients</strong>
 
        <li> A. Bonito, I. Kyza, R. H. Nochetto
          <br>
-         <strong>A DG approach to higher order ALE formulations in
-         time</strong>
+         <strong>A dG Approach to Higher Order ALE Formulations in Time
+         </strong>
+         <br>
+         2012 Barrett Lectures, The IMA Volume in Mathematics and its Applications, Vol. 157, 36 pages, 2013, Springer.
+       </li>
+
+       <li> A. Bonito, I. Kyza, R. H. Nochetto
+         <br>
+         <strong>Time-discrete higher order ALE formulations: A
+           priori error analysis</strong>
          <br>
-         submitted, 2013.
+         Numer. Math., 23 pages, 2013, 10.1007/s00211-013-0539-3.
+       </li>
+
+       <li> A. Bonito, I. Kyza, R. H. Nochetto
+         <br>
+         <strong>Time-discrete higher order ALE formulations: Stability</strong>
+         <br>
+         SIAM J. Numer. Anal., 51(1), 577--608, 2013.
        </li>
 
        <li> J. Bosch, M. Stoll, P. Benner
          Preprint 13/01, MPI Magdeburg, 2013.
        </li>
 
+       <li> J. Bosch, D. Kay, M. Stoll, A. J. Wathen
+         <br>
+         <strong>Fast solvers for Cahn-Hilliard inpainting</strong>
+         <br>
+         Technical report 1705, The Mathematical Institute,
+         University of Oxford; submitted, 2013.
+       </li>
+
+       <li> A. Cangiani, J. Chapman, E. Georgoulis, M. Jensen
+         <br>
+         <strong>Implementation of the Continuous-Discontinuous
+           Galerkin Finite Element Method</strong>
+         <br>
+         Numerical Mathematics and Advanced Applications 2011,
+         pp. 315-322, 2013.
+       </li>
+
        <li> T. Carraro, J. Joos
          <br>
          <strong>Parameter estimation for a reconstructed SOFC
          arXiv:1301.6580v0, 2013.
        </li>
 
+       <li> C.-C. Chueh, N. Djilali, W. Bangerth
+         <br>
+         <strong>An h-adaptive Operator Splitting Method for
+           Two-phase Flow in 3D Heterogeneous Porous Media</strong>
+         <br>
+         SIAM Journal on Scientific Computing, vol. 35, pp. B149-175, 2013.
+       </li>
+
+       <li> D. Devaud
+         <br>
+         <strong>Adaptive Methods for the Stokes System with Discontinuous Viscosities
+         </strong>
+         <br>
+          MSc thesis, EPFL, 2013.
+       </li>
+
+       <li> T. Dohnal, W. D&ouml;rfler
+         <br>
+         <strong>Coupled Mode Equation Modeling for Out-of-Plane Gap
+         Solitons in 2D Photonic Crystals</strong>
+         <br>
+         Multiscale Modeling and Simulation, vol. 11, pp. 162-191, 2013.
+       </li>
+
+       <li> I. Donev
+         <br>
+         <strong>Time Dependent Finite Element Simulations of a Generalized Oldroyd-B Fluid
+         </strong>
+         <br>
+          MSc Thesis, University of Cape Town, 2013.
+       </li>
+
        <li> W. D&ouml;rfler, S. Findeisen
          <br>
          <strong>Numerical optimization of a waveguide transition
           Communications in Computational Physics, accepted, 2013.
        </li>
 
+       <li> E. Emmrich, A. Wr&#243;blewska-Kami&#324;ska
+         <br>
+         <strong>Convergence of a Full Discretization of Quasi-linear Parabolic Equations in Isotropic and Anisotropic Orlicz Spaces
+         </strong>
+         <br>
+          SIAM Journal on Numerical Analysis, vol. 51, pp. 1163-1184, 2013.
+       </li>
+
+       <li> J. Fang, X. Gao, A. Zhou
+         <br>
+         <strong>A finite element recovery approach to eigenvalue
+         approximations with applications to electronic structure
+         calculations
+         </strong>
+         <br>
+         Journal of Scientific Computing, vol. 55, pp. 432-454, 2013.
+       </li>
+
+       <li> A. Geringer, B. Lenhof, S. Diebels
+         <br>
+          <strong>Macroscopic modeling of foams: an order-parameter
+          approach vs. a micropolar model
+          </strong>
+         <br>
+         Technische Mechanik, vol. 33, pp. 87-96, 2013.
+       </li>
+
        <li> F. Gimbel
          <br>
           <strong>Modelling and numerical simulation of contact and lubrication
          arXiv:1303.5362, submitted, 2013.
        </li>
 
+       <li>
+          <a href="http://ganymed.iwr.uni-heidelberg.de/~hartmann/"
+            target="_top">R. Hartmann</a>
+          <br>
+          <strong>Higher-order and adaptive discontinuous Galerkin
+          methods with shock-capturing applied to transonic turbulent
+          delta wing flow
+          </strong>
+          <br>
+          International Journal for Numerical Methods in Fluids,
+          vol. 72, pp. 883-894, 2013.
+        </li>
+
+       <li> T. Heister, G. Rapin
+         <br>
+          <strong>Efficient augmented Lagrangian-type preconditioning
+          for the Oseen problem using Grad-Div stabilization</strong>
+         <br>
+         Int. J. Num. Meth. Fluids, 71, 118–134, 2013
+         (<a href="http://dx.doi.org/10.1002/fld.3654">DOI</a>)
+       </li>
+
        <li> M. Hinze, U. Mathes
           <br>
           <strong>Model order reduction for networks of ODE and PDE systems
           pp 92-101, 2013.
         </li>
 
+       <li> S. Joshi, J, Walton
+          <br>
+          <strong>Reconstruction of the residual stresses in a hyperelastic body using ultrasound techniques
+          </strong>
+          <br>
+         International Journal on Engineering Science, vol. 70,
+         pp. 46-72, 2013.
+        </li>
+
        <li> T. Kr&uuml;ger
          <br>
           <strong>Regularization-based fictitious domain methods
          PhD thesis, University of Siegen, Germany, 2013.
        </li>
 
+       <li> K. Kumar, M.F. Wheeler, T. Wick
+         <br>
+         <strong>Reactive flow in a thin channel
+and reaction-induced boundary movement in
+a monolithic ALE framework
+         </strong>
+         <br>
+         submitted to SISC, 2013.
+        </li>
+
+       <li> B. Lenhof, A. Geringer, S. Diebels
+         <br>
+          <strong>Macroscopic modeling of size effects in foams using
+          an order parameter
+          </strong>
+         <br>
+         Generalized Continua as Models for Materials,
+         Advanced Structured Materials, vol. 22, pp. 237-254, 2013.
+       </li>
+
        <li> S. H. Lim
          <br>
           <strong>Numerical Simulation of Two-phase Heat Flow and Transient
          Undergraduate honors thesis, University of Michigan, Ann Arbor, 2013.
        </li>
 
+       <li> A. Mikelic, M.F. Wheeler, T. Wick
+         <br>
+         <strong>A phase field approach to the fluid filled fracture surrounded by a poroelastic medium
+         </strong>
+         <br>
+         submitted, ICES preprint on http://www.ices.utexas.edu/research/reports/
+        </li>
+
+       <li> A. Mola, L. Heltai, A. DeSimone
+         <br>
+         <strong>A stable and adaptive semi-Lagrangian potential
+         model for unsteady and nonlinear ship-wave
+         interactions</strong>
+         <br>
+         Engineering Analysis with Boundary Elements, vol. 37,
+         pp. 128-143, 2013.
+       </li>
+
        <li> R. H. Nochetto, A. J. Salgado, I. Tomas
          <br>
          <strong>The micropolar Navier-Stokes equations: A priori error analysis</strong>
          arXiv:1303.7005, submitted, 2013.
        </li>
 
+       <li> T. Povall
+         <br>
+         <strong>Single Crystal Plasticity at Finite Strains: A Computational Investigation of Hardening Relations</strong>
+         <br>
+         MSc Thesis, University of Cape Town, 2013.
+       </li>
+
+       <li> T. Richter, T. Wick
+         <br>
+         <strong>Optimal Control and Parameter Estimation for Stationary Fluid-Structure Interaction Problems
+         </strong>
+         <br>
+         SISC, accepted in May, 2013.
+        </li>
+
        <li> S. Roy, L. Heltai, D. Drapaca, F. Costanzo
          <br>
          <strong>An immersed finite element method approach for brain biomechanics</strong>
          (eds.), Spinger Verlag, pp. 293-303, 2013.
         </li>
 
+       <li> M. Sagebaum, N. R. Gauger, U. Naumann, J. Lotz, K. Leppkes
+         <br>
+         <strong>Algorithmic differentiation of a complex C++ code with underlying libraries
+         </strong>
+         <br>
+        Procedia Computer Science, vol. 18, pp. 208-217, 2013.
+        </li>
+
+       <li> P. Siehr
+         <br>
+         <strong>Stabilisierungsmethoden für die Stokes-Gleichungen
+         </strong>
+         <br>
+         Bachelor thesis, University of Heidelberg, Germany, 2013.
+        </li>
+
+       <li>
+          M. Steigemann, B. Schramm
+         <br>
+         <strong>Precise computation and error control of stress
+         intensity factors and certain integral characteristics in
+         anisotropic inhomogeneous materials
+         </strong>
+         <br>
+         International Journal of Fracture, vol. 182, pp. 67-91, 2013.
+        </li>
+
+       <li> M. Stoll, T. Breiten
+         <br>
+         <strong>A low-rank in time approach to PDE-constrained optimization</strong>
+         <br>
+         Max Planck Institute Magdeburg, Preprint MPIMD/13-08, 2013.
+       </li>
+
        <li> N. Vakulin, R. Shaw, T. Livingston
          <br>
          <strong>ELEC 490, final report: High performance computing with GPUs
          2013
         </li>
 
+       <li> A. Vidal-Ferrandiz, R. Fayez, D. Ginestar, G. Verd&uacute;
+         <br>
+         <strong>Solution of the Lambda modes problem of a nuclear
+         power reactor using an h-p finite element method
+         </strong>
+         <br>
+         Conference abstract, Mathematical Modelling in Engineering &
+         Human Behaviour 2013, 2013.
+        </li>
+
+       <li> T. Wick, A. H. Elsheikh, M.F. Wheeler
+         <br>
+         <strong>Parameter Estimation for the Coupled Biot-Lam\'e-Navier Problem in Subsurface Modeling
+         </strong>
+         <br>
+         ARMA Conference in San Francisco, Jun 23-26, 2013.
+        </li>
+
+       <li> J. Weinbub, K. Rupp, S. Selberherr
+         <br>
+         <strong>ViennaX: a parallel plugin execution framework for
+         scientific computing
+         </strong>
+         <br>
+         Engineering with Computers, DOI 10.1007/s00366-013-0314-1, February 2013.
+        </li>
+
+       <li> T. Wick
+         <br>
+         <strong>Flapping and Contact FSI Computations with the
+  Fluid-Solid Interface-Tracking/Interface-Capturing Technique
+  and Mesh Adaptivity
+         </strong>
+         <br>
+         Comp. Mech., DOI: 10.1007/s00466-013-0890-3, 2013.
+        </li>
+
+       <li> T. Wick
+         <br>
+         <strong>Coupling of fully Eulerian and arbitrary Lagrangian-Eulerian
+  methods for fluid-structure interaction computations
+         </strong>
+         <br>
+         Comp. Mech., DOI: 10.1007/s00466-013-0866-3, 2013.
+        </li>
+
+       <li> T. Wick
+         <br>
+         <strong>Solving monolithic fluid-structure interaction
+  problems in arbitrary
+  Lagrangian Eulerian coordinates
+  with the deal.II library
+         </strong>
+         <br>
+         ANS, vol. 1, pp. 1-19, 2013. http://www.archnumsoft.org/
+        </li>
+
+       <li> T. Wick
+         <br>
+         <strong>Fully Eulerian fluid-structure interaction for time-dependent problems
+         </strong>
+         <br>
+         Comp. Methods Appl. Mech. Engrg., vol. 255, pp. 14-26, 2013.
+        </li>
+
+       <li> J. Willems
+         <br>
+          <strong>Robust Multilevel Solvers for High-Contrast Anisotropic
+            Multiscale Problems
+          </strong>
+         <br>
+         Journal of Computational and Applied Mathematics, 251:47-60, 2013, doi:10.1016/j.cam.2013.03.030.
+       </li>
+
+       <li> J. Willems
+         <br>
+          <strong>Spectral Coarse Spaces in Robust Two-Level Schwartz Methods
+          </strong>
+         <br>
+         O. Iliev, S. Margenov, P. Minev, P. Vassilevski, L. Zikatanov, editors, Numerical Solution of Partial Differential Equations: Theory, Algorithms and their Applications, 303-326, Springer Proceedings in Mathematics & Statistics, Springer, 2013.
+       </li>
+
        <li> S. Yoon, Y. T. Kang
          <br>
          <strong>Mass transfer enhancement in non-Brownian particle
          <!-- http://www-m1.ma.tum.de/bin/view/Lehrstuhl/PublikationenUlbrich -->
        </li>
 
-       <li> A. Bonito, I. Kyza, R. H. Nochetto
-         <br>
-         <strong>Time-discrete higher order ALE formulations: a
-           priori error analysis</strong>
-         <br>
-         Numer. Math., to appear, 2012.
-       </li>
-
-       <li> A. Bonito, I. Kyza, R. H. Nochetto
-         <br>
-         <strong>Time-discrete higher order ALE formulations: stability</strong>
-         <br>
-         SIAM J. Numer. Anal., to appear, 2012.
-       </li>
-
        <li>
           M. Braack, G. Lube, L. R&ouml;he
          <br>
          PhD Thesis, Karlsruhe Institute of Technology (KIT), 2012.
        </li>
 
-       <li> A. Cangiani, J. Chapman, E. Georgoulis, M. Jensen
-         <br>
-         <strong>Implementation of the Continuous-Discontinuous
-           Galerkin Finite Element Method</strong>
-         <br>
-         arXiv:1201.2878v1 [math.NA], 2012.
-         <!-- http://www2.le.ac.uk/departments/mathematics/extranet/staff-material/staff-profiles/eg64/publications  -->
-         <!-- http://arxiv.org/abs/1201.2878 -->
-       </li>
-
        <li> A. Cangiani, J. Chapman, E. Georgoulis, M. Jensen
          <br>
          <strong>On Local Super-Penalization of Interior Penalty Discontinuous Galerkin Methods</strong>
          Electrochimica Acta, Volume 77, pp. 309-314, 2012.
        </li>
 
-       <li> C.-C. Chueh, N. Djilali, W. Bangerth
-         <br>
-         <strong>An h-adaptive Operator Splitting Method for
-           Two-phase Flow in 3D Heterogeneous Porous Media</strong>
-         <br>
-         Preprint, Institute for Applied Mathematics and
-         Computational Science, Texas A&amp;M University, 2012.
-       </li>
-
        <li> A. Demlow, A. H. Georgoulis
          <br>
          <strong>Pointwise a posteriori error control for
          Journal of the Electrochemical Society, 159(5), B1-B10, 2012.
        </li>
 
-       <li> T. Dohnal, W. D&ouml;rfler
-         <br>
-         <strong>Coupled Mode Equation Modeling for Out-of-Plane Gap
-         Solitons in 2D Photonic Crystals</strong>
-         <br>
-         arXiv:1202.3583v1 [nlin.PS], 2012.
-       </li>
-
        <li> Y. Efendiev, J. Galvis, R. Lazarov, J. Willems
          <br>
          <strong>Robust domain decomposition preconditioners for abstract
          Journal of Computational Physics, vol. 231, pp. 3166–3180, 2012.
        </li>
 
-       <li> J. Fang, X. Gao, A. Zhou
-         <br>
-         <strong>A finite element recovery approach to eigenvalue
-         approximations with applications to electronic structure
-         calculations
-         </strong>
-         <br>
-         Journal of Scientific Computing, in press, 2012.
-         <!-- http://link.springer.com/article/10.1007/s10915-012-9640-5?LI=true# -->
-       </li>
-
        <li> T. Fankhauser
           <br>
           <strong>An hp-adaptive strategy based on smoothness
           Submitted to ACM Trans. Math. Softw., 2011.
         </li>
 
+       <li> C. Goll, T. Wick, W. Wollner
+         <br>
+         <strong>DOpElib: Differential Equations and Optimization Environment;
+A Goal Oriented Software Library for Solving PDEs and Optimization Problems with PDEs
+         </strong>
+         <br>
+         submitted in Dec 2012.
+        </li>
+
        <li> N. Gupta, N. Nataraj
           <br>
           <strong>A posteriori error estimates for an optimal control
           Springer. In press.
        </li>
 
-       <li> T. Heister, G. Rapin
-         <br>
-          <strong>Efficient augmented Lagrangian-type preconditioning
-          for the Oseen problem using Grad-Div stabilization</strong>
-         <br>
-         Int. J. Num. Meth. Fluids, 2013, 71, 118–134.
-         (<a href="http://dx.doi.org/10.1002/fld.3654">DOI</a>)
-       </li>
-
        <li> L. Heltai, S. Roy, F. Costanzo
          <br>
          <strong>A Fully Coupled Immersed Finite Element Method for
           Journal of the Mechanics and Physics of Solids, vol. 60, pp. 1221-1239, 2012.
         </li>
 
-       <li> A. Mola, L. Heltai, A. DeSimone
-         <br>
-         <strong>A stable and adaptive semi-Lagrangian potential
-         model for unsteady and nonlinear ship-wave
-         interactions</strong>
-         <br>
-         arXiv:1203.3384v1 [math.NA], 2012.
-       </li>
-
        <li> C. Neuen, M. Griebel, J. Hamaekers
           <br>
           <strong>Multiscale simulation of ion migration for battery system
           50<sup>th</sup> AIAA Aerospace Sciences Meeting, AIAA 2012-458, 2012.
        </li>
 
-       <li> J. Willems
-         <br>
-          <strong>Robust multilevel methods for general symmetric positive
-          definite operators
-          </strong>
-         <br>
-         RICAM Report 2012-06, 2012.
-       </li>
 
-       <li> J. Willems
-         <br>
-          <strong>Robust multilevel methods for high-contrast anisotropic
-            multiscale problems
-          </strong>
+       <li> T. Wick
+         <br>
+         <strong>Goal-oriented mesh adaptivity for fluid-structure interaction with application to heart-valve settings
+         </strong>
          <br>
-         RICAM Report 2012-07, 2012.
-       </li>
+         Arch. Mech. Engrg., vol. 59, pp. 73-99, 2012.
+        </li>
+
+
 
        <li> J. Willems
          <br>
-          <strong>Spectral coarse spaces in robust two-level methods
+          <strong>Robust multilevel methods for general symmetric positive
+          definite operators
           </strong>
          <br>
-         RICAM Report 2012-20, 2012.
+         RICAM Report 2012-06, 2012.
        </li>
 
        <li> S. Yoon, M. A. Walkley, O. G. Harlen
          Comp. Geosc., vol. 15, pp. 647-659, 2011.
         </li>
 
-       <li> T. Wick
-         <br>
-          <strong>Fluid-Structure Interaction based on Monolithic Variational
-           Formulations with Different Types of Pseudo-Structure Extension
-          </strong>
-         <br>
-         submitted, 2010
-       </li>
-
        <li> T. Wick
          <br>
           <strong>Fluid-structure interactions using different mesh motion techniques
          Computers and Structures, vol. 89, pp. 1456-1467, 2011.
        </li>
 
-       <li> T. Wick
-         <br>
-          <strong>Solving Monolithic Fluid-Structure Interaction Problems in
-            Arbitrary Lagrangian Eulerian Coordinates with the deal.II Library
-          </strong>
-         <br>
-         IWR Report, University of Heidelberg, Germany, 2011.
-       </li>
-
        <li> T. Wick
          <br>
           <strong>Adaptive finite element simulation of fluid-structure
          Diploma Thesis, University of Heidelberg, Germany, 2010
        </li>
 
-       <li>
-          T. Wick
-         <br>
-         <strong>Monolithic Fluid-Structure Interaction Modelling for
-           a Long Axis Heart Valve Simulation
-         </strong>
-         <br>
-         Preprint, IWR Heidelberg, Germany, 2010
-        </li>
-
        <li> <a href="http://www.ippt.gov.pl/~tyoung"
                target="_top">T. D. Young</a>, R. Armiento
          <Br>
index e80ebdac835a1af1f00d4d339c1c5b66cb4cb468..46a57e77da6d82274c2c7155b4da59cc3e1b325f 100644 (file)
        mkdir build
        cd build
        cmake -DCMAKE_INSTALL_PREFIX=/path/install/dir ../deal.II
-       make
        make install
       </pre>
       These steps compile, link and install the deal.II library. The
        <li> <code>/path/install/dir</code> is the directory which deal.II
          should be installed into. This can be a directory in your home
          directory (e.g., <code>~/bin/deal.II</code>) or a directory
-         such as <code>/usr/local</code> if you have root privileges.
+         such as <code>/usr/local</code> if you have root privileges. 
+         Another option is to use <code>`pwd`/../installed/</code> (note the
+         backticks).
 
        <li> If your machine has multiple processors, use <code>make
-         -jN</code> in the last two steps, where <code>N</code> is the
+         -jN</code> in the last step, where <code>N</code> is the
          number of simultaneous build processes you want <code>make</code>
          to use at any given time. Allowing <code>make</code> to use
          more simultaneous build processes (assuming you have that many
       paths.</b>
       However, this behavior can be changed using command line switches to
       the initial call to <code>cmake</code>. A detailed description
-      can be found <a href="development/cmake.html">here</a>.
+      can be found here: <a href="development/cmake.html">Detailed build system description</a>.
     </p>
 
     <p>
           <code>-DDEAL_II_COMPONENT_PARAMETER_GUI=ON</code>. Beware of the
           fact that <code>parameter_gui</code> needs development packages for Qt.
        </p>
+
+      <li>
+  <p>
+    <i>64bit indices</i>: By default, deal.II use unsigned int (32bit)
+    indices for degrees of freedom, using
+    the <code>types::global_dof_index</code> type. This limits the number of
+    unknowns to approximately four 
+    billions. If larger problem must be solved, pass the
+    <code>-DDEAL_II_WITH_64BIT_INDICES=ON</code> argument to
+    <code>cmake</code>. You will not be able to solve problems of this size on
+    a single machine, but only when using clusters of computers and linear
+    algebra packages PETSc or Trilinos.
+    To use this option with PETSc, PESTc must be compiled
+    with the option <code>--with-64-bit-indices</code>. To use this option
+    with Trilinos, Trilinos 11.2 or later is needed (there is a bug in
+    Trilinos 11.0 that prevents the use of 64bit indices).
+  </p>
+
     </ul>
 
 
           scale eigenvalue problems.
           <a href="http://www.caam.rice.edu/software/ARPACK/" target="_top">ARPACK</a>
           should be readily packaged by most Linux distributions.
-          (Don't forget to install a develpment version of the library).
+          (Don't forget to install a development version of the library).
           To use a self compiled version, specify
           <code>-DARPACK_DIR=/path/to/arpack</code> on the command line.
 
           matrices.
           Both libraries should be packaged by almost all Linux
           distributions and found automatically whenever available.
-          (You might have to install develpment versions of the libraries
+          (You might have to install development versions of the libraries
           for <acronym>deal.II</acronym> being able to use them).
           For details on how to set up <acronym>deal.II</acronym> with a
           non standard BLAS/LAPACK implementation, see the
          format.
          <a href="http://www.hdfgroup.org/HDF5/">HDF5</a> should be
          readily packaged by most Linux distributions.  (Don't forget
-          to install a develpment version of the library).
+          to install a development version of the library).
          To use a self compiled version, specify
          <code>-DHDF5_DIR=/path/to/hdf5</code> on the command line.
        </p>
          across nodes of a cluster.
          <a href="http://mumps.enseeiht.fr" target="_top">MUMPS</a>
           should be readily packaged by most Linux distributions.
-          (Don't forget to install a develpment version of the library).
+          (Don't forget to install a development version of the library).
           To use a self compiled version, provide the
          <code>-DMUMPS_DIR=/path/to/mumps</code> argument to <code>cmake</code>.
          For a detailed description on how to compile MUMPS (and
           one of the functions of the <code>GridIn</code> class.
          <a href="http://www.unidata.ucar.edu/software/netcdf/"
           target="_top">NetCDF</a> should be readily packaged by most
-          Linux distributions. (Don't forget to install a develpment
+          Linux distributions. (Don't forget to install a development
          version of the library). To use a self compiled version, pass
          <code>-DNETCDF_DIR=/path/to/netcdf</code> to <code>cmake</code>.
       </dd>
          <a href="http://www.mcs.anl.gov/petsc/" target="_top">PETSc</a>
          is already packaged by some Linux distributions and should be
          found automatically if present. (Don't forget to install a
-         develpment version of the library).  To use a self compiled
+         development version of the library).  To use a self compiled
          version of PETSc, add <code>-DPETSC_DIR=/path/to/petsc
          -DPETSC_ARCH=architecture</code> to the argument list for
          <code>cmake</code>. The values for these arguments must be
index 2f000368c2e22c0c7882462c20cceb1d2b204158..3655a42bf1df2155ef44e5e6452e2281f9862f44 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 IF(DEAL_II_COMPONENT_EXAMPLES)
   INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
index 9bd247f98fe070566df69ccdae41b534b781564a..6a38408631649d0e1a3457514e19f043f7102373 100644 (file)
@@ -1,13 +1,19 @@
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005-2006, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be distributed without copyright
-//    and license information. Please refer to the file
-//    deal.II/doc/license.html for the text and further information on this
-//    license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 // See documentation of BlockMatrixArray for documentation of this example
 
index f7a894dbc8b385ef45ef3ce6a07bfe1a05278b12..65b9386800e3144fbcea1115f9ef8f1572961fdf 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006-2007 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 // See documentation of BlockCompressedSparsityPattern for documentation of this example
 
index 6a2012ed147aaf3c38a5b76a8299611f5155ddee..b3487b5925a84448dececc16bd6894b8d28cade5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005-2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be distributed without copyright
-//    and license information. Please refer to the file
-//    deal.II/doc/license.html for the text and further information on this
-//    license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 // See documentation of ProductMatrix for documentation of this example
 
index f0900ba50ad1013070fa77bb135470bc7b112daa..94871bd102ed752f9a3811784b0c20a6c2049c5b 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005-2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 // See documentation of ThetaTimestepping for documentation of this example
 
index 26f93aa863d4b776ffade41d3b267f57bb57675c..c887721bed9fd48301f2e1cb03dd8035f225f549 100644 (file)
@@ -1,12 +1,19 @@
-/* $Id$
- *
- * Copyright (C) 1999-2003, 2005-2007, 2009, 2011-2013 by the deal.II authors
- *
- * This file is subject to QPL and may not be  distributed
- * without copyright and license information. Please refer
- * to the file deal.II/doc/license.html for the  text  and
- * further information on this license.
- */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1999 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 // @sect3{Include files}
 
index d9bf4843a7d9b029f2533ea638b6f7a2fe6584be..ca6507013b7eb4eddd55a04dbe8fe6bf4ed17041 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, Ralf Hartmann, University of Heidelberg, 2001 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2001-2004, 2006-2007, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2001 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Wolfgang Bangerth, Ralf Hartmann, University of Heidelberg, 2001
+ */
+
 
 // The first of the following include files are probably well-known by now and
 // need no further explanation.
index d27b6d1fda2f910db1992a7a6d9bfd8ef9098b58..c4f76476463b2180aca8ae98b38123cf29e6d8f7 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 2001 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2001-2004, 2006, 2009, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2001 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 2001
+ */
+
 
 // As usual, the program starts with a rather long list of include files which
 // you are probably already used to by now:
index 2ad4fc7d51f84fa30d255f1bd75b626aa53721dc..e50de11a6f7f7ad27cf670f539e5acf5c968c6f8 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Guido Kanschat, Texas A&M University, 2009 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2010-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2009 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Guido Kanschat, Texas A&M University, 2009
+ */
+
 
 // The first few files have already been covered in previous examples and will
 // thus not be further commented on:
index 054b3b5f79658cae0041cd4e7225fda1cd857db7..4334e9053420051b620017546e840b93d185cf93 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 2001, 2002 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2001-2004, 2006-2009, 2011-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2001 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 2001, 2002
+ */
 
 
 // As in all programs, we start with a list of include files from the library,
@@ -765,7 +774,7 @@ namespace Step13
       // And while we're already computing things in parallel, interpolating
       // boundary values is one more thing that can be done independently, so
       // we do it here:
-      std::map<unsigned int,double> boundary_value_map;
+      std::map<types::global_dof_index,double> boundary_value_map;
       VectorTools::interpolate_boundary_values (dof_handler,
                                                 0,
                                                 *boundary_values,
@@ -807,7 +816,7 @@ namespace Step13
 
       FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
 
-      std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+      std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
       for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
            cell!=end_cell; ++cell)
@@ -1026,7 +1035,7 @@ namespace Step13
 
       Vector<double>       cell_rhs (dofs_per_cell);
       std::vector<double>  rhs_values (n_q_points);
-      std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+      std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
       typename DoFHandler<dim>::active_cell_iterator
       cell = this->dof_handler.begin_active(),
index 9536e7d82c1715699e6fe37f19b787b450d2fe6e..a8e28833684f4ca10582418a9fe2f7fce144aa70 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Wolfgang Bangerth, ETH Zurich, 2002 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2002-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2002 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, ETH Zurich, 2002
+ */
 
 
 // Start out with well known things...
@@ -554,7 +563,7 @@ namespace Step14
       assemble_rhs (linear_system.rhs);
       linear_system.hanging_node_constraints.condense (linear_system.rhs);
 
-      std::map<unsigned int,double> boundary_value_map;
+      std::map<types::global_dof_index,double> boundary_value_map;
       VectorTools::interpolate_boundary_values (dof_handler,
                                                 0,
                                                 *boundary_values,
@@ -585,7 +594,7 @@ namespace Step14
 
       FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
 
-      std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+      std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
       for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
            cell!=end_cell; ++cell)
@@ -806,7 +815,7 @@ namespace Step14
 
       Vector<double>       cell_rhs (dofs_per_cell);
       std::vector<double>  rhs_values (n_q_points);
-      std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+      std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
       typename DoFHandler<dim>::active_cell_iterator
       cell = this->dof_handler.begin_active(),
index 098be10b69029422bce32154525b176040996c35..4ec576c051bbdb561fa3f861b40350265e123094 100644 (file)
@@ -1,14 +1,23 @@
-/* $Id$ */
-/* Author: Sven Wetterauer, University of Heidelberg, 2012 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2012 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Sven Wetterauer, University of Heidelberg, 2012
+ */
+
 
 // @sect3{Include files}
 
@@ -243,7 +252,7 @@ namespace Step15
 
     std::vector<Tensor<1, dim> > old_solution_gradients(n_q_points);
 
-    std::vector<unsigned int>    local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index>    local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
@@ -323,7 +332,7 @@ namespace Step15
     hanging_node_constraints.condense (system_matrix);
     hanging_node_constraints.condense (system_rhs);
 
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
                                               0,
                                               ZeroFunction<dim>(),
@@ -464,12 +473,12 @@ namespace Step15
   template <int dim>
   void MinimalSurfaceProblem<dim>::set_boundary_values ()
   {
-    std::map<unsigned int, double> boundary_values;
+    std::map<types::global_dof_index, double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
                                               0,
                                               BoundaryValues<dim>(),
                                               boundary_values);
-    for (std::map<unsigned int, double>::const_iterator
+    for (std::map<types::global_dof_index, double>::const_iterator
          p = boundary_values.begin();
          p != boundary_values.end(); ++p)
       present_solution(p->first) = p->second;
@@ -514,7 +523,7 @@ namespace Step15
     Vector<double>               cell_rhs (dofs_per_cell);
     std::vector<Tensor<1, dim> > gradients(n_q_points);
 
-    std::vector<unsigned int>    local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index>    local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
index 8ebda662544baea6333d7950d4c701298a6708bf..81e5ff040d8c89f69e44eca0b8c4cf3017fdc104 100644 (file)
@@ -1,15 +1,25 @@
-/* Author: Guido Kanschat, University of Heidelberg, 2003  */
-/*         Baerbel Janssen, University of Heidelberg, 2010 */
-/*         Wolfgang Bangerth, Texas A&M University, 2010   */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2003-2004, 2006-2013 by the deal.II authors                   */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2003 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Guido Kanschat, University of Heidelberg, 2003
+ *          Baerbel Janssen, University of Heidelberg, 2010
+ *          Wolfgang Bangerth, Texas A&M University, 2010
+ */
+
 
 // As discussed in the introduction, most of this program is copied almost
 // verbatim from step-6, which itself is only a slight modification of
@@ -367,7 +377,7 @@ namespace Step16
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const Coefficient<dim> coefficient;
     std::vector<double>    coefficient_values (n_q_points);
@@ -433,7 +443,7 @@ namespace Step16
 
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const Coefficient<dim> coefficient;
     std::vector<double>    coefficient_values (n_q_points);
index 9f7f7c6b14b0cf7d7cdc100097c0c9ae955e8bad..43e274a2b6590d05c8dadf5ab6fdd592bb537cd4 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Wolfgang Bangerth, University of Texas at Austin, 2000, 2004 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2000, 2004-2009, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2000 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Texas at Austin, 2000, 2004
+ */
 
 
 // First the usual assortment of header files we have already used in previous
@@ -298,7 +307,7 @@ namespace Step17
 
     // While we're at it, let us also count how many degrees of freedom there
     // exist on the present process:
-    const unsigned int n_local_dofs
+    const types::global_dof_index n_local_dofs
       = DoFTools::count_dofs_with_subdomain_association (dof_handler,
                                                          this_mpi_process);
 
@@ -390,7 +399,7 @@ namespace Step17
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     std::vector<double>     lambda_values (n_q_points);
     std::vector<double>     mu_values (n_q_points);
@@ -503,8 +512,8 @@ namespace Step17
           cell->get_dof_indices (local_dof_indices);
           hanging_node_constraints
           .distribute_local_to_global(cell_matrix, cell_rhs,
-                                       local_dof_indices,
-                                       system_matrix, system_rhs);
+                                      local_dof_indices,
+                                      system_matrix, system_rhs);
         }
 
     // Now compress the vector and the system matrix:
@@ -517,7 +526,7 @@ namespace Step17
     //
     // However, we still have to apply boundary values, in the same way as we
     // always do:
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
                                               0,
                                               ZeroFunction<dim>(dim),
index 607d760ecb0b4d046d093f92ce85482202aff46b..34ed6cb2804532eab83ae86640da02efe0d21d24 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Wolfgang Bangerth, University of Texas at Austin, 2000, 2004, 2005 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2000, 2004-2009, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2000 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Texas at Austin, 2000, 2004, 2005
+ */
 
 
 // First the usual list of header files that have already been used in
@@ -512,12 +521,12 @@ namespace Step18
 
     // Here is a vector where each entry denotes the numbers of degrees of
     // freedom that are stored on the processor with that particular number:
-    std::vector<unsigned int> local_dofs_per_process;
+    std::vector<types::global_dof_index> local_dofs_per_process;
 
     // Next, how many degrees of freedom the present processor stores. This
     // is, of course, an abbreviation to
     // <code>local_dofs_per_process[this_mpi_process]</code>.
-    unsigned int         n_local_dofs;
+    types::global_dof_index n_local_dofs;
 
     // In the same direction, also cache how many cells the present processor
     // owns. Note that the cells that belong to a processor are not
@@ -1050,7 +1059,7 @@ namespace Step18
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     BodyForce<dim>      body_force;
     std::vector<Vector<double> > body_force_values (n_q_points,
@@ -1135,16 +1144,16 @@ namespace Step18
           cell->get_dof_indices (local_dof_indices);
 
           hanging_node_constraints
-           .distribute_local_to_global (cell_matrix, cell_rhs,
+          .distribute_local_to_global (cell_matrix, cell_rhs,
                                        local_dof_indices,
-                                        system_matrix, system_rhs);
+                                       system_matrix, system_rhs);
         }
 
     // Now compress the vector and the system matrix:
     system_matrix.compress(VectorOperation::add);
     system_rhs.compress(VectorOperation::add);
 
-    
+
     // The last step is to again fix up boundary values, just as we already
     // did in previous programs. A slight complication is that the
     // <code>apply_boundary_values</code> function wants to have a solution
@@ -1182,7 +1191,7 @@ namespace Step18
     // for each vector component and because we only want to restrict vertical
     // motion, it has only its last component set:
     FEValuesExtractors::Scalar z_component (dim-1);
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     VectorTools::
     interpolate_boundary_values (dof_handler,
                                  0,
index cac451597df058c0701837513144193c4b26ea28..6f8b6672813a036be25ba926e40c5db64a92e7b8 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Luca Heltai, Wolfgang Bangerth, 2005 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2005-2006, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2005 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Luca Heltai, Wolfgang Bangerth, 2005
+ */
 
 
 // @sect4{Preliminaries}
index ad6fd4a15e8b22d78a00ca328edffe7939979949..1747f1db35bbe23334fced98d8e9738b2ea32b61 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 1999 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 1999-2003, 2006, 2008-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1999 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 1999
+ */
+
 
 // The first few includes are just like in the previous program, so do not
 // require additional comments:
index cea600c2d711f159789066b84b00eb4719d6869b..e71fa739e89d119f2855e44789578f61526282f2 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, Texas A&M University, 2005, 2006 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2005 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, Texas A&M University, 2005, 2006
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2005-2008, 2010-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -330,7 +340,7 @@ namespace Step20
     // of pressure variables equals the number of shape functions that are
     // nonzero in the dim-th component. Let us compute these numbers and then
     // create some nice output with that:
-    std::vector<unsigned int> dofs_per_component (dim+1);
+    std::vector<types::global_dof_index> dofs_per_component (dim+1);
     DoFTools::count_dofs_per_component (dof_handler, dofs_per_component);
     const unsigned int n_u = dofs_per_component[0],
                        n_p = dofs_per_component[dim];
@@ -422,7 +432,7 @@ namespace Step20
     FullMatrix<double>   local_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       local_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     // The next step is to declare objects that represent the source term,
     // pressure boundary value, and coefficient in the equation. In addition
index bd22cb396b6ba03462f2080f133417adc109193a..fbf4aee19ea2a38a83bcdbc0323be632ea36a5e8 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Yan Li, Wolfgang Bangerth, Texas A&M University, 2006 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Yan Li, Wolfgang Bangerth, Texas A&M University, 2006
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2006-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // This program is an adaptation of step-20 and includes some technique of DG
 // methods from step-12. A good part of the program is therefore very similar
@@ -477,7 +487,7 @@ namespace Step21
   void InverseMatrix<Matrix>::vmult (Vector<double>       &dst,
                                      const Vector<double> &src) const
   {
-    SolverControl solver_control (std::max(src.size(), 200U),
+    SolverControl solver_control (std::max(src.size(), static_cast<std::size_t> (200)),
                                   1e-8*src.l2_norm());
     SolverCG<>    cg (solver_control);
 
@@ -606,7 +616,7 @@ namespace Step21
     dof_handler.distribute_dofs (fe);
     DoFRenumbering::component_wise (dof_handler);
 
-    std::vector<unsigned int> dofs_per_component (dim+2);
+    std::vector<types::global_dof_index> dofs_per_component (dim+2);
     DoFTools::count_dofs_per_component (dof_handler, dofs_per_component);
     const unsigned int n_u = dofs_per_component[0],
                        n_p = dofs_per_component[dim],
@@ -704,7 +714,7 @@ namespace Step21
     FullMatrix<double>   local_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       local_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const PressureRightHandSide<dim>  pressure_right_hand_side;
     const PressureBoundaryValues<dim> pressure_boundary_values;
@@ -863,7 +873,7 @@ namespace Step21
     std::vector<Vector<double> > present_solution_values_face(n_face_q_points, Vector<double>(dim+2));
 
     std::vector<double> neighbor_saturation (n_face_q_points);
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     SaturationBoundaryValues<dim> saturation_boundary_values;
 
index 3e8f8563b5c2d9d0b6f358e1e9a8f4a863f4c911..1fcf3b5a3bf45c4b3def363ffb897f3d19560e71 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Wolfgang Bangerth, Texas A&M University, 2008 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2008-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2008 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, Texas A&M University, 2008
+ */
 
 
 // @sect3{Include files}
@@ -481,7 +490,7 @@ namespace Step22
     // <code>DoFTools::count_dofs_per_block</code> does the same as
     // <code>DoFTools::count_dofs_per_component</code>, but now grouped as
     // velocity and pressure block via <code>block_component</code>.
-    std::vector<unsigned int> dofs_per_block (2);
+    std::vector<types::global_dof_index> dofs_per_block (2);
     DoFTools::count_dofs_per_block (dof_handler, dofs_per_block, block_component);
     const unsigned int n_u = dofs_per_block[0],
                        n_p = dofs_per_block[1];
@@ -593,7 +602,7 @@ namespace Step22
     FullMatrix<double>   local_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       local_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const RightHandSide<dim>          right_hand_side;
     std::vector<Vector<double> >      rhs_values (n_q_points,
index b8c35a0eb01130afad141a75ba063bf8757c2e3c..628f840f7aebcfdfa72ec0907668049c31aeed94 100644 (file)
@@ -1,14 +1,22 @@
-/* Author: Wolfgang Bangerth, Texas A&M University, 2006 */
-
-/*    $Id$       */
-/*    Version: $Name:  $                                          */
-/*                                                                */
-/*    Copyright (C) 2006-2009, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, Texas A&M University, 2006
+ */
 
 
 // @sect3{Include files}
@@ -542,7 +550,7 @@ namespace Step23
           BoundaryValuesU<dim> boundary_values_u_function;
           boundary_values_u_function.set_time (time);
 
-          std::map<unsigned int,double> boundary_values;
+          std::map<types::global_dof_index,double> boundary_values;
           VectorTools::interpolate_boundary_values (dof_handler,
                                                     0,
                                                     boundary_values_u_function,
@@ -588,7 +596,7 @@ namespace Step23
           BoundaryValuesV<dim> boundary_values_v_function;
           boundary_values_v_function.set_time (time);
 
-          std::map<unsigned int,double> boundary_values;
+          std::map<types::global_dof_index,double> boundary_values;
           VectorTools::interpolate_boundary_values (dof_handler,
                                                     0,
                                                     boundary_values_v_function,
index 45b3871515f6883f0a6e019a4656ff2f7c38b6ac..ccf969d74db0bebcf01bf1a8998f1a3150162421 100644 (file)
@@ -1,12 +1,22 @@
-/* Author: Xing Jin, Wolfgang Bangerth, Texas A&M University, 2006 */
-
-/*    $Id$ */
-/*    Copyright (C) 2006-2009, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Xing Jin, Wolfgang Bangerth, Texas A&M University, 2006
+ */
 
 
 // @sect3{Include files}
@@ -346,7 +356,7 @@ namespace Step24
 
       FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
 
-      std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+      std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
 
 
index 057371fa19b5dbf715585cfdb176370480eee962..a03335ce3483cb6e628347bbf9f3b008465882bb 100644 (file)
@@ -1,12 +1,22 @@
-/* Author: Ivan Christov, Wolfgang Bangerth, Texas A&M University, 2006 */
-
-/*    $Id$ */
-/*    Copyright (C) 2006-2009, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the text and       */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Ivan Christov, Wolfgang Bangerth, Texas A&M University, 2006
+ */
 
 
 // @sect3{Include files and global variables}
@@ -413,7 +423,7 @@ namespace Step25
     const unsigned int n_q_points    = quadrature_formula.size();
 
     Vector<double> local_nl_term (dofs_per_cell);
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     std::vector<double> old_data_values (n_q_points);
     std::vector<double> new_data_values (n_q_points);
 
@@ -475,7 +485,7 @@ namespace Step25
     const unsigned int n_q_points    = quadrature_formula.size();
 
     FullMatrix<double> local_nl_matrix (dofs_per_cell, dofs_per_cell);
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     std::vector<double> old_data_values (n_q_points);
     std::vector<double> new_data_values (n_q_points);
 
index 0d4da01968f0f3377000964b28a2f5cb24d30c21..23c2250e1e8275a1ef7d5df9bf6fcb61b3a3a760 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, Texas A&M University, 2013 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, Texas A&M University, 2013
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/quadrature_lib.h>
@@ -59,7 +69,7 @@ namespace Step26
     void solve_time_step();
     void output_results() const;
     void refine_mesh (const unsigned int min_grid_level,
-                     const unsigned int max_grid_level);
+                      const unsigned int max_grid_level);
 
     Triangulation<dim>   triangulation;
     FE_Q<dim>            fe;
@@ -176,13 +186,13 @@ namespace Step26
     dof_handler.distribute_dofs(fe);
 
     std::cout << std::endl
-             << "==========================================="
-             << std::endl
-             << "Number of active cells: " << triangulation.n_active_cells()
+              << "==========================================="
               << std::endl
-             << "Number of degrees of freedom: " << dof_handler.n_dofs()
+              << "Number of active cells: " << triangulation.n_active_cells()
               << std::endl
-             << std::endl;
+              << "Number of degrees of freedom: " << dof_handler.n_dofs()
+              << std::endl
+              << std::endl;
 
     constraints.clear ();
     DoFTools::make_hanging_node_constraints (dof_handler,
@@ -203,12 +213,12 @@ namespace Step26
     MatrixCreator::create_mass_matrix(dof_handler,
                                       QGauss<dim>(fe.degree+1),
                                       mass_matrix,
-                                      (const Function<dim>*)0,
+                                      (const Function<dim> *)0,
                                       constraints);
     MatrixCreator::create_laplace_matrix(dof_handler,
                                          QGauss<dim>(fe.degree+1),
                                          laplace_matrix,
-                                         (const Function<dim>*)0,
+                                         (const Function<dim> *)0,
                                          constraints);
 
     solution.reinit(dof_handler.n_dofs());
@@ -291,7 +301,7 @@ namespace Step26
   // too high a mesh level.
   template <int dim>
   void HeatEquation<dim>::refine_mesh (const unsigned int min_grid_level,
-                                      const unsigned int max_grid_level)
+                                       const unsigned int max_grid_level)
   {
     Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
@@ -310,8 +320,8 @@ namespace Step26
            cell != triangulation.end(); ++cell)
         cell->clear_refine_flag ();
     for (typename Triangulation<dim>::active_cell_iterator
-           cell = triangulation.begin_active(min_grid_level);
-        cell != triangulation.end_active(min_grid_level); ++cell)
+         cell = triangulation.begin_active(min_grid_level);
+         cell != triangulation.end_active(min_grid_level); ++cell)
       cell->clear_coarsen_flag ();
 
 
@@ -403,8 +413,8 @@ start_time_iteration:
         std::cout << "Time step " << timestep_number << " at t=" << time
                   << std::endl;
 
-       tmp.reinit (solution.size());
-       forcing_terms.reinit (solution.size());
+        tmp.reinit (solution.size());
+        forcing_terms.reinit (solution.size());
 
         mass_matrix.vmult(system_rhs, old_solution);
 
@@ -434,7 +444,7 @@ start_time_iteration:
           BoundaryValues<dim> boundary_values_function;
           boundary_values_function.set_time(time);
 
-          std::map<unsigned int, double> boundary_values;
+          std::map<types::global_dof_index, double> boundary_values;
           VectorTools::interpolate_boundary_values(dof_handler,
                                                    0,
                                                    boundary_values_function,
@@ -458,16 +468,16 @@ start_time_iteration:
             (pre_refinement_step < n_adaptive_pre_refinement_steps))
           {
             refine_mesh (initial_global_refinement,
-                        initial_global_refinement + n_adaptive_pre_refinement_steps);
+                         initial_global_refinement + n_adaptive_pre_refinement_steps);
             ++pre_refinement_step;
 
-           std::cout << std::endl;
+            std::cout << std::endl;
 
             goto start_time_iteration;
           }
         else if ((timestep_number > 0) && (timestep_number % 5 == 0))
           refine_mesh (initial_global_refinement,
-                      initial_global_refinement + n_adaptive_pre_refinement_steps);
+                       initial_global_refinement + n_adaptive_pre_refinement_steps);
 
         old_solution = solution;
       }
index 2ebbd9fa4d02ce320546455c8923e59e112d1fcb..4f9bc6680fb1325e92629c72b11eeec3dcfc1f49 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, Texas A&M University, 2006, 2007 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, Texas A&M University, 2006, 2007
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2006-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -269,7 +279,7 @@ namespace Step27
     FullMatrix<double>   cell_matrix;
     Vector<double>       cell_rhs;
 
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
 
     typename hp::DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
index 049d63568e5c2789781e05f4a73425110413febe..14ac1ba6be43efba83e759e62f512c7eaacdb758 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Yaqi Wang, Texas A&M University, 2009, 2010 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2009 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Yaqi Wang, Texas A&M University, 2009, 2010
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2009-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -492,7 +502,7 @@ namespace Step28
 
     Vector<double>                system_rhs;
 
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     ConstraintMatrix              hanging_node_constraints;
 
 
@@ -667,7 +677,7 @@ namespace Step28
     FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>     cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
@@ -743,7 +753,7 @@ namespace Step28
     std::vector<double>       extraneous_source_values (n_q_points);
     std::vector<double>       solution_old_values (n_q_points);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
@@ -941,7 +951,7 @@ namespace Step28
             prolongation_matrix.Tvmult_add (cell_rhs, tmp);
           }
 
-        std::vector<unsigned int> local_dof_indices (fe.dofs_per_cell);
+        std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
         cell_g->get_dof_indices (local_dof_indices);
 
         for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
@@ -1580,7 +1590,7 @@ namespace Step28
   template <int dim>
   void NeutronDiffusionProblem<dim>::refine_grid ()
   {
-    std::vector<unsigned int> n_cells (parameters.n_groups);
+    std::vector<types::global_dof_index> n_cells (parameters.n_groups);
     for (unsigned int group=0; group<parameters.n_groups; ++group)
       n_cells[group] = energy_groups[group]->n_active_cells();
 
index b97a0558b7bcbf4125278640f1394f0294421846..d955cd261ea8d9f9d410dc10fe9d2827d5ef6f89 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Moritz Allmaras, Texas A&M University, 2007 */
-
-/* $Id$ */
-/*    Copyright (C) 2007-2008, 2010-2012 by the deal.II authors and M. Allmaras   */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the text and       */
-/*    further information on this license.                        */
-
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2007 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Moritz Allmaras, Texas A&M University, 2007
+ */
 
 
 // @sect3{Include files}
@@ -602,7 +611,7 @@ namespace Step29
     // vector to transfer the cell contributions to the appropriate location
     // in the global system matrix after.
     FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
@@ -769,7 +778,7 @@ namespace Step29
     // which is characterized by the boundary indicator 1. The Dirichlet
     // values are provided by the <code>DirichletBoundaryValues</code> class
     // we defined above:
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
                                               1,
                                               DirichletBoundaryValues<dim>(),
index ad3f4abe6452cbef39d532ad5189faf68d0c13fb..6286abe7bc7e08d14118f87e1801ee18078d309a 100644 (file)
@@ -315,4 +315,72 @@ separation of functionality &mdash; again in many of the
 following tutorial programs.
 
 
+<h3> A note on types </h3>
+
+deal.II defines a number of integral %types via <code>typedef</code>s in
+namespace types. In particular, in this program you will see
+types::global_dof_index in a couple of places: an integer type that is used to
+denote the <i>global</i> index of a degree of freedom, i.e., the index of a
+particular degree of freedom within the DoFHandler object that is defined on
+top of a triangulation (as opposed to the index of a particular degree of
+freedom within a particular cell). For the current program
+(as well as almost all of the tutorial programs), you will have a few thousand
+to maybe a few million unknowns globally (and, for $Q_1$ elements, you will
+have 4 <i>locally on each cell</i> in 2d and 8 in 3d). Consequently, a data
+type that allows to store sufficiently large numbers for global DoF indices is
+<code>unsigned int</code> given that it allows to store numbers between 0 and
+slightly more than 4 billion (on most systems, where integers are 32-bit). In
+fact, this is what types::global_dof_index is.
+
+So, why not just use <code>unsigned int</code> right away? deal.II used to do
+this until version 7.3. However, deal.II supports very large computations (via
+the framework discussed in step-40) that may have more than 4 billion unknowns
+when spread across a few thousand processors. Consequently, there are
+situations where <code>unsigned int</code> is not sufficiently large and we
+need a 64-bit unsigned integral type. To make this possible, we introduced
+types::global_dof_index which by default is defined as simply <code>unsigned
+int</code> whereas it is possible to define it as <code>unsigned long long
+int</code> if necessary, by passing a particular flag during configuration
+(see the ReadMe file).
+
+This covers the technical aspect. But there is also a documentation purpose:
+everywhere in the library and codes that are built on it, if you see a place
+using the data type types::global_dof_index, you immediately know that the
+quantity that is being referenced is, in fact, a global dof index. No such
+meaning would be apparent if we had just used <code>unsigned int</code> (which
+may also be a local index, a boundary indicator, a material id,
+etc.). Immediately knowing what a variable refers to also helps avoid errors:
+it's quite clear that there must be a bug if you see an object of type
+types::global_dof_index being assigned to variable of type
+types::subdomain_id, even though they are both represented by unsigned
+integers and the compiler will, consequently, not complain.
+
+In more practical terms what the presence of this type means is that during
+assembly, we create a $4\times 4$ matrix (in 2d, using a $Q_1$ element) of the
+contributions of the cell we are currently sitting on, and then we need to add
+the elements of this matrix to the appropriate elements of the global (system)
+matrix. For this, we need to get at the global indices of the degrees of
+freedom that are local to the current cell, for which we will always use the
+following piece of the code:
+@code
+  cell->get_dof_indices (local_dof_indices);
+@endcode
+where <code>local_dof_indices</code> is declared as
+@code
+  std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
+@endcode
+The name of this variable might be a bit of a misnomer -- it stands for "the
+global indices of those degrees of freedom locally defined on the current
+cell" -- but variables that hold this information are universally named this
+way throughout the library.
+
+@note types::global_dof_index is not the only type defined in this
+namespace. Rather, there is a whole family, including types::subdomain_id,
+types::boundary_id, and types::material_id. All of these are
+<code>typedef</code>s for integer data types but, as explained above, they are
+used throughout the library so that (i) the intent of a variable becomes more
+easily discerned, and (ii) so that it becomes possible to change the actual
+type to a larger one if necessary without having to go through the entire
+library and figure out whether a particular use of <code>unsigned int</code>
+corresponds to, say, a material indicator.
 
index 4f8b502688dcfc0d964b85f48e104eeab6b18699..c5d2e96c052ed605a49172f11c54271bc3d8c45e 100644 (file)
@@ -187,7 +187,7 @@ suggestions:
   <code>LaplaceProblem::LaplaceProblem</code>.
 
   <li>Convergence of the mean: A different way to see that the solution
-  actually converges (to something &mdash we can't tell whether it's really
+  actually converges (to something &mdash; we can't tell whether it's really
   the correct value!) is to compute the mean of the solution. To this end, add
   the following code to <code>LaplaceProblem::output_results</code>:
   @code
index 7a991c7211649a7531d3e4d26c74cf5a2771acdc..884be34c03afc1f9cce340fbf5d9e70f0fd62051 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, 1999, Guido Kanschat, 2011 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1999 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 1999-2004, 2006-2008, 2010-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+/*
+ * Authors: Wolfgang Bangerth, 1999,
+ *          Guido Kanschat, 2011
+ */
 
 
 // @sect3{Many new include files}
@@ -265,7 +275,7 @@ void Step3::assemble_system ()
   // mentioned, we use the implied Q1 mapping, rather than specifying one
   // ourselves explicitly. Finally, we have to tell it what we want it to
   // compute on each cell: we need the values of the shape functions at the
-  // quadrature points (for the right hand side $(\varphi,f)$), their
+  // quadrature points (for the right hand side $(\varphi_i,f)$), their
   // gradients (for the matrix entries $(\nabla \varphi_i, \nabla
   // \varphi_j)$), and also the weights of the quadrature points and the
   // determinants of the Jacobian transformations from the reference cell to
@@ -286,12 +296,12 @@ void Step3::assemble_system ()
                          update_values | update_gradients | update_JxW_values);
   // The advantage of this approach is that we can specify what kind of
   // information we actually need on each cell. It is easily understandable
-  // that this approach can significant speed up finite element computations,
+  // that this approach can significantly speed up finite element computations,
   // compared to approaches where everything, including second derivatives,
-  // normal vectors to cells, etc are computed on each cell, regardless
+  // normal vectors to cells, etc are computed on each cell, regardless of
   // whether they are needed or not.
 
-  // For use further down below, we define two short cuts for values that will
+  // For use further down below, we define two shortcuts for values that will
   // be used very frequently. First, an abbreviation for the number of degrees
   // of freedom on each cell (since we are in 2D and degrees of freedom are
   // associated with vertices only, this number is four, but we rather want to
@@ -302,7 +312,7 @@ void Step3::assemble_system ()
   //
   // Secondly, we also define an abbreviation for the number of quadrature
   // points (here that should be four). In general, it is a good idea to use
-  // their symbolic names instead of hard-coding these number even if you know
+  // their symbolic names instead of hard-coding these numbers even if you know
   // them, since you may want to change the quadrature formula and/or finite
   // element at some time; the program will just work with these changes,
   // without the need to change anything in this function.
@@ -333,8 +343,9 @@ void Step3::assemble_system ()
   // through dofs_per_cell-1). However, when we transfer the result into the
   // global matrix, we have to know the global numbers of the degrees of
   // freedom. When we query them, we need a scratch (temporary) array for
-  // these numbers:
-  std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+  // these numbers (see the discussion at the end of the introduction for
+  // the type, types::global_dof_index, used here):
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   // Now for the loop over all cells. We have seen before how this works, so
   // this should be familiar including the conventional names for these
@@ -458,7 +469,7 @@ void Step3::assemble_system ()
   // their boundary values (which are zero here for all entries). This mapping
   // of DoF numbers to boundary values is done by the <code>std::map</code>
   // class.
-  std::map<unsigned int,double> boundary_values;
+  std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
                                             ZeroFunction<2>(),
index e9eeca97e6af7f8ee06481648bde73fc419d9f4e..5e50d7316a6b58a7663ed535916c208ba24c370e 100644 (file)
@@ -1,14 +1,23 @@
-/* Author: Tobias Leicht, 2007 */
-
-/*    $Id$       */
-/*    Version: $Name$                                          */
-/*                                                                */
-/*    Copyright (C) 2007-2008, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2007 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Tobias Leicht, 2007
+ */
+
 
 // The deal.II include files have already been covered in previous examples
 // and will thus not be further commented on.
@@ -426,8 +435,8 @@ namespace Step30
   void DGMethod<dim>::assemble_system2 ()
   {
     const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
-    std::vector<unsigned int> dofs (dofs_per_cell);
-    std::vector<unsigned int> dofs_neighbor (dofs_per_cell);
+    std::vector<types::global_dof_index> dofs (dofs_per_cell);
+    std::vector<types::global_dof_index> dofs_neighbor (dofs_per_cell);
 
     const UpdateFlags update_flags = update_values
                                      | update_gradients
index 9310d4909052b3e76fd8ce172c9c0f803f1e317a..55b0db1520f9bf88812f8c0fdf228f9af67b13db 100644 (file)
@@ -506,13 +506,16 @@ Again, small values of $\beta$ lead to less diffusion but we have to
 choose the time step very small to keep things under control. Too
 large values of $\beta$ make for more diffusion, but again require
 small time steps. The best value would appear to be $\beta=0.03$, as
-for the $Q_1$ element, and the we have to choose
+for the $Q_1$ element, and then we have to choose
 $k=\frac 18\frac{h_K}{\|\mathbf{u}\|_{L^\infty(K)}}$ &mdash; exactly
 half the size for the $Q_1$ element, a fact that may not be surprising
 if we state the CFL condition as the requirement that the time step be
 small enough so that the distance transport advects in each time step
 is no longer than one <i>grid point</i> away (which for $Q_1$ elements
-is $h_K$, but for $Q_2$ elements is $h_K/2$).
+is $h_K$, but for $Q_2$ elements is $h_K/2$). It turns out that $\beta$ 
+needs to be sligthly larger for obtaining stable results also late in
+the simulation at times larger than 60, so we actually choose it as
+$\beta = 0.034$ in the code.
 
 
 <h5>Results for 3d</h5>
@@ -520,7 +523,7 @@ is $h_K$, but for $Q_2$ elements is $h_K/2$).
 One can repeat these experiments in 3d and find the optimal time step
 for each value of $\beta$ and find the best value of $\beta$. What one
 finds is that for the same $\beta$ already used in 2d, the time steps
-needs to be a bit small, by around a factor of 1.2 or so. This is
+needs to be a bit smaller, by around a factor of 1.2 or so. This is
 easily explained: the time step restriction is
 $k=\min_K \frac{ch_K}{\|\mathbf{u}\|_{L^\infty(K)}}$ where $h_K$ is
 the <i>diameter</i> of the cell. However, what is really needed is the
@@ -537,28 +540,29 @@ can take.
 
 <h5>Conclusions</h5>
 
-Concluding, from the simple computations above, $\beta=0.03$ appears to be a
+Concluding, from the simple computations above, $\beta=0.034$ appears to be a
 good choice for the stabilization parameter in 2d, and $\beta=0.05$ in 3d. In
-a dimension independent way, we can model this as $\beta=0.015d$. If one does
+a dimension independent way, we can model this as $\beta=0.017d$. If one does
 longer computations (several thousand time steps) on finer meshes, one
-realizes that that's not quite small enough and that for stability one will
-have to reduce the above values a bit more (by about a factor of $\frac 78$).
+realizes that the time step size is not quite small enough and that for
+stability one will have to reduce the above values a bit more (by about a
+factor of $\frac 78$).
 
 As a consequence, a formula that reconciles 2d, 3d, and variable polynomial
 degree and takes all factors in account reads as follows:
 @f{eqnarray*}
   k =
-  \frac 1{2 \cdot 1.6} \frac 1{\sqrt{d}}
+  \frac 1{2 \cdot 1.7} \frac 1{\sqrt{d}}
   \frac 2d
   \frac 1{q_T}
   \frac{h_K}{\|\mathbf{u}\|_{L^\infty(K)}}
   =
-  \frac 1{1.6 d\sqrt{d}}
+  \frac 1{1.7 d\sqrt{d}}
   \frac 1{q_T}
   \frac{h_K}{\|\mathbf{u}\|_{L^\infty(K)}}.
 @f}
 In the first form (in the center of the equation), $\frac
-1{2 \cdot 1.6}$ is a universal constant, $\frac 1{\sqrt{d}}$
+1{2 \cdot 1.7}$ is a universal constant, $\frac 1{\sqrt{d}}$
 is the factor that accounts for the difference between cell diameter
 and grid point separation,
 $\frac 2d$ accounts for the increase in $\beta$ with space dimension,
index 7d9a55ac919fbe2f6aa0051c629e6b0c7e27c943..e8d0062099793da92621c8a358279c48878d4ec6 100644 (file)
@@ -1,14 +1,24 @@
-/* Author: Martin Kronbichler, Uppsala University,
-   Wolfgang Bangerth, Texas A&M University 2007, 2008 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2007-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2007 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Martin Kronbichler, Uppsala University,
+ *          Wolfgang Bangerth, Texas A&M University 2007, 2008
+ */
+
 
 // @sect3{Include files}
 
@@ -492,7 +502,7 @@ namespace Step31
     DoFHandler<dim>                     stokes_dof_handler;
     ConstraintMatrix                    stokes_constraints;
 
-    std::vector<unsigned int>           stokes_block_sizes;
+    std::vector<types::global_dof_index> stokes_block_sizes;
     TrilinosWrappers::BlockSparseMatrix stokes_matrix;
     TrilinosWrappers::BlockSparseMatrix stokes_preconditioner_matrix;
 
@@ -750,7 +760,7 @@ namespace Step31
   // introduction.
   //
   // There are some universal constants worth mentioning here. First, we need
-  // to fix $\beta$; we choose $\beta=0.015\cdot dim$, a choice discussed in
+  // to fix $\beta$; we choose $\beta=0.017\cdot dim$, a choice discussed in
   // detail in the results section of this tutorial program. The second is the
   // exponent $\alpha$; $\alpha=1$ appears to work fine for the current
   // program, even though some additional benefit might be expected from
@@ -779,7 +789,7 @@ namespace Step31
                      const double                        global_T_variation,
                      const double                        cell_diameter) const
   {
-    const double beta = 0.015 * dim;
+    const double beta = 0.017 * dim;
     const double alpha = 1;
 
     if (global_u_infty == 0)
@@ -886,7 +896,7 @@ namespace Step31
       temperature_constraints.close ();
     }
 
-    std::vector<unsigned int> stokes_dofs_per_block (2);
+    std::vector<types::global_dof_index> stokes_dofs_per_block (2);
     DoFTools::count_dofs_per_block (stokes_dof_handler, stokes_dofs_per_block,
                                     stokes_sub_blocks);
 
@@ -1076,7 +1086,7 @@ namespace Step31
     const unsigned int   n_q_points      = quadrature_formula.size();
 
     FullMatrix<double>   local_matrix (dofs_per_cell, dofs_per_cell);
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     std::vector<Tensor<2,dim> > grad_phi_u (dofs_per_cell);
     std::vector<double>         phi_p      (dofs_per_cell);
@@ -1293,7 +1303,7 @@ namespace Step31
     FullMatrix<double>   local_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       local_rhs    (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     // Next we need a vector that will contain the values of the temperature
     // solution at the previous time level at the quadrature points to
@@ -1459,7 +1469,7 @@ namespace Step31
     FullMatrix<double>   local_mass_matrix (dofs_per_cell, dofs_per_cell);
     FullMatrix<double>   local_stiffness_matrix (dofs_per_cell, dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     std::vector<double>         phi_T       (dofs_per_cell);
     std::vector<Tensor<1,dim> > grad_phi_T  (dofs_per_cell);
@@ -1571,7 +1581,7 @@ namespace Step31
 
     Vector<double>       local_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     // Next comes the declaration of vectors to hold the old and older
     // solution values (as a notation for time levels <i>n-1</i> and
@@ -1828,12 +1838,12 @@ namespace Step31
     const double maximal_velocity = get_maximal_velocity();
 
     if (maximal_velocity >= 0.01)
-      time_step = 1./(1.6*dim*std::sqrt(1.*dim)) /
+      time_step = 1./(1.7*dim*std::sqrt(1.*dim)) /
                   temperature_degree *
                   GridTools::minimal_cell_diameter(triangulation) /
                   maximal_velocity;
     else
-      time_step = 1./(1.6*dim*std::sqrt(1.*dim)) /
+      time_step = 1./(1.7*dim*std::sqrt(1.*dim)) /
                   temperature_degree *
                   GridTools::minimal_cell_diameter(triangulation) /
                   .01;
@@ -1967,9 +1977,9 @@ namespace Step31
     // output as only a qualititative means to understand a solution, we
     // ignore this $\mathcal{O}(h)$ error.
     {
-      std::vector<unsigned int> local_joint_dof_indices (joint_fe.dofs_per_cell);
-      std::vector<unsigned int> local_stokes_dof_indices (stokes_fe.dofs_per_cell);
-      std::vector<unsigned int> local_temperature_dof_indices (temperature_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_joint_dof_indices (joint_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_stokes_dof_indices (stokes_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_temperature_dof_indices (temperature_fe.dofs_per_cell);
 
       typename DoFHandler<dim>::active_cell_iterator
       joint_cell       = joint_dof_handler.begin_active(),
index ba978a498dd896b06801c30c533c3bcb26ae654c..1b1d71ea0e8ebeb09f759fcd1b0e2b88f913123b 100644 (file)
@@ -1,13 +1,25 @@
-/* Author: Martin Kronbichler, Uppsala University,
-           Wolfgang Bangerth, Texas A&M University,
-           Timo Heister, University of Goettingen, 2008-2011 */
-/*                                                                */
-/*    Copyright (C) 2008-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2008 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Martin Kronbichler, Uppsala University,
+ *          Wolfgang Bangerth, Texas A&M University,
+ *          Timo Heister, University of Goettingen, 2008-2011
+ */
+
 
 // @sect3{Include files}
 
@@ -617,7 +629,7 @@ namespace Step32
         StokesPreconditioner (const StokesPreconditioner &data);
 
         FullMatrix<double>          local_matrix;
-        std::vector<unsigned int>   local_dof_indices;
+        std::vector<types::global_dof_index> local_dof_indices;
       };
 
       template <int dim>
@@ -674,7 +686,7 @@ namespace Step32
 
         FullMatrix<double>          local_mass_matrix;
         FullMatrix<double>          local_stiffness_matrix;
-        std::vector<unsigned int>   local_dof_indices;
+        std::vector<types::global_dof_index>   local_dof_indices;
       };
 
       template <int dim>
@@ -706,7 +718,7 @@ namespace Step32
         TemperatureRHS (const TemperatureRHS &data);
 
         Vector<double>              local_rhs;
-        std::vector<unsigned int>   local_dof_indices;
+        std::vector<types::global_dof_index> local_dof_indices;
         FullMatrix<double>          matrix_for_bc;
       };
 
@@ -1690,7 +1702,7 @@ namespace Step32
     const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
                        n_q_points    = fe_values.n_quadrature_points;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     Vector<double> cell_vector (dofs_per_cell);
     FullMatrix<double> matrix_for_bc (dofs_per_cell, dofs_per_cell);
 
@@ -1945,7 +1957,7 @@ namespace Step32
 
     temperature_dof_handler.distribute_dofs (temperature_fe);
 
-    std::vector<unsigned int> stokes_dofs_per_block (2);
+    std::vector<types::global_dof_index> stokes_dofs_per_block (2);
     DoFTools::count_dofs_per_block (stokes_dof_handler, stokes_dofs_per_block,
                                     stokes_sub_blocks);
 
@@ -3251,9 +3263,9 @@ namespace Step32
     joint_solution.reinit (joint_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
 
     {
-      std::vector<unsigned int> local_joint_dof_indices (joint_fe.dofs_per_cell);
-      std::vector<unsigned int> local_stokes_dof_indices (stokes_fe.dofs_per_cell);
-      std::vector<unsigned int> local_temperature_dof_indices (temperature_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_joint_dof_indices (joint_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_stokes_dof_indices (stokes_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_temperature_dof_indices (temperature_fe.dofs_per_cell);
 
       typename DoFHandler<dim>::active_cell_iterator
       joint_cell       = joint_dof_handler.begin_active(),
index 37c8cf97921e2b4840ce5e7c190effd6adf48637..3d17389c1bea2e9968a8c4f6d7f416c257a9c50a 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: David Neckels, Boulder, Colorado, 2007, 2008 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2007 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: David Neckels, Boulder, Colorado, 2007, 2008
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2007-2012 by the deal.II authors and David Neckels */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -1290,12 +1300,12 @@ namespace Step33
 
     void assemble_system ();
     void assemble_cell_term (const FEValues<dim>             &fe_v,
-                             const std::vector<unsigned int> &dofs);
+                             const std::vector<types::global_dof_index> &dofs);
     void assemble_face_term (const unsigned int               face_no,
                              const FEFaceValuesBase<dim>     &fe_v,
                              const FEFaceValuesBase<dim>     &fe_v_neighbor,
-                             const std::vector<unsigned int> &dofs,
-                             const std::vector<unsigned int> &dofs_neighbor,
+                             const std::vector<types::global_dof_index> &dofs,
+                             const std::vector<types::global_dof_index> &dofs_neighbor,
                              const bool                       external_face,
                              const unsigned int               boundary_id,
                              const double                     face_diameter);
@@ -1430,8 +1440,8 @@ namespace Step33
   {
     const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
 
-    std::vector<unsigned int> dof_indices (dofs_per_cell);
-    std::vector<unsigned int> dof_indices_neighbor (dofs_per_cell);
+    std::vector<types::global_dof_index> dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> dof_indices_neighbor (dofs_per_cell);
 
     const UpdateFlags update_flags               = update_values
                                                    | update_gradients
@@ -1481,7 +1491,7 @@ namespace Step33
               assemble_face_term (face_no, fe_v_face,
                                   fe_v_face,
                                   dof_indices,
-                                  std::vector<unsigned int>(),
+                                  std::vector<types::global_dof_index>(),
                                   true,
                                   cell->face(face_no)->boundary_indicator(),
                                   cell->face(face_no)->diameter());
@@ -1661,7 +1671,7 @@ namespace Step33
   void
   ConservationLaw<dim>::
   assemble_cell_term (const FEValues<dim>             &fe_v,
-                      const std::vector<unsigned int> &dof_indices)
+                      const std::vector<types::global_dof_index> &dof_indices)
   {
     const unsigned int dofs_per_cell = fe_v.dofs_per_cell;
     const unsigned int n_q_points    = fe_v.n_quadrature_points;
@@ -1862,8 +1872,8 @@ namespace Step33
   ConservationLaw<dim>::assemble_face_term(const unsigned int           face_no,
                                            const FEFaceValuesBase<dim> &fe_v,
                                            const FEFaceValuesBase<dim> &fe_v_neighbor,
-                                           const std::vector<unsigned int>   &dof_indices,
-                                           const std::vector<unsigned int>   &dof_indices_neighbor,
+                                           const std::vector<types::global_dof_index>   &dof_indices,
+                                           const std::vector<types::global_dof_index>   &dof_indices_neighbor,
                                            const bool                   external_face,
                                            const unsigned int           boundary_id,
                                            const double                 face_diameter)
@@ -2481,7 +2491,7 @@ int main (int argc, char *argv[])
           std::exit(1);
         }
 
-      Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv);
+      Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, dealii::numbers::invalid_unsigned_int);
 
       ConservationLaw<2> cons (argv[1]);
       cons.run ();
index e5b9c78bb25fb61e6bd7bf2be66a7d7e52214028..9667a2dc9a3f5ea650590a83620d9b028a8accbd 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Luca Heltai, Cataldo Manigrasso, 2009                  */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2009 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Luca Heltai, Cataldo Manigrasso, 2009
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2009-2012 by deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -553,7 +563,7 @@ namespace Step34
 
     const unsigned int n_q_points = fe_v.n_quadrature_points;
 
-    std::vector<unsigned int> local_dof_indices(fe.dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices(fe.dofs_per_cell);
 
     std::vector<Vector<double> > cell_wind(n_q_points, Vector<double>(dim) );
     double normal_wind;
@@ -932,7 +942,7 @@ namespace Step34
 
     const unsigned int n_q_points = fe_v.n_quadrature_points;
 
-    std::vector<unsigned int> dofs(fe.dofs_per_cell);
+    std::vector<types::global_dof_index> dofs(fe.dofs_per_cell);
 
     std::vector<double> local_phi(n_q_points);
     std::vector<double> normal_wind(n_q_points);
index d5fffbf38e367e0277fc5690a85fe5d810f4f8a0..894966c8f5b4366d6f871b7a14d4061685ce4f80 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Abner Salgado, Texas A&M University 2009               */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2009-2012 by deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2009 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Abner Salgado, Texas A&M University 2009
+ */
 
 
 // @sect3{Include files}
@@ -402,7 +411,7 @@ namespace Step35
     const double       t_0, T, Re;
 
     EquationData::Velocity<dim>       vel_exact;
-    std::map<unsigned int, double>    boundary_values;
+    std::map<types::global_dof_index, double>    boundary_values;
     std::vector<types::boundary_id> boundary_indicators;
 
     Triangulation<dim> triangulation;
@@ -516,8 +525,8 @@ namespace Step35
       unsigned int              vel_dpc;
       unsigned int              pres_dpc;
       FullMatrix<double>        local_grad;
-      std::vector<unsigned int> vel_local_dof_indices;
-      std::vector<unsigned int> pres_local_dof_indices;
+      std::vector<types::global_dof_index> vel_local_dof_indices;
+      std::vector<types::global_dof_index> pres_local_dof_indices;
 
       InitGradPerTaskData (const unsigned int dd,
                            const unsigned int vdpc,
@@ -572,7 +581,7 @@ namespace Step35
     struct AdvectionPerTaskData
     {
       FullMatrix<double>        local_advection;
-      std::vector<unsigned int> local_dof_indices;
+      std::vector<types::global_dof_index> local_dof_indices;
       AdvectionPerTaskData (const unsigned int dpc)
         :
         local_advection (dpc, dpc),
@@ -1192,7 +1201,7 @@ namespace Step35
 
     phi_n_minus_1 = phi_n;
 
-    static std::map<unsigned int, double> bval;
+    static std::map<types::global_dof_index, double> bval;
     if (reinit_prec)
       VectorTools::interpolate_boundary_values (dof_handler_pressure, 3,
                                                 ZeroFunction<dim>(), bval);
@@ -1276,7 +1285,7 @@ namespace Step35
              dof_handler_pressure.n_dofs()),
             ExcInternalError());
     static Vector<double> joint_solution (joint_dof_handler.n_dofs());
-    std::vector<unsigned int> loc_joint_dof_indices (joint_fe.dofs_per_cell),
+    std::vector<types::global_dof_index> loc_joint_dof_indices (joint_fe.dofs_per_cell),
         loc_vel_dof_indices (fe_velocity.dofs_per_cell),
         loc_pres_dof_indices (fe_pressure.dofs_per_cell);
     typename DoFHandler<dim>::active_cell_iterator
@@ -1361,7 +1370,7 @@ namespace Step35
                               update_values);
     const unsigned int dpc = fe_velocity.dofs_per_cell,
                        nqp = quadrature_velocity.size();
-    std::vector<unsigned int> ldi (dpc);
+    std::vector<types::global_dof_index> ldi (dpc);
     Vector<double> loc_rot (dpc);
 
     std::vector< Tensor<1,dim> > grad_u1 (nqp), grad_u2 (nqp);
index 665301d399ddae41ce73d631dee2c17c9058e5b8..7c93a435c4588045b51adcdb437eb5155353fd49 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Toby D. Young, Polish Academy of Sciences,             */
-/*         Wolfgang Bangerth, Texas A&M University                */
-/*    $Id$*/
-/*                                                                */
-/*    Copyright (C) 2009, 2011-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2009 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Toby D. Young, Polish Academy of Sciences,
+ *          Wolfgang Bangerth, Texas A&M University
+ */
 
 // @sect3{Include files}
 
@@ -223,7 +233,7 @@ namespace Step36
     FullMatrix<double> cell_stiffness_matrix (dofs_per_cell, dofs_per_cell);
     FullMatrix<double> cell_mass_matrix (dofs_per_cell, dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     FunctionParser<dim> potential;
     potential.initialize (FunctionParser<dim>::default_variable_names (),
index 453e0ae72be27559712536546251287f82d91eeb..62c51b30acd535a7568e7c76ef866dc03828100c 100644 (file)
@@ -1,14 +1,23 @@
-/* $Id$ */
-/* Author: Katharina Kormann, Martin Kronbichler, Uppsala University, 2009-2012 */
-
-/*    $Id$    */
-/*                                                                */
-/*    Copyright (C) 2009-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2009 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Katharina Kormann, Martin Kronbichler, Uppsala University, 2009-2012
+ */
+
 
 // First include the necessary files from the deal.II library.
 #include <deal.II/base/quadrature_lib.h>
@@ -794,13 +803,13 @@ namespace Step37
     typename FunctionMap<dim>::type dirichlet_boundary;
     ZeroFunction<dim>               homogeneous_dirichlet_bc (1);
     dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
-    std::vector<std::set<unsigned int> > boundary_indices(triangulation.n_levels());
+    std::vector<std::set<types::global_dof_index> > boundary_indices(triangulation.n_levels());
     MGTools::make_boundary_list (dof_handler,
                                  dirichlet_boundary,
                                  boundary_indices);
     for (unsigned int level=0; level<nlevels; ++level)
       {
-        std::set<unsigned int>::iterator bc_it = boundary_indices[level].begin();
+        std::set<types::global_dof_index>::iterator bc_it = boundary_indices[level].begin();
         for ( ; bc_it != boundary_indices[level].end(); ++bc_it)
           mg_constraints[level].add_line(*bc_it);
 
@@ -835,7 +844,7 @@ namespace Step37
     const unsigned int   dofs_per_cell = fe.dofs_per_cell;
     const unsigned int   n_q_points    = quadrature_formula.size();
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     const Coefficient<dim> coefficient;
     std::vector<double>    coefficient_values (n_q_points);
 
@@ -881,7 +890,7 @@ namespace Step37
     const unsigned int   dofs_per_cell = fe.dofs_per_cell;
     const unsigned int   n_q_points    = quadrature_formula.size();
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     const Coefficient<dim>    coefficient;
     std::vector<double>       coefficient_values (n_q_points);
     FullMatrix<double>        local_matrix (dofs_per_cell, dofs_per_cell);
@@ -975,7 +984,7 @@ namespace Step37
 
     typedef PreconditionChebyshev<LevelMatrixType,Vector<double> > SMOOTHER;
     MGSmootherPrecondition<LevelMatrixType, SMOOTHER, Vector<double> >
-      mg_smoother;
+    mg_smoother;
 
     // Then, we initialize the smoother with our level matrices and the
     // mandatory additional data for the Chebyshev smoother. We use quite a
index e9891e7d4a624a287cc32e090d19a45667847cfa..d1bcf3bc9898cbc6297320e0e50a225170a0a473 100644 (file)
@@ -1,13 +1,23 @@
-/* Authors: Andrea Bonito, Sebastian Pauletti. */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2010 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Andrea Bonito, Sebastian Pauletti.
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2010-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -374,7 +384,7 @@ namespace Step38
     Vector<double>            cell_rhs (dofs_per_cell);
 
     std::vector<double>       rhs_values(n_q_points);
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const RightHandSide<spacedim> rhs;
 
@@ -415,7 +425,7 @@ namespace Step38
           }
       }
 
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (mapping,
                                               dof_handler,
                                               0,
index c1544a4d5c1261d330ece52792d225b39f2f7110..1067a958226ad1414fbe7571d1ff68f73316fda8 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Guido Kanschat, Texas A&M University, 2009 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2010 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Guido Kanschat, Texas A&M University, 2009
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2010-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // The include files for the linear algebra: A regular SparseMatrix, which in
 // turn will include the necessary files for SparsityPattern and Vector
@@ -88,13 +98,13 @@ namespace Step39
   {
   public:
     void cell(MeshWorker::DoFInfo<dim> &dinfo,
-             typename MeshWorker::IntegrationInfo<dim> &info) const;
+              typename MeshWorker::IntegrationInfo<dim> &info) const;
     void boundary(MeshWorker::DoFInfo<dim> &dinfo,
-                 typename MeshWorker::IntegrationInfo<dim> &info) const;
+                  typename MeshWorker::IntegrationInfo<dim> &info) const;
     void face(MeshWorker::DoFInfo<dim> &dinfo1,
-             MeshWorker::DoFInfo<dim> &dinfo2,
-             typename MeshWorker::IntegrationInfo<dim> &info1,
-             typename MeshWorker::IntegrationInfo<dim> &info2) const;
+              MeshWorker::DoFInfo<dim> &dinfo2,
+              typename MeshWorker::IntegrationInfo<dim> &info1,
+              typename MeshWorker::IntegrationInfo<dim> &info2) const;
   };
 
 
@@ -153,9 +163,9 @@ namespace Step39
     void cell(MeshWorker::DoFInfo<dim> &dinfo, typename MeshWorker::IntegrationInfo<dim> &info) const;
     void boundary(MeshWorker::DoFInfo<dim> &dinfo, typename MeshWorker::IntegrationInfo<dim> &info) const;
     void face(MeshWorker::DoFInfo<dim> &dinfo1,
-             MeshWorker::DoFInfo<dim> &dinfo2,
-             typename MeshWorker::IntegrationInfo<dim> &info1,
-             typename MeshWorker::IntegrationInfo<dim> &info2) const;
+              MeshWorker::DoFInfo<dim> &dinfo2,
+              typename MeshWorker::IntegrationInfo<dim> &info1,
+              typename MeshWorker::IntegrationInfo<dim> &info2) const;
   };
 
 
@@ -202,9 +212,9 @@ namespace Step39
     void cell(MeshWorker::DoFInfo<dim> &dinfo, typename MeshWorker::IntegrationInfo<dim> &info) const;
     void boundary(MeshWorker::DoFInfo<dim> &dinfo, typename MeshWorker::IntegrationInfo<dim> &info) const;
     void face(MeshWorker::DoFInfo<dim> &dinfo1,
-             MeshWorker::DoFInfo<dim> &dinfo2,
-             typename MeshWorker::IntegrationInfo<dim> &info1,
-             typename MeshWorker::IntegrationInfo<dim> &info2) const;
+              MeshWorker::DoFInfo<dim> &dinfo2,
+              typename MeshWorker::IntegrationInfo<dim> &info1,
+              typename MeshWorker::IntegrationInfo<dim> &info2) const;
   };
 
 
@@ -298,9 +308,9 @@ namespace Step39
     void cell(MeshWorker::DoFInfo<dim> &dinfo, typename MeshWorker::IntegrationInfo<dim> &info) const;
     void boundary(MeshWorker::DoFInfo<dim> &dinfo, typename MeshWorker::IntegrationInfo<dim> &info) const;
     void face(MeshWorker::DoFInfo<dim> &dinfo1,
-             MeshWorker::DoFInfo<dim> &dinfo2,
-             typename MeshWorker::IntegrationInfo<dim> &info1,
-             typename MeshWorker::IntegrationInfo<dim> &info2) const;
+              MeshWorker::DoFInfo<dim> &dinfo2,
+              typename MeshWorker::IntegrationInfo<dim> &info1,
+              typename MeshWorker::IntegrationInfo<dim> &info2) const;
   };
 
   // Here we have the integration on cells. There is currently no good
@@ -614,7 +624,7 @@ namespace Step39
     MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > assembler;
     assembler.initialize(mg_matrix);
     assembler.initialize_fluxes(mg_matrix_dg_up, mg_matrix_dg_down);
-    
+
     MatrixIntegrator<dim> integrator;
     // Here is the other difference to the previous function: we run over all
     // cells, not only the active ones. And we use <tt>mg_dof_handler</tt>,
index 7aa256fa808245b86258febcebd1e2ba827992bd..8dc0d0a529f18391f2829a7be11a0cf8c90fd3ff 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 1999 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1999 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 1999
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 1999-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -320,7 +330,7 @@ void Step4<dim>::assemble_system ()
   FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
   Vector<double>       cell_rhs (dofs_per_cell);
 
-  std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   // Next, we again have to loop over all cells and assemble local
   // contributions.  Note, that a cell is a quadrilateral in two space
@@ -400,7 +410,7 @@ void Step4<dim>::assemble_system ()
   // task, we only have to replace the ZeroFunction used there by an object of
   // the class which describes the boundary values we would like to use
   // (i.e. the <code>BoundaryValues</code> class declared above):
-  std::map<unsigned int,double> boundary_values;
+  std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
                                             BoundaryValues<dim>(),
index 5e098c78907f2a0b7cd8c7086a06818a0c5fb59a..0fec405ec838773396a192fdcb142d2236b0deb8 100644 (file)
@@ -135,3 +135,15 @@ same number of lines of code (though step-6 spends more space on dealing with
 coefficients and output). In either case, the comments below will only be on
 the things that set step-40 apart from step-6 and that aren't already covered
 in the @ref distributed documentation module.
+
+
+@note This program will be able to compute on as many processors as you want
+to throw at it, and for as large a problem as you have the memory and patience
+to solve. However, there <i>is</i> a limit: the number of unknowns can not
+exceed the largest number that can be stored with an object of type
+types::global_dof_index. By default, this is a typedef for <code>unsigned
+int</code>, which on most machines today is a 32-bit integer, limiting you to
+some 4 billion (in reality, since this program uses PETSc, you will be limited
+to half that as PETSc uses signed integers). However, this can be changed
+during configuration to use 64-bit integers, see the ReadMe file. This will
+give problem sizes you are unlikely to exceed anytime soon.
index 5b9d32310c55c528395f94b01378ea7054923cbe..d50694e9f9c4122d1ee9bf6ac13c08e3b8e8d030 100644 (file)
@@ -1,14 +1,23 @@
-/* Author: Wolfgang Bangerth, Texas A&M University, 2009, 2010 */
-/*         Timo Heister, University of Goettingen, 2009, 2010 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2009 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2009-2012 by Timo Heister and the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+/*
+ * Author: Wolfgang Bangerth, Texas A&M University, 2009, 2010
+ *         Timo Heister, University of Goettingen, 2009, 2010
+ */
 
 
 // @sect3{Include files}
 // already be familiar friends:
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
+#include <deal.II/base/timer.h>
+
+#include <deal.II/lac/generic_linear_algebra.h>
+
+#define USE_PETSC_LA
+
+namespace LA
+{
+#ifdef USE_PETSC_LA
+  using namespace dealii::LinearAlgebraPETSc;
+#else
+  using namespace dealii::LinearAlgebraTrilinos;
+#endif
+}
+
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/solver_cg.h>
@@ -133,23 +157,24 @@ namespace Step40
     void refine_grid ();
     void output_results (const unsigned int cycle) const;
 
-    MPI_Comm mpi_communicator;
+    MPI_Comm                                  mpi_communicator;
 
-    parallel::distributed::Triangulation<dim>   triangulation;
+    parallel::distributed::Triangulation<dim> triangulation;
 
-    DoFHandler<dim>      dof_handler;
-    FE_Q<dim>            fe;
+    DoFHandler<dim>                           dof_handler;
+    FE_Q<dim>                                 fe;
 
-    IndexSet             locally_owned_dofs;
-    IndexSet             locally_relevant_dofs;
+    IndexSet                                  locally_owned_dofs;
+    IndexSet                                  locally_relevant_dofs;
 
-    ConstraintMatrix     constraints;
+    ConstraintMatrix                          constraints;
 
-    PETScWrappers::MPI::SparseMatrix system_matrix;
-    PETScWrappers::MPI::Vector locally_relevant_solution;
-    PETScWrappers::MPI::Vector system_rhs;
+    LA::MPI::SparseMatrix system_matrix;
+    LA::MPI::Vector locally_relevant_solution;
+    LA::MPI::Vector system_rhs;
 
-    ConditionalOStream                pcout;
+    ConditionalOStream                        pcout;
+    TimerOutput                               computing_timer;
   };
 
 
@@ -175,7 +200,10 @@ namespace Step40
     fe (2),
     pcout (std::cout,
            (Utilities::MPI::this_mpi_process(mpi_communicator)
-            == 0))
+            == 0)),
+    computing_timer (pcout,
+                     TimerOutput::summary,
+                     TimerOutput::wall_times)
   {}
 
 
@@ -206,6 +234,8 @@ namespace Step40
   template <int dim>
   void LaplaceProblem<dim>::setup_system ()
   {
+    TimerOutput::Scope t(computing_timer, "setup");
+
     dof_handler.distribute_dofs (fe);
 
     // The next two lines extract some informatino we will need later on,
@@ -230,12 +260,10 @@ namespace Step40
     // locally owned cells (of course the linear solvers will read from it,
     // but they do not care about the geometric location of degrees of
     // freedom).
-    locally_relevant_solution.reinit (mpi_communicator,
-                                      locally_owned_dofs,
-                                      locally_relevant_dofs);
-    system_rhs.reinit (mpi_communicator,
-                       dof_handler.n_dofs(),
-                       dof_handler.n_locally_owned_dofs());
+    locally_relevant_solution.reinit (locally_owned_dofs,
+                                      locally_relevant_dofs, mpi_communicator);
+    system_rhs.reinit (locally_owned_dofs, mpi_communicator);
+
     system_rhs = 0;
 
     // The next step is to compute hanging node and boundary value
@@ -287,21 +315,19 @@ namespace Step40
     // entries that will exist in that part of the finite element matrix that
     // it will own. The final step is to initialize the matrix with the
     // sparsity pattern.
-    CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(),
-                                         dof_handler.n_dofs(),
-                                         locally_relevant_dofs);
-    DoFTools::make_sparsity_pattern (dof_handler,
-                                     csp,
+    CompressedSimpleSparsityPattern csp (locally_relevant_dofs);
+
+    DoFTools::make_sparsity_pattern (dof_handler, csp,
                                      constraints, false);
     SparsityTools::distribute_sparsity_pattern (csp,
                                                 dof_handler.n_locally_owned_dofs_per_processor(),
                                                 mpi_communicator,
                                                 locally_relevant_dofs);
-    system_matrix.reinit (mpi_communicator,
+
+    system_matrix.reinit (locally_owned_dofs,
+                          locally_owned_dofs,
                           csp,
-                          dof_handler.n_locally_owned_dofs_per_processor(),
-                          dof_handler.n_locally_owned_dofs_per_processor(),
-                          Utilities::MPI::this_mpi_process(mpi_communicator));
+                          mpi_communicator);
   }
 
 
@@ -334,6 +360,8 @@ namespace Step40
   template <int dim>
   void LaplaceProblem<dim>::assemble_system ()
   {
+    TimerOutput::Scope t(computing_timer, "assembly");
+
     const QGauss<dim>  quadrature_formula(3);
 
     FEValues<dim> fe_values (fe, quadrature_formula,
@@ -347,7 +375,7 @@ namespace Step40
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
@@ -428,20 +456,23 @@ namespace Step40
   template <int dim>
   void LaplaceProblem<dim>::solve ()
   {
-    PETScWrappers::MPI::Vector
-    completely_distributed_solution (mpi_communicator,
-                                     dof_handler.n_dofs(),
-                                     dof_handler.n_locally_owned_dofs());
+    TimerOutput::Scope t(computing_timer, "solve");
+    LA::MPI::Vector
+    completely_distributed_solution (locally_owned_dofs, mpi_communicator);
 
     SolverControl solver_control (dof_handler.n_dofs(), 1e-12);
 
-    PETScWrappers::SolverCG solver(solver_control, mpi_communicator);
+    LA::SolverCG solver(solver_control, mpi_communicator);
+    LA::MPI::PreconditionAMG preconditioner;
 
-    // Ask for a symmetric preconditioner by setting the first parameter in
-    // AdditionalData to true.
-    PETScWrappers::PreconditionBoomerAMG
-    preconditioner(system_matrix,
-                   PETScWrappers::PreconditionBoomerAMG::AdditionalData(true));
+    LA::MPI::PreconditionAMG::AdditionalData data;
+
+#ifdef USE_PETSC_LA
+    data.symmetric_operator = true;
+#else
+    //trilinos defaults are good
+#endif
+    preconditioner.initialize(system_matrix, data);
 
     solver.solve (system_matrix, completely_distributed_solution, system_rhs,
                   preconditioner);
@@ -473,6 +504,8 @@ namespace Step40
   template <int dim>
   void LaplaceProblem<dim>::refine_grid ()
   {
+    TimerOutput::Scope t(computing_timer, "refine");
+
     Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
     KellyErrorEstimator<dim>::estimate (dof_handler,
                                         QGauss<dim-1>(3),
@@ -620,10 +653,16 @@ namespace Step40
         solve ();
 
         if (Utilities::MPI::n_mpi_processes(mpi_communicator) <= 32)
-          output_results (cycle);
+          {
+            TimerOutput::Scope t(computing_timer, "output");
+            output_results (cycle);
+          }
 
         pcout << std::endl;
+        computing_timer.print_summary ();
+        computing_timer.reset ();
       }
+
   }
 }
 
index 699b98c897dede264558e5fa870188f86704a59c..80ac9f3305ca8afcc9385ace06fcdc625c1f3d49 100644 (file)
@@ -1,15 +1,25 @@
-/* Authors: Joerg Frohne, Texas A&M University and                */
-/*                        University of Siegen, 2011, 2012        */
-/*          Wolfgang Bangerth, Texas A&M University, 2012         */
-
-/*    $Id$        */
-/*                                                                */
-/*    Copyright (C) 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2011 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Joerg Frohne, Texas A&M University and
+ *                        University of Siegen, 2011, 2012
+ *          Wolfgang Bangerth, Texas A&M University, 2012
+ */
+
 
 // @sect3{Include files}
 
@@ -293,7 +303,7 @@ namespace Step41
     FullMatrix<double>        cell_matrix (dofs_per_cell, dofs_per_cell);
     TrilinosWrappers::Vector  cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
@@ -370,7 +380,7 @@ namespace Step41
     const unsigned int        n_q_points    = quadrature_formula.size();
 
     FullMatrix<double>        cell_matrix (dofs_per_cell, dofs_per_cell);
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dof_handler.begin_active(),
index 54de0ab8f483b7a7bd4518592b5f15d395ccf7e0..0ac5426c5c768582322009cd90e48d0625942d31 100644 (file)
@@ -1,14 +1,23 @@
-/* $Id$ */
-/* Author: Wolfgang Bangerth, University of Heidelberg, 1999 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 1999-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyrightG and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1999 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 1999
+ */
+
 
 // @sect3{Include files}
 
@@ -100,32 +109,34 @@ namespace Step42
   template <int dim>
   class Input
   {
-   public:
-    Input (const char_name) :
+  public:
+    Input (const char *_name) :
       name (_name),
       mpi_communicator (MPI_COMM_WORLD),
       pcout (std::cout,
-               (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)),
+             (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)),
       obstacle_data (0),
       hx (0),
       hy (0),
       nx (0),
       ny (0)
-      {read_obstacle (name);}
+    {
+      read_obstacle (name);
+    }
 
-      double hv (int i, int j);
+    double hv (int i, int j);
 
-      double obstacle_function (double x,double y);
+    double obstacle_function (double x,double y);
 
-      void read_obstacle (const char* name);
+    void read_obstacle (const char *name);
 
-   private:
-      const char*          name;
-      MPI_Comm             mpi_communicator;
-      ConditionalOStream   pcout;
-      std::vector<double>  obstacle_data;
-      double               hx, hy;
-      int                  nx, ny;
+  private:
+    const char          *name;
+    MPI_Comm             mpi_communicator;
+    ConditionalOStream   pcout;
+    std::vector<double>  obstacle_data;
+    double               hx, hy;
+    int                  nx, ny;
   };
 
   // This function is used in obstacle_function ()
@@ -212,7 +223,7 @@ namespace Step42
   // obstacle datas and stores them in the std::vector
   // obstacle_data. It will be used only in run ().
   template <int dim>
-  void Input<dim>::read_obstacle (const charname)
+  void Input<dim>::read_obstacle (const char *name)
   {
     std::ifstream f(name);
 
@@ -222,9 +233,9 @@ namespace Step42
 
     for (int k=0; k<nx*ny; k++)
       {
-       double val;
-       f >> val;
-       obstacle_data.push_back(val);
+        double val;
+        f >> val;
+        obstacle_data.push_back(val);
       }
 
     hx = 1.0/(nx - 1);
@@ -253,18 +264,21 @@ namespace Step42
                      MPI_Comm _mpi_communicator,
                      ConditionalOStream _pcout);
 
-    void plast_linear_hardening (SymmetricTensor<4,dim>          &stress_strain_tensor,
+    void plast_linear_hardening (SymmetricTensor<4,dim>     &stress_strain_tensor,
                                  const SymmetricTensor<2,dim> &strain_tensor,
-                                 unsigned int                    &elast_points,
-                                 unsigned int                    &plast_points,
-                                 double                          &yield);
-    void linearized_plast_linear_hardening (SymmetricTensor<4,dim>              &stress_strain_tensor_linearized,
-                                            SymmetricTensor<4,dim>              &stress_strain_tensor,
+                                 unsigned int               &elast_points,
+                                 unsigned int               &plast_points,
+                                 double                     &yield);
+    void linearized_plast_linear_hardening (SymmetricTensor<4,dim>     &stress_strain_tensor_linearized,
+                                            SymmetricTensor<4,dim>     &stress_strain_tensor,
                                             const SymmetricTensor<2,dim> &strain_tensor);
     inline SymmetricTensor<2,dim> get_strain (const FEValues<dim> &fe_values,
                                               const unsigned int  shape_func,
                                               const unsigned int  q_point) const;
-    void set_sigma_0 (double sigma_hlp) {sigma_0 = sigma_hlp;}
+    void set_sigma_0 (double sigma_hlp)
+    {
+      sigma_0 = sigma_hlp;
+    }
 
   private:
     SymmetricTensor<4,dim>  stress_strain_tensor_mu;
@@ -324,11 +338,11 @@ namespace Step42
   // Also we sum up the elastic and the plastic quadrature
   // points.
   template <int dim>
-  void ConstitutiveLaw<dim>::plast_linear_hardening (SymmetricTensor<4,dim>      &stress_strain_tensor,
+  void ConstitutiveLaw<dim>::plast_linear_hardening (SymmetricTensor<4,dim>     &stress_strain_tensor,
                                                      const SymmetricTensor<2,dim> &strain_tensor,
-                                                     unsigned int                &elast_points,
-                                                     unsigned int                &plast_points,
-                                                     double                      &yield)
+                                                     unsigned int                 &elast_points,
+                                                     unsigned int               &plast_points,
+                                                     double                     &yield)
   {
     if (dim == 3)
       {
@@ -359,9 +373,9 @@ namespace Step42
   // This function returns the linearized stress strain tensor.
   // It contains the derivative of the nonlinear constitutive law.
   template <int dim>
-  void ConstitutiveLaw<dim>::linearized_plast_linear_hardening (SymmetricTensor<4,dim>                  &stress_strain_tensor_linearized,
-                                                                                                                               SymmetricTensor<4,dim>           &stress_strain_tensor,
-                                                                                                                               const SymmetricTensor<2,dim> &strain_tensor)
+  void ConstitutiveLaw<dim>::linearized_plast_linear_hardening (SymmetricTensor<4,dim>     &stress_strain_tensor_linearized,
+      SymmetricTensor<4,dim>     &stress_strain_tensor,
+      const SymmetricTensor<2,dim> &strain_tensor)
   {
     if (dim == 3)
       {
@@ -485,7 +499,7 @@ namespace Step42
         Function<dim>(dim),
         input_obstacle_copy(_input),
         use_read_obstacle(_use_read_obstacle)
-         {}
+      {}
 
       virtual double value (const Point<dim>   &p,
                             const unsigned int  component = 0) const;
@@ -495,7 +509,7 @@ namespace Step42
 
     private:
       std_cxx1x::shared_ptr<Input<dim> >  const &input_obstacle_copy;
-      bool                                                                             use_read_obstacle;
+      bool                    use_read_obstacle;
     };
 
     template <int dim>
@@ -510,10 +524,10 @@ namespace Step42
         return_value = p(1);
       if (component == 2)
         {
-         if (use_read_obstacle)
-                 return_value = 1.999 - input_obstacle_copy->obstacle_function (p(0), p(1));
-         else
-                 return_value = -std::sqrt (0.36 - (p(0)-0.5)*(p(0)-0.5) - (p(1)-0.5)*(p(1)-0.5)) + 1.59;
+          if (use_read_obstacle)
+            return_value = 1.999 - input_obstacle_copy->obstacle_function (p(0), p(1));
+          else
+            return_value = -std::sqrt (0.36 - (p(0)-0.5)*(p(0)-0.5) - (p(1)-0.5)*(p(1)-0.5)) + 1.59;
         }
       return return_value;
     }
@@ -703,7 +717,7 @@ namespace Step42
       computing_timer.exit_section("Setup: distribute DoFs");
     }
 
-                                       // Setup of the hanging nodes and the Dirichlet constraints.
+    // Setup of the hanging nodes and the Dirichlet constraints.
     {
       constraints_hanging_nodes.clear ();
       constraints_hanging_nodes.reinit (locally_relevant_dofs);
@@ -721,7 +735,7 @@ namespace Step42
       dirichlet_constraints ();
     }
 
-                                       // Initialization for matrices and vectors.
+    // Initialization for matrices and vectors.
     {
       solution.reinit (locally_relevant_dofs, mpi_communicator);
       system_rhs_newton.reinit (locally_owned_dofs, mpi_communicator);
@@ -732,7 +746,7 @@ namespace Step42
       active_set.set_size (locally_relevant_dofs.size ());
     }
 
-                                       // Here we setup sparsity pattern.
+    // Here we setup sparsity pattern.
     {
       computing_timer.enter_section("Setup: matrix");
       TrilinosWrappers::SparsityPattern sp (locally_owned_dofs,
@@ -745,12 +759,12 @@ namespace Step42
 
       system_matrix_newton.reinit (sp);
 
-                                      // we are going to reuse the system
-                                      // matrix for assembling the diagonal
-                                      // of the mass matrix so that we do not
-                                      // need to allocate two sparse matrices
-                                      // at the same time:
-      TrilinosWrappers::SparseMatrix & mass_matrix = system_matrix_newton;
+      // we are going to reuse the system
+      // matrix for assembling the diagonal
+      // of the mass matrix so that we do not
+      // need to allocate two sparse matrices
+      // at the same time:
+      TrilinosWrappers::SparseMatrix &mass_matrix = system_matrix_newton;
       assemble_mass_matrix_diagonal (mass_matrix);
       const unsigned int
       start = (system_rhs_newton.local_range().first),
@@ -758,10 +772,10 @@ namespace Step42
       for (unsigned int j=start; j<end; j++)
         diag_mass_matrix_vector (j) = mass_matrix.diag_element (j);
       number_iterations = 0;
-      
+
       diag_mass_matrix_vector.compress (VectorOperation::insert);
 
-                                      // remove the mass matrix entries from the matrix:
+      // remove the mass matrix entries from the matrix:
       mass_matrix = 0;
 
       computing_timer.exit_section("Setup: matrix");
@@ -799,7 +813,7 @@ namespace Step42
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
                                                    endc = dof_handler.end();
@@ -922,7 +936,7 @@ namespace Step42
 
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const FEValuesExtractors::Vector displacement (0);
 
@@ -1018,7 +1032,7 @@ namespace Step42
   template <int dim>
   void PlasticityContactProblem<dim>::assemble_mass_matrix_diagonal (TrilinosWrappers::SparseMatrix &mass_matrix)
   {
-       QTrapez<dim-1>  face_quadrature_formula;
+    QTrapez<dim-1>  face_quadrature_formula;
 
     FEFaceValues<dim> fe_values_face (fe, face_quadrature_formula,
                                       update_values   |
@@ -1031,9 +1045,9 @@ namespace Step42
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Tensor<1,dim,double> ones (dim);
     for (unsigned i=0; i<dim; i++)
-       ones[i] = 1.0;
+      ones[i] = 1.0;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const FEValuesExtractors::Vector displacement (0);
 
@@ -1053,7 +1067,7 @@ namespace Step42
               for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
                 for (unsigned int i=0; i<dofs_per_cell; ++i)
                   cell_matrix(i,i) += (fe_values_face[displacement].value (i, q_point) *
-                                                          ones *
+                                       ones *
                                        fe_values_face.JxW (q_point));
 
               cell->get_dof_indices (local_dof_indices);
@@ -1271,8 +1285,8 @@ namespace Step42
     SolverControl solver_control (system_matrix_newton.m(), solver_tolerance);
     SolverBicgstab<TrilinosWrappers::MPI::Vector>
     solver(solver_control, mem,
-               SolverBicgstab<TrilinosWrappers::MPI::Vector>::
-               AdditionalData(false, 1.e-10));
+           SolverBicgstab<TrilinosWrappers::MPI::Vector>::
+           AdditionalData(false, 1.e-10));
 
     solver.solve(system_matrix_newton, distributed_solution, system_rhs_newton, preconditioner_u);
 
@@ -1397,9 +1411,9 @@ namespace Step42
             computing_timer.exit_section("Residual and lambda");
 
             pcout << "      Residual of the non-contact part of the system: " << resid
-                              << std::endl
-                              << "         with a damping parameter alpha = " << a
-                              << std::endl;
+                  << std::endl
+                  << "         with a damping parameter alpha = " << a
+                  << std::endl;
 
             // The previous iteration of step 0 is the solution of an elastic problem.
             // So a linear combination of a plastic and an elastic solution makes no sense
@@ -1416,7 +1430,7 @@ namespace Step42
         int is_my_set_changed = (active_set == active_set_old)?0:1;
         int num_changed = Utilities::MPI::sum(is_my_set_changed, MPI_COMM_WORLD);
         if (num_changed==0 && resid < 1e-8)
-                   break;
+          break;
         active_set_old = active_set;
       }
 
@@ -1431,7 +1445,7 @@ namespace Step42
   template <int dim>
   void PlasticityContactProblem<dim>::refine_grid ()
   {
-       Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
+    Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
     KellyErrorEstimator<dim>::estimate (dof_handler,
                                         QGauss<dim-1>(3),
                                         typename FunctionMap<dim>::type(),
@@ -1546,13 +1560,13 @@ namespace Step42
   template <int dim>
   void PlasticityContactProblem<dim>::run ()
   {
-       use_read_obstacle = false;
-       if (use_read_obstacle)
-       {
-               pcout << "Read the obstacle from a file." << std::endl;
-               input_obstacle.reset (new Input<dim>("obstacle_file.pbm"));
-               pcout << "Obstacle is available now." << std::endl;
-       }
+    use_read_obstacle = false;
+    if (use_read_obstacle)
+      {
+        pcout << "Read the obstacle from a file." << std::endl;
+        input_obstacle.reset (new Input<dim>("obstacle_file.pbm"));
+        pcout << "Obstacle is available now." << std::endl;
+      }
 
     const unsigned int n_cycles = 6;
     for (cycle=0; cycle<n_cycles; ++cycle)
@@ -1568,10 +1582,10 @@ namespace Step42
           }
         else
           {
-                computing_timer.enter_section("Setup: refine mesh");
-               soltrans.reset (new parallel::distributed::SolutionTransfer<dim,TrilinosWrappers::MPI::Vector>(dof_handler));
-               refine_grid ();
-               computing_timer.exit_section("Setup: refine mesh");
+            computing_timer.enter_section("Setup: refine mesh");
+            soltrans.reset (new parallel::distributed::SolutionTransfer<dim,TrilinosWrappers::MPI::Vector>(dof_handler));
+            refine_grid ();
+            computing_timer.exit_section("Setup: refine mesh");
           }
 
         setup_system ();
@@ -1580,8 +1594,8 @@ namespace Step42
           {
             TrilinosWrappers::MPI::Vector    distributed_solution (system_rhs_newton);
             distributed_solution = solution;
-               soltrans->interpolate(distributed_solution);
-               solution = distributed_solution;
+            soltrans->interpolate(distributed_solution);
+            solution = distributed_solution;
           }
 
         computing_timer.exit_section("Setup");
@@ -1618,7 +1632,7 @@ int main (int argc, char *argv[])
     int _n_refinements_global = 3;
 
     if (argc == 2)
-        _n_refinements_global = atoi(argv[1]);
+      _n_refinements_global = atoi(argv[1]);
 
     PlasticityContactProblem<3> laplace_problem_3d (_n_refinements_global);
     laplace_problem_3d.run ();
index f0532e4bd153919188c4f3f2f46c2649692cc9c3..446dd335c0286d80a5f80c30ca16bfd0eca67d7d 100644 (file)
@@ -9,7 +9,7 @@ following publications (in particular in the second one):
   media. Computers &amp; Fluids, 39:1585-1596, 2010
 - Chih-Che Chueh, Ned Djilali, Wolfgang Bangerth. An h-adaptive operator
   splitting method for two-phase flow in 3D heterogeneous porous
-  media. Submitted.
+  media. SIAM Journal on Scientific Computing, 35:B149-B175, 2013.
 
 The implementation discussed here uses and extends
 parts of the step-21 and step-31 tutorial programs.
@@ -548,13 +548,13 @@ cases are listed in the following table:
 CC Chueh, N Djilali and W Bangerth.
 <br> An h-adaptive operator splitting method for two-phase flow in 3D
   heterogeneous porous media.
-<br> <i>Submitted</i>, 2012.
+<br> SIAM Journal on Scientific Computing, vol. 35 (2013), pp. B149-B175
 
 <li>
 M. Kronbichler, T. Heister, and W. Bangerth
 <br> High Accuracy Mantle Convection Simulation through Modern Numerical
 Methods.
-<br> <i>Submitted to Geophysics Journal International</i>, 2011.
+<br> Geophysics Journal International, vol. 191 (2012), pp. 12-29
 
 <li>
 F Brezzi and M Fortin.
index 4086020fd7a8b630c2d64346314263b85e62e5ec..0e32b6ef66b2425862439f23f5a4acb807747005 100644 (file)
@@ -1,14 +1,23 @@
-/* Author: Chih-Che Chueh, University of Victoria, 2010 */
-/*         Wolfgang Bangerth, Texas A&M University, 2010 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2010 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2010-2012 by Chih-Che Chueh and the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+/*
+ * Authors: Chih-Che Chueh, University of Victoria, 2010
+ *          Wolfgang Bangerth, Texas A&M University, 2010
+ */
 
 
 // @sect3{Include files}
@@ -500,10 +509,10 @@ namespace Step43
                                             const FEValues<dim>             &darcy_fe_values,
                                             const double                     global_max_u_F_prime,
                                             const double                     global_S_variation,
-                                            const std::vector<unsigned int> &local_dof_indices);
+                                            const std::vector<types::global_dof_index> &local_dof_indices);
     void assemble_saturation_rhs_boundary_term (const FEFaceValues<dim>             &saturation_fe_face_values,
                                                 const FEFaceValues<dim>             &darcy_fe_face_values,
-                                                const std::vector<unsigned int>     &local_dof_indices);
+                                                const std::vector<types::global_dof_index>     &local_dof_indices);
     void solve ();
     void refine_mesh (const unsigned int              min_grid_level,
                       const unsigned int              max_grid_level);
@@ -709,7 +718,7 @@ namespace Step43
     }
 
 
-    std::vector<unsigned int> darcy_dofs_per_block (2);
+    std::vector<types::global_dof_index> darcy_dofs_per_block (2);
     DoFTools::count_dofs_per_block (darcy_dof_handler, darcy_dofs_per_block, darcy_block_component);
     const unsigned int n_u = darcy_dofs_per_block[0],
                        n_p = darcy_dofs_per_block[1],
@@ -893,7 +902,7 @@ namespace Step43
     std::vector<double>               old_saturation_values (n_q_points);
 
     FullMatrix<double>                local_matrix (dofs_per_cell, dofs_per_cell);
-    std::vector<unsigned int>         local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index>         local_dof_indices (dofs_per_cell);
 
     std::vector<Tensor<1,dim> > phi_u   (dofs_per_cell);
     std::vector<Tensor<1,dim> > grad_phi_p (dofs_per_cell);
@@ -1038,7 +1047,7 @@ namespace Step43
     FullMatrix<double>   local_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       local_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const PressureRightHandSide<dim>  pressure_right_hand_side;
     const PressureBoundaryValues<dim> pressure_boundary_values;
@@ -1235,7 +1244,7 @@ namespace Step43
     FullMatrix<double>   local_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       local_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = saturation_dof_handler.begin_active(),
@@ -1310,7 +1319,7 @@ namespace Step43
                                                           update_values);
 
     const unsigned int dofs_per_cell = saturation_dof_handler.get_fe().dofs_per_cell;
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const double                   global_max_u_F_prime = get_max_u_F_prime ();
     const std::pair<double,double> global_S_range       = get_extrapolated_saturation_range ();
@@ -1367,7 +1376,7 @@ namespace Step43
                                      const FEValues<dim>             &darcy_fe_values,
                                      const double                     global_max_u_F_prime,
                                      const double                     global_S_variation,
-                                     const std::vector<unsigned int> &local_dof_indices)
+                                     const std::vector<types::global_dof_index> &local_dof_indices)
   {
     const unsigned int dofs_per_cell = saturation_fe_values.dofs_per_cell;
     const unsigned int n_q_points    = saturation_fe_values.n_quadrature_points;
@@ -1440,7 +1449,7 @@ namespace Step43
   TwoPhaseFlowProblem<dim>::
   assemble_saturation_rhs_boundary_term (const FEFaceValues<dim>             &saturation_fe_face_values,
                                          const FEFaceValues<dim>             &darcy_fe_face_values,
-                                         const std::vector<unsigned int>     &local_dof_indices)
+                                         const std::vector<types::global_dof_index>     &local_dof_indices)
   {
     const unsigned int dofs_per_cell      = saturation_fe_face_values.dofs_per_cell;
     const unsigned int n_face_q_points    = saturation_fe_face_values.n_quadrature_points;
@@ -1771,9 +1780,9 @@ namespace Step43
     Vector<double> joint_solution (joint_dof_handler.n_dofs());
 
     {
-      std::vector<unsigned int> local_joint_dof_indices (joint_fe.dofs_per_cell);
-      std::vector<unsigned int> local_darcy_dof_indices (darcy_fe.dofs_per_cell);
-      std::vector<unsigned int> local_saturation_dof_indices (saturation_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_joint_dof_indices (joint_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_darcy_dof_indices (darcy_fe.dofs_per_cell);
+      std::vector<types::global_dof_index> local_saturation_dof_indices (saturation_fe.dofs_per_cell);
 
       typename DoFHandler<dim>::active_cell_iterator
       joint_cell      = joint_dof_handler.begin_active(),
index e1f3495346756596aaecc85647f77b5d3386afe9..18079d1da0ebd76ad282d038094e2b325c05b3c6 100644 (file)
@@ -1,13 +1,25 @@
-/* Authors: Jean-Paul Pelteret, University of Cape Town,            */
-/*          Andrew McBride, University of Erlangen-Nuremberg, 2010  */
-/*                                                                  */
-/*    Copyright (C) 2010-2012 by the deal.II authors         */
-/*                        & Jean-Paul Pelteret and Andrew McBride   */
-/*                                                                  */
-/*    This file is subject to QPL and may not be  distributed       */
-/*    without copyright and license information. Please refer       */
-/*    to the file deal.II/doc/license.html for the  text  and       */
-/*    further information on this license.                          */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2010 - 2013 by the deal.II authors and
+//                              & Jean-Paul Pelteret and Andrew McBride
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Authors: Jean-Paul Pelteret, University of Cape Town,
+ *          Andrew McBride, University of Erlangen-Nuremberg, 2010
+ */
+
 
 // We start by including all the necessary deal.II header files and some C++
 // related ones. They have been discussed in detail in previous tutorial
@@ -996,10 +1008,10 @@ namespace Step44
       J_dof = 2
     };
 
-    std::vector<unsigned int>        dofs_per_block;
-    std::vector<unsigned int>        element_indices_u;
-    std::vector<unsigned int>        element_indices_p;
-    std::vector<unsigned int>        element_indices_J;
+    std::vector<types::global_dof_index>  dofs_per_block;
+    std::vector<types::global_dof_index>        element_indices_u;
+    std::vector<types::global_dof_index>        element_indices_p;
+    std::vector<types::global_dof_index>        element_indices_J;
 
     // Rules for Gauss-quadrature on both the cell and faces. The number of
     // quadrature points on both cells and faces is recorded.
@@ -1209,7 +1221,7 @@ namespace Step44
   struct Solid<dim>::PerTaskData_K
   {
     FullMatrix<double>        cell_matrix;
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
 
     PerTaskData_K(const unsigned int dofs_per_cell)
       :
@@ -1290,7 +1302,7 @@ namespace Step44
   struct Solid<dim>::PerTaskData_RHS
   {
     Vector<double>            cell_rhs;
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
 
     PerTaskData_RHS(const unsigned int dofs_per_cell)
       :
@@ -1372,7 +1384,7 @@ namespace Step44
   struct Solid<dim>::PerTaskData_SC
   {
     FullMatrix<double>        cell_matrix;
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
 
     FullMatrix<double>        k_orig;
     FullMatrix<double>        k_pu;
@@ -1567,9 +1579,9 @@ namespace Step44
     // Setup the sparsity pattern and tangent matrix
     tangent_matrix.clear();
     {
-      const unsigned int n_dofs_u = dofs_per_block[u_dof];
-      const unsigned int n_dofs_p = dofs_per_block[p_dof];
-      const unsigned int n_dofs_J = dofs_per_block[J_dof];
+      const types::global_dof_index n_dofs_u = dofs_per_block[u_dof];
+      const types::global_dof_index n_dofs_p = dofs_per_block[p_dof];
+      const types::global_dof_index n_dofs_J = dofs_per_block[J_dof];
 
       BlockCompressedSimpleSparsityPattern csp(n_blocks, n_blocks);
 
@@ -3161,7 +3173,7 @@ int main (int argc, char *argv[])
   using namespace dealii;
   using namespace Step44;
 
-  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
+  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, dealii::numbers::invalid_unsigned_int);
 
   try
     {
index f876aa75ed9931d150252dff67b40479081eebee..040d713eb6f09ea98093ada6c565b6f9fae36754 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Markus Buerg, University of Karlsruhe, 2010 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2010-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2010 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Markus Buerg, University of Karlsruhe, 2010
+ */
 
 
 // @sect3{Include files}
@@ -316,7 +325,7 @@ namespace Step45
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     const RightHandSide right_hand_side;
 
index ffd556b8f5b67f4cd79d66b3c07819cb91ddd737..d3fb0d92bb03aa1194febfeb51d5e4959df087e5 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Wolfgang Bangerth, Texas A&M University, 2011 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2011 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, Texas A&M University, 2011
+ */
 
 
 // @sect3{Include files}
@@ -400,7 +409,7 @@ namespace Step46
     // solid. The following piece of code was already presented in the
     // introduction:
     {
-      std::vector<unsigned int> local_face_dof_indices (stokes_fe.dofs_per_face);
+      std::vector<types::global_dof_index> local_face_dof_indices (stokes_fe.dofs_per_face);
       for (typename hp::DoFHandler<dim>::active_cell_iterator
            cell = dof_handler.begin_active();
            cell != dof_handler.end(); ++cell)
@@ -544,8 +553,8 @@ namespace Step46
                                                       stokes_dofs_per_cell);
     Vector<double>            local_rhs;
 
-    std::vector<unsigned int> local_dof_indices;
-    std::vector<unsigned int> neighbor_dof_indices (stokes_dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices;
+    std::vector<types::global_dof_index> neighbor_dof_indices (stokes_dofs_per_cell);
 
     const RightHandSide<dim>  right_hand_side;
 
index 8d24f894f6157eb5901a3663922c66792bd5f268..fa212abae85ba45ce9fdc5822248266119fe327f 100644 (file)
@@ -1,13 +1,22 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 2000 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2011 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 2000
+ */
 
 
 #include <deal.II/base/quadrature_lib.h>
@@ -280,7 +289,7 @@ namespace Step47
     FullMatrix<double>   cell_matrix;
     Vector<double>       cell_rhs;
 
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
 
     const Coefficient<dim> coefficient;
     std::vector<double>    coefficient_values (n_q_points);
@@ -424,7 +433,7 @@ namespace Step47
       }
 
 
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
                                               0,
                                               ZeroFunction<dim>(2),
index 79250490eda176d66461b53ecf6582a748b92a2f..a37cc84d43531dd64fea97f55388e3d8d62256e1 100644 (file)
@@ -1,14 +1,22 @@
-/* $Id$ */
-/* Author: Katharina Kormann, Martin Kronbichler, Uppsala University, 2011-2012 */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2011-2013 by the deal.II authors             */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2011 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Katharina Kormann, Martin Kronbichler, Uppsala University, 2011-2012
+ */
 
 
 // The necessary files from the deal.II library.
@@ -280,7 +288,7 @@ namespace Step48
     void make_grid_and_dofs ();
     void oldstyle_operation ();
     void assemble_system ();
-    void output_results (const unsigned int timestep_number) const;
+    void output_results (const unsigned int timestep_number);
 
 #ifdef DEAL_II_WITH_P4EST
     parallel::distributed::Triangulation<dim>   triangulation;
@@ -422,31 +430,34 @@ namespace Step48
   // This function prints the norm of the solution and writes the solution
   // vector to a file. The norm is standard (except for the fact that we need
   // to be sure to only count norms on locally owned cells), and the second is
-  // similar to what we did in step-40. However, we first need to generate an
-  // appropriate vector for output: The ones we used during time stepping
-  // contained information about ghosts dofs that one needs write access to
-  // during the loops over cell. However, that is not the same as needed when
-  // outputting. So we first initialize a vector with locally relevant degrees
-  // of freedom by copying the solution (note how we use the function @p
-  // copy_from to transfer data between vectors with the same local range, but
-  // different layouts of ghosts). Then, we import the values on the ghost
-  // DoFs and then distribute the constraints (as constraints are zero in the
-  // vectors during loop over all cells).
+  // similar to what we did in step-40. Note that we can use the same vector
+  // for output as we used for computation: The vectors in the matrix-free
+  // framework always provide full information on all locally owned cells
+  // (this is what is needed in the local evaluations, too), including ghost
+  // vector entries on these cells. This is the only data that is needed in
+  // the integrate_difference function as well as in DataOut. We only need to
+  // make sure that we tell the vector to update its ghost values before we
+  // read them. This is a feature present only in the
+  // parallel::distributed::Vector class. Distributed vectors with PETSc and
+  // Trilinos, on the other hand, need to be copied to special vectors
+  // including ghost values (see the relevant section in step-40). If we
+  // wanted to access all degrees of freedom on ghost cells, too (e.g. when
+  // computing error estimators that use the jump of solution over cell
+  // boundaries), we would need more information and create a vector
+  // initialized with locally relevant dofs just as in step-40. Observe also
+  // that we need to distribute constraints for output - they are not filled
+  // during computations (rather, they are distributed on the fly in the
+  // matrix-free method read_dof_values).
   template <int dim>
   void
-  SineGordonProblem<dim>::output_results (const unsigned int timestep_number) const
+  SineGordonProblem<dim>::output_results (const unsigned int timestep_number)
   {
-    parallel::distributed::Vector<double> locally_relevant_solution;
-    locally_relevant_solution.reinit (dof_handler.locally_owned_dofs(),
-                                      locally_relevant_dofs,
-                                      MPI_COMM_WORLD);
-    locally_relevant_solution.copy_from (solution);
-    locally_relevant_solution.update_ghost_values ();
-    constraints.distribute (locally_relevant_solution);
+    constraints.distribute (solution);
 
     Vector<float> norm_per_cell (triangulation.n_active_cells());
+    solution.update_ghost_values();
     VectorTools::integrate_difference (dof_handler,
-                                       locally_relevant_solution,
+                                       solution,
                                        ZeroFunction<dim>(),
                                        norm_per_cell,
                                        QGauss<dim>(fe_degree+1),
@@ -463,15 +474,15 @@ namespace Step48
     DataOut<dim> data_out;
 
     data_out.attach_dof_handler (dof_handler);
-    data_out.add_data_vector (locally_relevant_solution, "solution");
+    data_out.add_data_vector (solution, "solution");
     data_out.build_patches ();
 
     const std::string filename =
       "solution-" + Utilities::int_to_string (timestep_number, 3);
 
     std::ofstream output ((filename +
-      "." + Utilities::int_to_string (Utilities::MPI::
-                                      this_mpi_process(MPI_COMM_WORLD),4) + ".vtu").c_str());
+                           "." + Utilities::int_to_string (Utilities::MPI::
+                                                           this_mpi_process(MPI_COMM_WORLD),4) + ".vtu").c_str());
     data_out.write_vtu (output);
 
     if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
@@ -501,10 +512,10 @@ namespace Step48
   // the finest mesh size. The finest mesh size is computed as the diameter of
   // the last cell in the triangulation, which is the last cell on the finest
   // level of the mesh. This is only possible for Cartesian meshes, otherwise,
-  // one needs to loop over all cells). Note that we need to query all the
+  // one needs to loop over all cells. Note that we need to query all the
   // processors for their finest cell since the not all processors might hold
   // a region where the mesh is at the finest level. Then, we readjust the
-  // time step a little to hit the final time exactly if necessary.
+  // time step a little to hit the final time exactly.
   template <int dim>
   void
   SineGordonProblem<dim>::run ()
@@ -555,15 +566,15 @@ namespace Step48
     //
     // Note how this shift is implemented: We simply call the swap method on
     // the two vectors which swaps only some pointers without the need to copy
-    // data around. Obviously, this is a more efficient way to move data
-    // around. Let us see what happens in more detail: First, we exchange
-    // <code>old_solution</code> with <code>old_old_solution</code>, which
-    // means that <code>old_old_solution</code> gets
-    // <code>old_solution</code>, which is what we expect. Similarly,
-    // <code>old_solution</code> gets the content from <code>solution</code>
-    // in the next step. Afterward, <code>solution</code> holds
-    // <code>old_old_solution</code>, but that will be overwritten during this
-    // step.
+    // data around. Obviously, this is a more efficient way to update the
+    // vectors during time stepping. Let us see what happens in more detail:
+    // First, we exchange <code>old_solution</code> with
+    // <code>old_old_solution</code>, which means that
+    // <code>old_old_solution</code> gets <code>old_solution</code>, which is
+    // what we expect. Similarly, <code>old_solution</code> gets the content
+    // from <code>solution</code> in the next step. Afterward,
+    // <code>solution</code> holds <code>old_old_solution</code>, but that
+    // will be overwritten during this step.
     unsigned int timestep_number = 1;
 
     Timer timer;
index 2592717ce2d1bfd54616beed5a79ce1282dd5069..f3042fd32b017ee13061e65524fabedce18a947d 100644 (file)
@@ -1,11 +1,21 @@
-/* $Id$
- *
- * Copyright (C) 2013 by the deal.II authors
- *
- * This file is subject to QPL and may not be  distributed
- * without copyright and license information. Please refer
- * to the file deal.II/doc/license.html for the  text  and
- * further information on this license.
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Timo Heister, Texas A&M University, 2013
  */
 
 
@@ -49,7 +59,7 @@ using namespace dealii;
 // format that can easily be visualized in the same way as was done in step-1.
 template<int dim>
 void mesh_info(const Triangulation<dim> &tria,
-              const std::string        &filename)
+               const std::string        &filename)
 {
   std::cout << "Mesh info:" << std::endl
             << " dimension: " << dim << std::endl
@@ -87,8 +97,8 @@ void mesh_info(const Triangulation<dim> &tria,
   GridOut grid_out;
   grid_out.write_eps (tria, out);
   std::cout << " written to " << filename
-           << std::endl
-           << std::endl;
+            << std::endl
+            << std::endl;
 }
 
 // @sect3{Main routines}
@@ -129,7 +139,7 @@ void grid_2 ()
   repetitions[1]=2;
   GridGenerator::subdivided_hyper_rectangle (tria2, repetitions,
                                              Point<2>(1.0,-1.0),
-                                            Point<2>(4.0,1.0));
+                                             Point<2>(4.0,1.0));
 
   Triangulation<2> triangulation;
   GridGenerator::merge_triangulations (tria1, tria2, triangulation);
@@ -244,7 +254,7 @@ void grid_4()
 Point<2> grid_5_transform (const Point<2> &in)
 {
   return Point<2>(in(0),
-                 in(1) + std::sin(in(0)/5.0*3.14159));
+                  in(1) + std::sin(in(0)/5.0*3.14159));
 }
 
 
@@ -256,7 +266,7 @@ void grid_5()
   repetitions[1] = 2;
   GridGenerator::subdivided_hyper_rectangle (tria, repetitions,
                                              Point<2>(0.0,0.0),
-                                            Point<2>(10.0,1.0));
+                                             Point<2>(10.0,1.0));
 
   GridTools::transform(&grid_5_transform, tria);
   mesh_info(tria, "grid-5.eps");
@@ -276,16 +286,16 @@ void grid_5()
 // vertices.
 struct Grid6Func
 {
-    double trans(const double y) const
-      {
-       return std::tanh(2*y)/tanh(2);
-      }
+  double trans(const double y) const
+  {
+    return std::tanh(2*y)/tanh(2);
+  }
 
-    Point<2> operator() (const Point<2> & in) const
-      {
-       return Point<2> (in(0),
-                        trans(in(1)));
-      }
+  Point<2> operator() (const Point<2> &in) const
+  {
+    return Point<2> (in(0),
+                     trans(in(1)));
+  }
 };
 
 
@@ -296,7 +306,7 @@ void grid_6()
   repetitions[0] = repetitions[1] = 40;
   GridGenerator::subdivided_hyper_rectangle (tria, repetitions,
                                              Point<2>(0.0,0.0),
-                                            Point<2>(1.0,1.0));
+                                             Point<2>(1.0,1.0));
 
   GridTools::transform(Grid6Func(), tria);
   mesh_info(tria, "grid-6.eps");
@@ -318,7 +328,7 @@ void grid_7()
   repetitions[0] = repetitions[1] = 16;
   GridGenerator::subdivided_hyper_rectangle (tria, repetitions,
                                              Point<2>(0.0,0.0),
-                                            Point<2>(1.0,1.0));
+                                             Point<2>(1.0,1.0));
 
   GridTools::distort_random (0.3, tria, true);
   mesh_info(tria, "grid-7.eps");
index 0430781c5cd93433fb42930b9d6552775661a73a..acaa49edd1ae9d5a4c79f9ca6180478a5841be71 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 1999 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1999 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 1999
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 1999-2004, 2006-2008, 2010-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -304,7 +314,7 @@ void Step5<dim>::assemble_system ()
   FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
   Vector<double>       cell_rhs (dofs_per_cell);
 
-  std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   // Here is one difference: for this program, we will again use a constant
   // right hand side function and zero boundary values, but a variable
@@ -387,7 +397,7 @@ void Step5<dim>::assemble_system ()
     }
 
   // With the matrix so built, we use zero boundary values again:
-  std::map<unsigned int,double> boundary_values;
+  std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
                                             ZeroFunction<dim>(),
@@ -533,7 +543,7 @@ void Step5<dim>::output_results (const unsigned int cycle) const
 
 // The second to last thing in this program is the definition of the
 // <code>run()</code> function. In contrast to the previous programs, we will
-// compute on a sequence of meshes that after each iteration is globall
+// compute on a sequence of meshes that after each iteration is globally
 // refined. The function therefore consists of a loop over 6 cycles. In each
 // cycle, we first print the cycle number, and then have to decide what to do
 // with the mesh. If this is not the first cycle, we simply refine the
index abca04f105575435e15b6b8271a1d2e78fe5db41..b76f929eee3fc60a6fb8c0f070f05b7ba3533fa6 100644 (file)
@@ -1,15 +1,25 @@
-/* Author: Guido Kanschat, University of Heidelberg, 2003  */
-/*         Baerbel Janssen, University of Heidelberg, 2010 */
-/*         Wolfgang Bangerth, Texas A&M University, 2010   */
-
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors                   */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2003 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Guido Kanschat, University of Heidelberg, 2003
+ *         Baerbel Janssen, University of Heidelberg, 2010
+ *         Wolfgang Bangerth, Texas A&M University, 2010
+ */
+
 
 // parallel geometric multi-grid. work in progress!
 
@@ -137,6 +147,8 @@ namespace Step50
 
     matrix_t system_matrix;
 
+    IndexSet locally_relevant_set;
+
     // We need an additional object for the
     // hanging nodes constraints. They are
     // handed to the transfer object in the
@@ -285,7 +297,10 @@ namespace Step50
     fe (degree),
     mg_dof_handler (triangulation),
     degree(degree)
-  {}
+  {
+    if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)!=0)
+      deallog.depth_console(0);
+  }
 
 
 
@@ -298,21 +313,6 @@ namespace Step50
   template <int dim>
   void LaplaceProblem<dim>::setup_system ()
   {
-    std::string filename = "grid-"
-      + Utilities::int_to_string(triangulation.n_levels(), 2)
-      + "-"
-      + Utilities::int_to_string (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD), 3)
-      + ".svg";
-    
-    std::ofstream out (filename.c_str());
-    GridOut grid_out;
-    GridOutFlags::Svg svg_flags;
-    svg_flags.polar_angle = 60;
-    svg_flags.label_level_subdomain_id = true;
-    svg_flags.convert_level_number_to_height = true;
-    grid_out.set_flags(svg_flags);
-    grid_out.write_svg (triangulation, out);
-    
     mg_dof_handler.distribute_dofs (fe);
     mg_dof_handler.distribute_mg_dofs (fe);
 
@@ -324,11 +324,14 @@ namespace Step50
     deallog << "Number of degrees of freedom: "
             << mg_dof_handler.n_dofs();
 
-    for (unsigned int l=0; l<triangulation.n_levels(); ++l)
+    for (unsigned int l=0; l<triangulation.n_global_levels(); ++l)
       deallog << "   " << 'L' << l << ": "
               << mg_dof_handler.n_dofs(l);
     deallog  << std::endl;
 
+    DoFTools::extract_locally_relevant_dofs (mg_dof_handler,
+                                             locally_relevant_set);
+
 
     //solution.reinit (mg_dof_handler.n_dofs());
     //system_rhs.reinit (mg_dof_handler.n_dofs());
@@ -355,15 +358,15 @@ namespace Step50
     // correctly into the global linear system
     // right away, without the need for a later
     // clean-up stage:
-    constraints.clear ();
-    hanging_node_constraints.clear ();
+    constraints.reinit (locally_relevant_set);
+    hanging_node_constraints.reinit (locally_relevant_set);
     DoFTools::make_hanging_node_constraints (mg_dof_handler, hanging_node_constraints);
     DoFTools::make_hanging_node_constraints (mg_dof_handler, constraints);
 
     typename FunctionMap<dim>::type      dirichlet_boundary;
     ZeroFunction<dim>                    homogeneous_dirichlet_bc (1);
     dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
-    VectorTools::interpolate_boundary_values (static_cast<const DoFHandler<dim>&>(mg_dof_handler),
+    VectorTools::interpolate_boundary_values (mg_dof_handler,
                                               dirichlet_boundary,
                                               constraints);
     constraints.close ();
@@ -397,7 +400,7 @@ namespace Step50
     // SparseMatrix classes, since they have to
     // release their SparsityPattern before the
     // can be destroyed upon resizing.
-    const unsigned int n_levels = triangulation.n_levels();
+    const unsigned int n_levels = triangulation.n_global_levels();
 
     mg_interface_matrices.resize(0, n_levels-1);
     mg_interface_matrices.clear ();
@@ -438,9 +441,14 @@ namespace Step50
         MGTools::make_sparsity_pattern(mg_dof_handler, csp, level);
 
         mg_matrices[level].reinit(mg_dof_handler.locally_owned_mg_dofs(level),
-            mg_dof_handler.locally_owned_mg_dofs(level),
-            csp,
-            MPI_COMM_WORLD, true);
+                                  mg_dof_handler.locally_owned_mg_dofs(level),
+                                  csp,
+                                  MPI_COMM_WORLD, true);
+
+        mg_interface_matrices[level].reinit(mg_dof_handler.locally_owned_mg_dofs(level),
+                                            mg_dof_handler.locally_owned_mg_dofs(level),
+                                            csp,
+                                            MPI_COMM_WORLD, true);
       }
   }
 
@@ -516,6 +524,9 @@ namespace Step50
                                                   local_dof_indices,
                                                   system_matrix, system_rhs);
         }
+
+    system_matrix.compress(VectorOperation::add);
+    system_rhs.compress(VectorOperation::add);
   }
 
 
@@ -555,67 +566,49 @@ namespace Step50
     const Coefficient<dim> coefficient;
     std::vector<double>    coefficient_values (n_q_points);
 
-    // Next a few things that are specific to
-    // building the multigrid data structures
-    // (since we only need them in the current
-    // function, rather than also elsewhere, we
-    // build them here instead of the
-    // <code>setup_system</code>
-    // function). Some of the following may be
-    // a bit obscure if you're not familiar
-    // with the algorithm actually implemented
-    // in deal.II to support multilevel
-    // algorithms on adaptive meshes; if some
-    // of the things below seem strange, take a
-    // look at the @ref mg_paper.
+    // Next a few things that are specific to building the multigrid
+    // data structures (since we only need them in the current
+    // function, rather than also elsewhere, we build them here
+    // instead of the <code>setup_system</code> function). Some of the
+    // following may be a bit obscure if you're not familiar with the
+    // algorithm actually implemented in deal.II to support multilevel
+    // algorithms on adaptive meshes; if some of the things below seem
+    // strange, take a look at the @ref mg_paper.
     //
-    // Our first job is to identify those
-    // degrees of freedom on each level that
-    // are located on interfaces between
-    // adaptively refined levels, and those
-    // that lie on the interface but also on
-    // the exterior boundary of the domain. As
-    // in many other parts of the library, we
-    // do this by using boolean masks,
-    // i.e. vectors of booleans each element of
-    // which indicates whether the
-    // corresponding degree of freedom index is
-    // an interface DoF or not. The <code>MGConstraints</code>
-    // already computed the information for us
-    // when we called initialize in <code>setup_system()</code>.
+    // Our first job is to identify those degrees of freedom on each
+    // level that are located on interfaces between adaptively refined
+    // levels, and those that lie on the interface but also on the
+    // exterior boundary of the domain. As in many other parts of the
+    // library, we do this by using boolean masks, i.e. vectors of
+    // booleans each element of which indicates whether the
+    // corresponding degree of freedom index is an interface DoF or
+    // not. The <code>MGConstraints</code> already computed the
+    // information for us when we called initialize in
+    // <code>setup_system()</code>.
     std::vector<std::vector<bool> > interface_dofs
       = mg_constrained_dofs.get_refinement_edge_indices ();
     std::vector<std::vector<bool> > boundary_interface_dofs
       = mg_constrained_dofs.get_refinement_edge_boundary_indices ();
 
-    // The indices just identified will later
-    // be used to decide where the assembled value
-    // has to be added into on each level.
-    // On the other hand,
-    // we also have to impose zero boundary
-    // conditions on the external boundary of
-    // each level. But this the <code>MGConstraints</code>
-    // knows it. So we simply ask for them by calling
-    // <code>get_boundary_indices ()</code>.
-    // The third step is to construct
-    // constraints on all those degrees of
-    // freedom: their value should be zero
-    // after each application of the level
-    // operators. To this end, we construct
-    // ConstraintMatrix objects for each level,
-    // and add to each of these constraints for
-    // each degree of freedom. Due to the way
-    // the ConstraintMatrix stores its data,
-    // the function to add a constraint on a
-    // single degree of freedom and force it to
-    // be zero is called
-    // Constraintmatrix::add_line(); doing so
-    // for several degrees of freedom at once
-    // can be done using
+    // The indices just identified will later be used to decide where
+    // the assembled value has to be added into on each level.  On the
+    // other hand, we also have to impose zero boundary conditions on
+    // the external boundary of each level. But this the
+    // <code>MGConstraints</code> knows it. So we simply ask for them
+    // by calling <code>get_boundary_indices ()</code>.  The third
+    // step is to construct constraints on all those degrees of
+    // freedom: their value should be zero after each application of
+    // the level operators. To this end, we construct ConstraintMatrix
+    // objects for each level, and add to each of these constraints
+    // for each degree of freedom. Due to the way the ConstraintMatrix
+    // stores its data, the function to add a constraint on a single
+    // degree of freedom and force it to be zero is called
+    // Constraintmatrix::add_line(); doing so for several degrees of
+    // freedom at once can be done using
     // Constraintmatrix::add_lines():
-    std::vector<ConstraintMatrix> boundary_constraints (triangulation.n_levels());
-    std::vector<ConstraintMatrix> boundary_interface_constraints (triangulation.n_levels());
-    for (unsigned int level=0; level<triangulation.n_levels(); ++level)
+    std::vector<ConstraintMatrix> boundary_constraints (triangulation.n_global_levels());
+    std::vector<ConstraintMatrix> boundary_interface_constraints (triangulation.n_global_levels());
+    for (unsigned int level=0; level<triangulation.n_global_levels(); ++level)
       {
         boundary_constraints[level].add_lines (interface_dofs[level]);
         boundary_constraints[level].add_lines (mg_constrained_dofs.get_boundary_indices()[level]);
@@ -626,20 +619,14 @@ namespace Step50
         boundary_interface_constraints[level].close ();
       }
 
-    // Now that we're done with most of our
-    // preliminaries, let's start the
-    // integration loop. It looks mostly like
-    // the loop in
-    // <code>assemble_system</code>, with two
-    // exceptions: (i) we don't need a right
-    // hand side, and more significantly (ii) we
-    // don't just loop over all active cells,
-    // but in fact all cells, active or
-    // not. Consequently, the correct iterator
-    // to use is MGDoFHandler::cell_iterator
-    // rather than
-    // MGDoFHandler::active_cell_iterator. Let's
-    // go about it:
+    // Now that we're done with most of our preliminaries, let's start
+    // the integration loop. It looks mostly like the loop in
+    // <code>assemble_system</code>, with two exceptions: (i) we don't
+    // need a right hand side, and more significantly (ii) we don't
+    // just loop over all active cells, but in fact all cells, active
+    // or not. Consequently, the correct iterator to use is
+    // MGDoFHandler::cell_iterator rather than
+    // MGDoFHandler::active_cell_iterator. Let's go about it:
     typename DoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
                                             endc = mg_dof_handler.end();
 
@@ -660,85 +647,60 @@ namespace Step50
                                      fe_values.shape_grad(j,q_point) *
                                      fe_values.JxW(q_point));
 
-          // The rest of the assembly is again
-          // slightly different. This starts with
-          // a gotcha that is easily forgotten:
-          // The indices of global degrees of
-          // freedom we want here are the ones
-          // for current level, not for the
-          // global matrix. We therefore need the
-          // function
-          // MGDoFAccessorLLget_mg_dof_indices,
-          // not MGDoFAccessor::get_dof_indices
-          // as used in the assembly of the
-          // global system:
+          // The rest of the assembly is again slightly
+          // different. This starts with a gotcha that is easily
+          // forgotten: The indices of global degrees of freedom we
+          // want here are the ones for current level, not for the
+          // global matrix. We therefore need the function
+          // MGDoFAccessorLLget_mg_dof_indices, not
+          // MGDoFAccessor::get_dof_indices as used in the assembly of
+          // the global system:
           cell->get_mg_dof_indices (local_dof_indices);
 
-          // Next, we need to copy local
-          // contributions into the level
-          // objects. We can do this in the same
-          // way as in the global assembly, using
-          // a constraint object that takes care
-          // of constrained degrees (which here
-          // are only boundary nodes, as the
-          // individual levels have no hanging
-          // node constraints). Note that the
-          // <code>boundary_constraints</code>
-          // object makes sure that the level
-          // matrices contains no contributions
-          // from degrees of freedom at the
-          // interface between cells of different
+          // Next, we need to copy local contributions into the level
+          // objects. We can do this in the same way as in the global
+          // assembly, using a constraint object that takes care of
+          // constrained degrees (which here are only boundary nodes,
+          // as the individual levels have no hanging node
+          // constraints). Note that the
+          // <code>boundary_constraints</code> object makes sure that
+          // the level matrices contains no contributions from degrees
+          // of freedom at the interface between cells of different
           // refinement level.
           boundary_constraints[cell->level()]
           .distribute_local_to_global (cell_matrix,
                                        local_dof_indices,
                                        mg_matrices[cell->level()]);
 
-          // The next step is again slightly more
-          // obscure (but explained in the @ref
-          // mg_paper): We need the remainder of
-          // the operator that we just copied
-          // into the <code>mg_matrices</code>
-          // object, namely the part on the
-          // interface between cells at the
-          // current level and cells one level
-          // coarser. This matrix exists in two
-          // directions: for interior DoFs (index
-          // $i$) of the current level to those
-          // sitting on the interface (index
-          // $j$), and the other way around. Of
-          // course, since we have a symmetric
-          // operator, one of these matrices is
-          // the transpose of the other.
+          // The next step is again slightly more obscure (but
+          // explained in the @ref mg_paper): We need the remainder of
+          // the operator that we just copied into the
+          // <code>mg_matrices</code> object, namely the part on the
+          // interface between cells at the current level and cells
+          // one level coarser. This matrix exists in two directions:
+          // for interior DoFs (index $i$) of the current level to
+          // those sitting on the interface (index $j$), and the other
+          // way around. Of course, since we have a symmetric
+          // operator, one of these matrices is the transpose of the
+          // other.
           //
-          // The way we assemble these matrices
-          // is as follows: since the are formed
-          // from parts of the local
-          // contributions, we first delete all
-          // those parts of the local
-          // contributions that we are not
-          // interested in, namely all those
-          // elements of the local matrix for
-          // which not $i$ is an interface DoF
-          // and $j$ is not. The result is one of
-          // the two matrices that we are
-          // interested in, and we then copy it
-          // into the
-          // <code>mg_interface_matrices</code>
-          // object. The
-          // <code>boundary_interface_constraints</code>
-          // object at the same time makes sure
-          // that we delete contributions from
-          // all degrees of freedom that are not
-          // only on the interface but also on
-          // the external boundary of the domain.
+          // The way we assemble these matrices is as follows: since
+          // the are formed from parts of the local contributions, we
+          // first delete all those parts of the local contributions
+          // that we are not interested in, namely all those elements
+          // of the local matrix for which not $i$ is an interface DoF
+          // and $j$ is not. The result is one of the two matrices
+          // that we are interested in, and we then copy it into the
+          // <code>mg_interface_matrices</code> object. The
+          // <code>boundary_interface_constraints</code> object at the
+          // same time makes sure that we delete contributions from
+          // all degrees of freedom that are not only on the interface
+          // but also on the external boundary of the domain.
           //
-          // The last part to remember is how to
-          // get the other matrix. Since it is
-          // only the transpose, we will later
-          // (in the <code>solve()</code>
-          // function) be able to just pass the
-          // transpose matrix where necessary.
+          // The last part to remember is how to get the other
+          // matrix. Since it is only the transpose, we will later (in
+          // the <code>solve()</code> function) be able to just pass
+          // the transpose matrix where necessary.
           for (unsigned int i=0; i<dofs_per_cell; ++i)
             for (unsigned int j=0; j<dofs_per_cell; ++j)
               if ( !(interface_dofs[cell->level()][local_dof_indices[i]]==true &&
@@ -750,61 +712,56 @@ namespace Step50
                                        local_dof_indices,
                                        mg_interface_matrices[cell->level()]);
         }
+
+    for (unsigned int i=0; i<triangulation.n_global_levels(); ++i)
+      {
+        mg_matrices[i].compress(VectorOperation::add);
+        mg_interface_matrices[i].compress(VectorOperation::add);
+      }
   }
 
 
 
   // @sect4{LaplaceProblem::solve}
 
-  // This is the other function that is
-  // significantly different in support of the
-  // multigrid solver (or, in fact, the
-  // preconditioner for which we use the
-  // multigrid method).
+  // This is the other function that is significantly different in
+  // support of the multigrid solver (or, in fact, the preconditioner
+  // for which we use the multigrid method).
   //
-  // Let us start out by setting up two of the
-  // components of multilevel methods: transfer
-  // operators between levels, and a solver on
-  // the coarsest level. In finite element
-  // methods, the transfer operators are
-  // derived from the finite element function
-  // spaces involved and can often be computed
-  // in a generic way independent of the
-  // problem under consideration. In that case,
-  // we can use the MGTransferPrebuilt class
-  // that, given the constraints on the global
-  // level and an MGDoFHandler object computes
-  // the matrices corresponding to these
-  // transfer operators.
+  // Let us start out by setting up two of the components of
+  // multilevel methods: transfer operators between levels, and a
+  // solver on the coarsest level. In finite element methods, the
+  // transfer operators are derived from the finite element function
+  // spaces involved and can often be computed in a generic way
+  // independent of the problem under consideration. In that case, we
+  // can use the MGTransferPrebuilt class that, given the constraints
+  // on the global level and an MGDoFHandler object computes the
+  // matrices corresponding to these transfer operators.
   //
-  // The second part of the following lines
-  // deals with the coarse grid solver. Since
-  // our coarse grid is very coarse indeed, we
-  // decide for a direct solver (a Householder
-  // decomposition of the coarsest level
-  // matrix), even if its implementation is not
-  // particularly sophisticated. If our coarse
-  // mesh had many more cells than the five we
-  // have here, something better suited would
-  // obviously be necessary here.
+  // The second part of the following lines deals with the coarse grid
+  // solver. Since our coarse grid is very coarse indeed, we decide
+  // for a direct solver (a Householder decomposition of the coarsest
+  // level matrix), even if its implementation is not particularly
+  // sophisticated. If our coarse mesh had many more cells than the
+  // five we have here, something better suited would obviously be
+  // necessary here.
   template <int dim>
   void LaplaceProblem<dim>::solve ()
   {
 
-    // Create the object that deals with the transfer
-    // between different refinement levels. We need to
-    // pass it the hanging node constraints.
+    // Create the object that deals with the transfer between
+    // different refinement levels. We need to pass it the hanging
+    // node constraints.
     MGTransferPrebuilt<vector_t> mg_transfer(hanging_node_constraints, mg_constrained_dofs);
-    // Now the prolongation matrix has to be built.
-    // This matrix needs to take the boundary values on
-    // each level into account and needs to know about
-    // the indices at the refinement egdes. The
-    // <code>MGConstraints</code> knows about that so
-    // pass it as an argument.
+    // Now the prolongation matrix has to be built.  This matrix needs
+    // to take the boundary values on each level into account and
+    // needs to know about the indices at the refinement egdes. The
+    // <code>MGConstraints</code> knows about that so pass it as an
+    // argument.
     mg_transfer.build_matrices(mg_dof_handler);
 
-    matrix_t coarse_matrix;
-    coarse_matrix.copy_from (mg_matrices[0]);
+    matrix_t &coarse_matrix = mg_matrices[0];
+    //coarse_matrix.copy_from (mg_matrices[0]);
     //MGCoarseGridHouseholder<double,vector_t> coarse_grid_solver;
     //coarse_grid_solver.initialize (coarse_matrix);
 
@@ -815,38 +772,27 @@ namespace Step50
         coarse_matrix,
         id);
 
-    // The next component of a multilevel
-    // solver or preconditioner is that we need
-    // a smoother on each level. A common
-    // choice for this is to use the
-    // application of a relaxation method (such
-    // as the SOR, Jacobi or Richardson method). The
-    // MGSmootherPrecondition class provides
-    // support for this kind of
-    // smoother. Here, we opt for the
-    // application of a single SOR
-    // iteration. To this end, we define an
-    // appropriate <code>typedef</code> and
-    // then setup a smoother object.
+    // The next component of a multilevel solver or preconditioner is
+    // that we need a smoother on each level. A common choice for this
+    // is to use the application of a relaxation method (such as the
+    // SOR, Jacobi or Richardson method). The MGSmootherPrecondition
+    // class provides support for this kind of smoother. Here, we opt
+    // for the application of a single SOR iteration. To this end, we
+    // define an appropriate <code>typedef</code> and then setup a
+    // smoother object.
     //
-    // The last step is to initialize the
-    // smoother object with our level matrices
-    // and to set some smoothing parameters.
-    // The <code>initialize()</code> function
-    // can optionally take additional arguments
-    // that will be passed to the smoother
-    // object on each level. In the current
-    // case for the SOR smoother, this could,
-    // for example, include a relaxation
-    // parameter. However, we here leave these
-    // at their default values. The call to
-    // <code>set_steps()</code> indicates that
-    // we will use two pre- and two
-    // post-smoothing steps on each level; to
-    // use a variable number of smoother steps
-    // on different levels, more options can be
-    // set in the constructor call to the
-    // <code>mg_smoother</code> object.
+    // The last step is to initialize the smoother object with our
+    // level matrices and to set some smoothing parameters.  The
+    // <code>initialize()</code> function can optionally take
+    // additional arguments that will be passed to the smoother object
+    // on each level. In the current case for the SOR smoother, this
+    // could, for example, include a relaxation parameter. However, we
+    // here leave these at their default values. The call to
+    // <code>set_steps()</code> indicates that we will use two pre-
+    // and two post-smoothing steps on each level; to use a variable
+    // number of smoother steps on different levels, more options can
+    // be set in the constructor call to the <code>mg_smoother</code>
+    // object.
     //
     // The last step results from the fact that
     // we use the SOR method as a smoother -
@@ -857,11 +803,11 @@ namespace Step50
     // preconditioner make sure that we get a
     // symmetric operator even for nonsymmetric
     // smoothers:
-    typedef TrilinosWrappers::PreconditionSOR Smoother;
+    typedef TrilinosWrappers::PreconditionJacobi Smoother;
     MGSmootherPrecondition<matrix_t, Smoother, vector_t> mg_smoother;
     mg_smoother.initialize(mg_matrices);
     mg_smoother.set_steps(2);
-    mg_smoother.set_symmetric(true);
+    //mg_smoother.set_symmetric(false);
 
     // The next preparatory step is that we
     // must wrap our level and interface
@@ -889,6 +835,7 @@ namespace Step50
                             mg_transfer,
                             mg_smoother,
                             mg_smoother);
+    //mg.set_debug(6);
     mg.set_edge_matrices(mg_interface_down, mg_interface_up);
 
     PreconditionMG<dim, vector_t, MGTransferPrebuilt<vector_t> >
@@ -897,13 +844,35 @@ namespace Step50
     // With all this together, we can finally
     // get about solving the linear system in
     // the usual way:
-    SolverControl solver_control (1000, 1e-12);
+    SolverControl solver_control (500, 1e-8*system_rhs.l2_norm(), false);
     SolverCG<vector_t>    cg (solver_control);
 
     solution = 0;
 
-    cg.solve (system_matrix, solution, system_rhs,
-              preconditioner);
+    if (false)
+      {
+        // code to optionally compare to Trilinos ML
+        TrilinosWrappers::PreconditionAMG prec;
+
+        TrilinosWrappers::PreconditionAMG::AdditionalData Amg_data;
+        //    Amg_data.constant_modes = constant_modes;
+        Amg_data.elliptic = true;
+        Amg_data.higher_order_elements = true;
+        Amg_data.smoother_sweeps = 2;
+        Amg_data.aggregation_threshold = 0.02;
+        // Amg_data.symmetric = true;
+
+        prec.initialize (system_matrix,
+                         Amg_data);
+        cg.solve (system_matrix, solution, system_rhs,
+                  prec);
+      }
+    else
+      {
+        cg.solve (system_matrix, solution, system_rhs,
+                  preconditioner);
+      }
+
     constraints.distribute (solution);
   }
 
@@ -932,14 +901,19 @@ namespace Step50
   {
     Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
+    TrilinosWrappers::MPI::Vector temp_solution;
+    temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD);
+    temp_solution = solution;
+
     KellyErrorEstimator<dim>::estimate (static_cast<DoFHandler<dim>&>(mg_dof_handler),
                                         QGauss<dim-1>(3),
                                         typename FunctionMap<dim>::type(),
-                                        solution,
+                                        temp_solution,
                                         estimated_error_per_cell);
-    GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                     estimated_error_per_cell,
-                                                     0.3, 0.03);
+    parallel::distributed::GridRefinement::
+    refine_and_coarsen_fixed_fraction (triangulation,
+                                       estimated_error_per_cell,
+                                       0.3, 0.03);
     triangulation.execute_coarsening_and_refinement ();
   }
 
@@ -950,17 +924,58 @@ namespace Step50
   {
     DataOut<dim> data_out;
 
-    data_out.attach_dof_handler (mg_dof_handler);
-    data_out.add_data_vector (solution, "solution");
-    data_out.build_patches ();
+    TrilinosWrappers::MPI::Vector temp_solution;
+    temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD);
+    temp_solution = solution;
+
 
-    std::ostringstream filename;
-    filename << "solution-"
-             << cycle
-             << ".vtk";
+    TrilinosWrappers::MPI::Vector temp = solution;
+    system_matrix.residual(temp,solution,system_rhs);
+    TrilinosWrappers::MPI::Vector res_ghosted = temp_solution;
+    res_ghosted = temp;
 
-    std::ofstream output (filename.str().c_str());
-    data_out.write_vtk (output);
+    data_out.attach_dof_handler (mg_dof_handler);
+    data_out.add_data_vector (temp_solution, "solution");
+    data_out.add_data_vector (res_ghosted, "res");
+    Vector<float> subdomain (triangulation.n_active_cells());
+    for (unsigned int i=0; i<subdomain.size(); ++i)
+      subdomain(i) = triangulation.locally_owned_subdomain();
+    data_out.add_data_vector (subdomain, "subdomain");
+
+    data_out.build_patches (3);
+
+    const std::string filename = ("solution-" +
+                                  Utilities::int_to_string (cycle, 5) +
+                                  "." +
+                                  Utilities::int_to_string
+                                  (triangulation.locally_owned_subdomain(), 4) +
+                                  ".vtu");
+    std::ofstream output (filename.c_str());
+    data_out.write_vtu (output);
+
+    if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
+      {
+        std::vector<std::string> filenames;
+        for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); ++i)
+          filenames.push_back (std::string("solution-") +
+                               Utilities::int_to_string (cycle, 5) +
+                               "." +
+                               Utilities::int_to_string(i, 4) +
+                               ".vtu");
+        const std::string
+        pvtu_master_filename = ("solution-" +
+                                Utilities::int_to_string (cycle, 5) +
+                                ".pvtu");
+        std::ofstream pvtu_master (pvtu_master_filename.c_str());
+        data_out.write_pvtu_record (pvtu_master, filenames);
+
+        const std::string
+        visit_master_filename = ("solution-" +
+                                 Utilities::int_to_string (cycle, 5) +
+                                 ".visit");
+        std::ofstream visit_master (visit_master_filename.c_str());
+        data_out.write_visit_record (visit_master, filenames);
+      }
   }
 
 
@@ -977,7 +992,7 @@ namespace Step50
   template <int dim>
   void LaplaceProblem<dim>::run ()
   {
-    for (unsigned int cycle=0; cycle<8; ++cycle)
+    for (unsigned int cycle=0; cycle<13; ++cycle)
       {
         deallog << "Cycle " << cycle << ':' << std::endl;
 
@@ -985,17 +1000,13 @@ namespace Step50
           {
             GridGenerator::hyper_cube (triangulation);
 
-            // static const HyperBallBoundary<dim> boundary;
-            // triangulation.set_boundary (0, boundary);
-
-            triangulation.refine_global (2);
+            triangulation.refine_global (3);
           }
         else
           refine_grid ();
 
-
         deallog << "   Number of active cells:       "
-                << triangulation.n_active_cells()
+                << triangulation.n_global_active_cells()
                 << std::endl;
 
         setup_system ();
@@ -1003,9 +1014,9 @@ namespace Step50
         deallog << "   Number of degrees of freedom: "
                 << mg_dof_handler.n_dofs()
                 << " (by level: ";
-        for (unsigned int level=0; level<triangulation.n_levels(); ++level)
+        for (unsigned int level=0; level<triangulation.n_global_levels(); ++level)
           deallog << mg_dof_handler.n_dofs(level)
-                  << (level == triangulation.n_levels()-1
+                  << (level == triangulation.n_global_levels()-1
                       ? ")" : ", ");
         deallog << std::endl;
 
index 7a5ab147781defae5973482363fff8554c4a2312..ea45447cb6d7a450d6e31c0ac0fc039bfceff3dd 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 2000 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2000 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 2000
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2000-2004, 2006-2008, 2010-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -397,7 +407,7 @@ void Step6<dim>::assemble_system ()
   FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
   Vector<double>       cell_rhs (dofs_per_cell);
 
-  std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   const Coefficient<dim> coefficient;
   std::vector<double>    coefficient_values (n_q_points);
index 8e0d0bde1424e06454f5b05dc04f4d7d0fe5b321..ff5a243964c683416aab4a814ca6a5107f985d64 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth and Ralf Hartmann, University of Heidelberg, 2000 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2000 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth and Ralf Hartmann, University of Heidelberg, 2000
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2000-2004, 2006-2009, 2011-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -233,7 +243,7 @@ namespace Step7
   // share the same connotation that points have and are only objects in a
   // more abstract space than the one spanned by the coordinate
   // directions. (In fact, gradients live in `reciprocal' space, since the
-  // dimension of their components is not that of a length, but one over
+  // dimension of their components is not that of a length, but of one over
   // length).
   template <int dim>
   Tensor<1,dim> Solution<dim>::gradient (const Point<dim>   &p,
@@ -563,7 +573,7 @@ namespace Step7
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     // Then we need objects which can evaluate the values, gradients, etc of
     // the shape functions at the quadrature points. While it seems that it
@@ -722,7 +732,7 @@ namespace Step7
     hanging_node_constraints.condense (system_matrix);
     hanging_node_constraints.condense (system_rhs);
 
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
                                               0,
                                               Solution<dim>(),
index 2b75487b3e0eb6008c6359d7a5e19d00e8a4b5c5..b63fa0db1a39aa2d8f3165d792b101892d0789fe 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 2000 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2000 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 2000
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2000-2004, 2006-2008, 2010-2012 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // @sect3{Include files}
 
@@ -380,7 +390,7 @@ namespace Step8
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
     Vector<double>       cell_rhs (dofs_per_cell);
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     // As was shown in previous examples as well, we need a place where to
     // store the values of the coefficients at all the quadrature points on a
@@ -548,7 +558,7 @@ namespace Step8
     // object would represent a scalar function. Since the solution vector has
     // <code>dim</code> components, we need to pass <code>dim</code> as number
     // of components to the zero function as well.
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
                                               0,
                                               ZeroFunction<dim>(dim),
index 9a9bef869896a0ed15c13f8dab20212210f9702d..26df070fef7d25167bfaa4d96f804a9f3ad421bf 100644 (file)
@@ -1,13 +1,23 @@
-/* Author: Wolfgang Bangerth, University of Heidelberg, 2000 */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2000 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Author: Wolfgang Bangerth, University of Heidelberg, 2000
+ */
 
-/*    $Id$       */
-/*                                                                */
-/*    Copyright (C) 2000-2004, 2006-2008, 2010-2013 by the deal.II authors */
-/*                                                                */
-/*    This file is subject to QPL and may not be  distributed     */
-/*    without copyright and license information. Please refer     */
-/*    to the file deal.II/doc/license.html for the  text  and     */
-/*    further information on this license.                        */
 
 // Just as in previous examples, we have to include several files of which the
 // meaning has already been discussed:
@@ -142,7 +152,7 @@ namespace Step9
   // @sect3{Equation data declaration}
 
   // Next we declare a class that describes the advection field. This, of
-  // course, is a vector field with as many compents as there are space
+  // course, is a vector field with as many components as there are space
   // dimensions. One could now use a class derived from the
   // <code>Function</code> base class, as we have done for boundary values and
   // coefficients in previous examples, but there is another possibility in
@@ -391,7 +401,7 @@ namespace Step9
   // rather than the common vectors of doubles, as the additional accuracy is
   // not necessary for estimated values.
   //
-  // In addition to these two functions, the class declares to exceptions
+  // In addition to these two functions, the class declares two exceptions
   // which are raised when a cell has no neighbors in each of the space
   // directions (in which case the matrix described in the introduction would
   // be singular and can't be inverted), while the other one is used in the
@@ -510,11 +520,11 @@ namespace Step9
     // configured for multi-threading, then the number of CPUs is set to one.)
     // However, sometimes there might be reasons to use another value. For
     // example, you might want to use less processors than there are in your
-    // system in order not to use too many computational ressources. On the
+    // system in order not to use too many computational resources. On the
     // other hand, if there are several jobs running on a computer and you
     // want to get a higher percentage of CPU time, it might be worth to start
     // more threads than there are CPUs, as most operating systems assign
-    // roughly the same CPU ressources to all threads presently running. For
+    // roughly the same CPU resources to all threads presently running. For
     // this reason, the <code>MultithreadInfo</code> class contains a
     // read-write variable <code>n_default_threads</code> which is set to
     // <code>n_cpus</code> by default, but can be set to another value. This
@@ -576,7 +586,7 @@ namespace Step9
     // differ (<code>begin_active</code> returns an
     // <code>active_iterator</code>, while <code>end</code> returns a
     // <code>raw_iterator</code>), and in this case the C++ language requires
-    // us to specify the template type explicitely. For brevity, we first
+    // us to specify the template type explicitly. For brevity, we first
     // typedef this data type to an alias.
     typedef typename DoFHandler<dim>::active_cell_iterator active_cell_iterator;
     std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
@@ -611,8 +621,8 @@ namespace Step9
     // When all the threads are running, the only thing we have to do is wait
     // for them to finish. This is necessary of course, as we can't proceed
     // with our tasks before the matrix and right hand side are
-    // assemblesd. Waiting for all the threads to finish can be done using the
-    // <code>joint_all</code> function in the <code>ThreadGroup</code>
+    // assembled. Waiting for all the threads to finish can be done using the
+    // <code>join_all</code> function in the <code>ThreadGroup</code>
     // container, which just calls <code>join</code> on each of the thread
     // objects it stores.
     //
@@ -621,7 +631,7 @@ namespace Step9
     threads.join_all ();
 
 
-    // After the matrix has been assembled in parallel, we stil have to
+    // After the matrix has been assembled in parallel, we still have to
     // eliminate hanging node constraints. This is something that can't be
     // done on each of the threads separately, so we have to do it now.
     hanging_node_constraints.condense (system_matrix);
@@ -685,7 +695,7 @@ namespace Step9
 
     // ... an array to hold the global indices of the degrees of freedom of
     // the cell on which we are presently working...
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     // ... and array in which the values of right hand side, advection
     // direction, and boundary values will be stored, for cell and face
@@ -816,7 +826,7 @@ namespace Step9
         //
         // On the other hand, we would now like to write the local
         // contributions to the global system of equations into the global
-        // objects. This needs some kind of synchronisation, as if we would
+        // objects. This needs some kind of synchronization, as if we would
         // not take care of the fact that multiple threads write into the
         // matrix at the same time, we might be surprised that one threads
         // reads data from the matrix that another thread is presently
index 8cf4306ebdfc0f412ac56ee34622e8070eeffe77..973a950db44b35305b66e8b3141bbe0e0c2d031c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Configure config.h
index 46810d0beba5d48efeafce94ad95d1a838e06063..23ac4519a45f6eff5932310dc1db2be84f7a4a13 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__newton_h
 #define __deal2__newton_h
index a7b81721bb31a0c0c4009708301204f306a2307c..a57c34d23329501f60329337ca6783a72f6862f5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012 by Guido Kanschat
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/algorithms/newton.h>
 
index f4e407d1e156cc6baf250b397c5728d62aa07059..de940de86f07cd1f3074209beae9fd065148f7f5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__operator_h
 #define __deal2__operator_h
 
 DEAL_II_NAMESPACE_OPEN
 
+/**
+ * Namespace containing numerical algorithms in a unified form.
+ *
+ * All algorithmic classes in this namespace are derived from either
+ * Operator or OutputOperator, depending on whether they return a
+ * value or not. See the documentation of those classes for more
+ * detailed information on how to use them.
+ *
+ * @author Guido Kanschat
+ * @date 2012, 2013
+ */
 namespace Algorithms
 {
   /**
index bfab37b2d92f7827aafe68c69b3f5b654bf3f99d..173d10b9b733de1a6ad25d2a818338018988d5c8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012 by Guido Kanschat
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/algorithms/operator.h>
 
index 3dc9fa5d82f471947e112000429be3a0c751f9b4..e1a2d0c40da81136f3e56b0e259135cdf89c3118 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__theta_timestepping_h
 #define __deal2__theta_timestepping_h
index 5dd1d33e121eb27870f6632533736692394cb7d3..b0f1366641c76df8dea34edef1fe7e7d9df00c2d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012 by Guido Kanschat
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/algorithms/theta_timestepping.h>
 
index 4a2b28a8742f6ff69d5e3e00c89501afa7e364cc..551caadb27af57108666afbf07befcc8ab20c95a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by Guido Kanschat
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__time_step_control_h
 #define __deal2__time_step_control_h
index c85d9ff92876e365b59d33024faf14113f23a3c6..1275360d54d6171aaa0a316725754454213183c8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__auto_derivative_function_h
 #define __deal2__auto_derivative_function_h
 
index 753ade963e773a7e7cf40565215a26a307826110..0a105240df23702ee1382f90c8268c7b48da4469 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__conditional_ostream_h
 #define __deal2__conditional_ostream_h
 
index 9e21898d6686b1dfd47d6b8bf87e2d5b4c4bef30..43d43659069e330b10ffbda9a73f282362be2ab9 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2012 by the deal.II authors
+//    Copyright (C) 2012, 2013 by the deal.II authors
 //
 //    TODO: Header
 //
 #define DEAL_II_NAMESPACE_CLOSE }
 
 
+/***********************************************
+ * Configured in setup_cached_variables.cmake: *
+ ***********************************************/
+
+#cmakedefine DEAL_II_WITH_64BIT_INDICES
+#ifdef DEAL_II_WITH_64BIT_INDICES
+#  define DEAL_II_USE_LARGE_INDEX_TYPE
+#endif
+
+
 /**************************************
  * Configured in setup_deal_ii.cmake: *
  **************************************/
 #  define DEAL_II_USE_MT
 #endif
 
-/* Defined if multi-threading is to be achieved by using the POSIX functions
+/**
+ * Defined if multi-threading is to be achieved by using the POSIX functions
  */
 #cmakedefine DEAL_II_USE_MT_POSIX
 
index a262a6be3b555fff7b48296cb203020fa6164681..70c940c4828d7d887bf2bfae4264b6b761818f98 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__convergence_table_h
 #define __deal2__convergence_table_h
 
@@ -188,7 +193,7 @@ public:
    * omitted (see previous function) and execpt of the columns that are
    * previously evaluated rate columns.  This function allows to evaluate the
    * convergence rate for almost all columns of a table without calling
-   * evaluate_convergence_rates() for each column seperately.
+   * evaluate_convergence_rates() for each column separately.
    *
    * Example:
    * Columns like <tt>n cells</tt> or <tt>n dofs</tt> columns may be wanted to
index 0ce000d902f85d3baf50f624b1871fe911107d24..b054a3a822151596ec3a91bf1d646a6759c698b7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__data_out_base_h
 #define __deal2__data_out_base_h
 
@@ -1274,66 +1279,66 @@ public:
    */
   struct SvgFlags
   {
-    public:
-      /**
-       * This denotes the number of the
-       * data vector which shall be used
-       * for generating the height
-       * information. By default, the
-       * first data vector is taken,
-       * i.e. <tt>height_vector==0</tt>, if
-       * there is any data vector. If there
-       * is no data vector, no height
-       * information is generated.
-       */
-      unsigned int height_vector;      
+  public:
+    /**
+     * This denotes the number of the
+     * data vector which shall be used
+     * for generating the height
+     * information. By default, the
+     * first data vector is taken,
+     * i.e. <tt>height_vector==0</tt>, if
+     * there is any data vector. If there
+     * is no data vector, no height
+     * information is generated.
+     */
+    unsigned int height_vector;
 
-      /*
-       * Angles for the perspective view
-       */
-      int azimuth_angle, polar_angle;
-      
-      unsigned int line_thickness;
+    /*
+     * Angles for the perspective view
+     */
+    int azimuth_angle, polar_angle;
 
-      /*
-       * Draw a margin of 5% around the plotted area
-       */
-      bool margin;
+    unsigned int line_thickness;
 
-      /*
-       * Draw a colorbar encoding the cell coloring 
-       */
-      bool draw_colorbar;
+    /*
+     * Draw a margin of 5% around the plotted area
+     */
+    bool margin;
 
-      /*
-       * Constructor.
-       */
-      SvgFlags(const unsigned int height_vector = 0,
-               const int azimuth_angle = 37,
-               const int polar_angle = 45,
-               const unsigned int line_thickness = 1,
-               const bool margin = true,
-               const bool draw_colorbar = true);
+    /*
+     * Draw a colorbar encoding the cell coloring
+     */
+    bool draw_colorbar;
 
-      /**
-       * Determine an estimate for
-       * the memory consumption (in
-       * bytes) of this
-       * object. Since sometimes
-       * the size of objects can
-       * not be determined exactly
-       * (for example: what is the
-       * memory consumption of an
-       * STL <tt>std::map</tt> type with a
-       * certain number of
-       * elements?), this is only
-       * an estimate. however often
-       * quite close to the true
-       * value.
-     */
-      std::size_t memory_consumption () const;
-
-    private:
+    /*
+     * Constructor.
+     */
+    SvgFlags(const unsigned int height_vector = 0,
+             const int azimuth_angle = 37,
+             const int polar_angle = 45,
+             const unsigned int line_thickness = 1,
+             const bool margin = true,
+             const bool draw_colorbar = true);
+
+    /**
+     * Determine an estimate for
+     * the memory consumption (in
+     * bytes) of this
+     * object. Since sometimes
+     * the size of objects can
+     * not be determined exactly
+     * (for example: what is the
+     * memory consumption of an
+     * STL <tt>std::map</tt> type with a
+     * certain number of
+     * elements?), this is only
+     * an estimate. however often
+     * quite close to the true
+     * value.
+    */
+    std::size_t memory_consumption () const;
+
+  private:
 
   };
 
@@ -1491,7 +1496,7 @@ public:
     vtu,
 
     /**
-     * Output in 
+     * Output in
      * SVG format.
      */
     svg,
@@ -1865,23 +1870,23 @@ public:
                               const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
                               const VtkFlags                          &flags,
                               std::ostream                            &out);
-  
+
   /**
    * Write the given list of patches to the output stream in SVG format.
    *
-   * SVG (Scalable Vector Graphics) is an XML-based vector image format 
-   * developed and maintained by the World Wide Web Consortium (W3C). 
-   * This function conforms to the latest specification SVG 1.1, 
+   * SVG (Scalable Vector Graphics) is an XML-based vector image format
+   * developed and maintained by the World Wide Web Consortium (W3C).
+   * This function conforms to the latest specification SVG 1.1,
    * released on August 16, 2011. Controlling the graphic output is
-   * possible by setting or clearing the respective flags (see the 
-   * SvgFlags struct). At present, this format only supports output 
+   * possible by setting or clearing the respective flags (see the
+   * SvgFlags struct). At present, this format only supports output
    * for two-dimensional data, with values in the third direction
    * taken from a data vector.
-   * 
-   * For the output, each patch is subdivided into four triangles 
-   * which are then written as polygons and filled with a linear 
-   * color gradient. The arising coloring of the patches visualizes 
-   * the data values at the vertices taken from the specified data 
+   *
+   * For the output, each patch is subdivided into four triangles
+   * which are then written as polygons and filled with a linear
+   * color gradient. The arising coloring of the patches visualizes
+   * the data values at the vertices taken from the specified data
    * vector. A colorbar can be drawn to encode the coloring.
    *
    * @note Yet only implemented for two dimensions with an additional
@@ -1893,7 +1898,7 @@ public:
                          const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
                          const SvgFlags                          &flags,
                          std::ostream                            &out);
-  
+
   /**
    * Write the given list of patches to the output stream in deal.II
    * intermediate format. This is not a format understood by any other
@@ -2124,19 +2129,19 @@ private:
 
 
   /**
-   * This function projects a three-dimensional point (Point<3> point) 
-   * onto a two-dimensional image plane, specified by the position of 
-   * the camera viewing system (Point<3> camera_position), camera 
-   * direction (Point<3> camera_position), camera horizontal (Point<3> 
-   * camera_horizontal, necessary for the correct alignment of the 
+   * This function projects a three-dimensional point (Point<3> point)
+   * onto a two-dimensional image plane, specified by the position of
+   * the camera viewing system (Point<3> camera_position), camera
+   * direction (Point<3> camera_position), camera horizontal (Point<3>
+   * camera_horizontal, necessary for the correct alignment of the
    * later images), and the focus of the camera (float camera_focus).
    *
    * For SVG output.
    */
-  static Point<2> svg_project_point(Point<3> point, 
-                                    Point<3> camera_position, 
-                                    Point<3> camera_direction, 
-                                    Point<3> camera_horizontal, 
+  static Point<2> svg_project_point(Point<3> point,
+                                    Point<3> camera_position,
+                                    Point<3> camera_direction,
+                                    Point<3> camera_horizontal,
                                     float camera_focus);
   /**
    * Function to compute the gradient parameters for
@@ -2676,7 +2681,7 @@ public:
    * in SVG format. See
    * DataOutBase::write_svg.
    */
-  void write_svg(std::ostream &out) const; 
+  void write_svg(std::ostream &out) const;
 
   /**
    * Obtain data through get_patches()
index 40d75b649bdbbf349139d168a37c1cb4439bbc2c..313c3437591f08d649e202886eeab93605e467cb 100644 (file)
@@ -1,3 +1,19 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__derivative_form_h
 #define __deal2__derivative_form_h
 
@@ -344,7 +360,7 @@ DerivativeForm<order,dim,spacedim>::covariant_form() const
 
       Tensor<2,dim> DF_t (dealii::transpose(invert(  (Tensor<2,dim>)(*this)   )));
       DerivativeForm<1,dim, spacedim> result = DF_t;
-      return(result);
+      return (result);
     }
   else
     {
index 7d1b92cb6a1ab115c4c4e7acfb9f7041acb2f999..4ceeed33ec4ce4282da9a0fef0d57960b4b0998a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__event_h
 #define __deal2__event_h
index 94867d5767d8e20d2b31ff95b85e6c639caa545d..ffea72d31a8a26dc22a0a9c91cddf4e1aae875d6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__exceptions_h
 #define __deal2__exceptions_h
 
@@ -79,7 +84,7 @@ public:
 
   /**
    * Print more specific information about the exception which
-   * occured. Overload this function in your own exception classes.
+   * occurred. Overload this function in your own exception classes.
    */
   virtual void print_info (std::ostream &out) const;
 
@@ -148,7 +153,7 @@ namespace deal_II_exceptions
    * processes is redirected to the same console window. In this case,
    * it is convenient to set as additional name the name of the host on
    * which the program runs, so that one can see in which instance of the
-   * program the exception occured.
+   * program the exception occurred.
    *
    * The string pointed to by the argument is copied, so doesn't need to be
    * stored after the call to this function.
@@ -677,6 +682,16 @@ namespace StandardExceptions
                   << "Index " << arg1 << " is not in [" << arg2 << ","
                   << arg3 << "[");
 
+  /**
+   * This generic exception will allow(enforce) the user to specify
+   * the type of indices which adds type safety to the program.
+   */
+  template<typename T>
+  DeclException3 (ExcIndexRangeType,
+                  T,T,T,
+                  << "Index " << arg1 << " is not in [" << arg2 << ","
+                  << arg3 << "[");
+
   /**
    * A number is too small.
    */
@@ -685,6 +700,15 @@ namespace StandardExceptions
                   << "Number " << arg1 << " must be larger or equal "
                   << arg2);
 
+  /**
+   * A generic exception definition for the ExcLowerRange above.
+   */
+  template<typename T>
+  DeclException2 (ExcLowerRangeType,
+                  T, T,
+                  << "Number " << arg1 << " must be larger or equal "
+                  << arg2);
+
   /**
    * This exception indicates that the first argument should be an
    * integer multiple of the second, but is not.
@@ -805,6 +829,9 @@ namespace StandardExceptions
 #define AssertIndexRange(index,range) Assert((index) < (range), \
                                              ExcIndexRange((index),0,(range)))
 
+#define AssertGlobalIndexRange(index,range) Assert((index) < (range), \
+                                                   ExcIndexRange<types::global_dof_index>((index),0,(range)))
+
 using namespace StandardExceptions;
 
 DEAL_II_NAMESPACE_CLOSE
index 7c5671e79adf2265480849b30ecead9716320bd6..3f6c58547f0f11d82a05769dd1151f9857d43e54 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__flow_function_h
 #define __deal2__flow_function_h
 
index fafa9ded88657ac7d0813a4e95f82576d5d073db..616f6de210deb93dc2691556cf60af8ecbd35280 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__function_h
 #define __deal2__function_h
 
@@ -114,11 +119,8 @@ class Function : public FunctionTime,
 {
 public:
   /**
-   * Export the value of the
-   * template parameter as a static
-   * member constant. Sometimes
-   * useful for some expression
-   * template programming.
+   * Export the value of the template parameter as a static member
+   * constant. Sometimes useful for some expression template programming.
    */
   static const unsigned int dimension = dim;
 
@@ -128,20 +130,15 @@ public:
   const unsigned int n_components;
 
   /**
-   * Constructor. May take an
-   * initial value for the number
-   * of components (which defaults
-   * to one, i.e. a scalar
-   * function), and the time
-   * variable, which defaults to
-   * zero.
+   * Constructor. May take an initial value for the number of components
+   * (which defaults to one, i.e. a scalar function), and the time
+   * variable, which defaults to zero.
    */
   Function (const unsigned int n_components = 1,
             const double       initial_time = 0.0);
 
   /**
-   * Virtual destructor; absolutely
-   * necessary in this case.
+   * Virtual destructor; absolutely necessary in this case.
    *
    * This destructor is declared pure virtual, such that objects of this class
    * cannot be created. Since all the other virtual functions have a
@@ -158,220 +155,160 @@ public:
    * the abstractness of any derived class even if they do not have an
    * explicitly declared destructor.
    *
-   * Nonetheless, since derived
-   * classes want to call the
-   * destructor of a base class,
-   * this destructor is implemented
-   * (despite it being pure
+   * Nonetheless, since derived classes want to call the destructor of a
+   * base class, this destructor is implemented (despite it being pure
    * virtual).
    */
   virtual ~Function () = 0;
 
   /**
-   * Assignment operator. This is
-   * here only so that you can have
-   * objects of derived classes in
-   * containers, or assign them
-   * otherwise. It will raise an
-   * exception if the object from
-   * which you assign has a
-   * different number of components
-   * than the one being assigned
-   * to.
+   * Assignment operator. This is here only so that you can have objects of
+   * derived classes in containers, or assign them otherwise. It will raise
+   * an exception if the object from which you assign has a different
+   * number of components than the one being assigned to.
    */
   Function &operator= (const Function &f);
 
   /**
-   * Return the value of the
-   * function at the given
-   * point. Unless there is only
-   * one component (i.e. the
-   * function is scalar), you
-   * should state the component you
-   * want to have evaluated; it
-   * defaults to zero, i.e. the
+   * Return the value of the function at the given point. Unless there is
+   * only one component (i.e. the function is scalar), you should state the
+   * component you want to have evaluated; it defaults to zero, i.e. the
    * first component.
    */
   virtual double value (const Point<dim>   &p,
                         const unsigned int  component = 0) const;
 
   /**
-   * Return all components of a
-   * vector-valued function at a
-   * given point.
+   * Return all components of a vector-valued function at a given point.
    *
-   * <tt>values</tt> shall have the right
-   * size beforehand,
-   * i.e. #n_components.
+   * <tt>values</tt> shall have the right size beforehand, i.e.
+   * #n_components.
    */
   virtual void vector_value (const Point<dim>   &p,
                              Vector<double>     &values) const;
 
   /**
-   * Set <tt>values</tt> to the point
-   * values of the specified
-   * component of the function at
-   * the <tt>points</tt>.  It is assumed
-   * that <tt>values</tt> already has the
-   * right size, i.e.  the same
-   * size as the <tt>points</tt> array.
+   * Set <tt>values</tt> to the point values of the specified component of
+   * the function at the <tt>points</tt>.  It is assumed that
+   * <tt>values</tt> already has the right size, i.e.  the same size as the
+   * <tt>points</tt> array.
    *
-   * Be default, this function
-   * repeatedly calls value() for
-   * each point separately, to
-   * fill the output array.
+   * Be default, this function repeatedly calls value() for each point
+   * separately, to fill the output array.
    */
   virtual void value_list (const std::vector<Point<dim> > &points,
                            std::vector<double>            &values,
                            const unsigned int              component = 0) const;
 
   /**
-   * Set <tt>values</tt> to the point
-   * values of the function at the
-   * <tt>points</tt>.  It is assumed that
-   * <tt>values</tt> already has the right
-   * size, i.e.  the same size as
-   * the <tt>points</tt> array, and that
-   * all elements be vectors with
-   * the same number of components
-   * as this function has.
+   * Set <tt>values</tt> to the point values of the function at the
+   * <tt>points</tt>.  It is assumed that <tt>values</tt> already has the
+   * right size, i.e.  the same size as the <tt>points</tt> array, and that
+   * all elements be vectors with the same number of components as this
+   * function has.
    *
-   * Be default, this function
-   * repeatedly calls vector_value() for
-   * each point separately, to
-   * fill the output array.
+   * Be default, this function repeatedly calls vector_value() for each
+   * point separately, to fill the output array.
    */
   virtual void vector_value_list (const std::vector<Point<dim> > &points,
                                   std::vector<Vector<double> >   &values) const;
 
   /**
-   * For each component of the
-   * function, fill a vector of
-   * values, one for each point.
+   * For each component of the function, fill a vector of values, one for
+   * each point.
    *
-   * The default implementation of
-   * this function in Function calls
-   * value_list() for each
-   * component. In order to improve
-   * performance, this can be
-   * reimplemented in derived
-   * classes to speed up performance.
+   * The default implementation of this function in Function calls
+   * value_list() for each component. In order to improve performance, this
+   * can be reimplemented in derived classes to speed up performance.
    */
   virtual void vector_values (const std::vector<Point<dim> > &points,
                               std::vector<std::vector<double> > &values) const;
 
   /**
-   * Return the gradient of the
-   * specified component of the
-   * function at the given point.
+   * Return the gradient of the specified component of the function at the
+   * given point.
    */
   virtual Tensor<1,dim> gradient (const Point<dim>   &p,
                                   const unsigned int  component = 0) const;
 
   /**
-   * Return the gradient of all
-   * components of the
-   * function at the given point.
+   * Return the gradient of all components of the function at the given
+   * point.
    */
   virtual void vector_gradient (const Point<dim>            &p,
                                 std::vector<Tensor<1,dim> > &gradients) const;
 
   /**
-   * Set <tt>gradients</tt> to the
-   * gradients of the specified
-   * component of the function at
-   * the <tt>points</tt>.  It is assumed
-   * that <tt>gradients</tt> already has the
-   * right size, i.e.  the same
-   * size as the <tt>points</tt> array.
+   * Set <tt>gradients</tt> to the gradients of the specified component of
+   * the function at the <tt>points</tt>.  It is assumed that
+   * <tt>gradients</tt> already has the right size, i.e.  the same size as
+   * the <tt>points</tt> array.
    */
   virtual void gradient_list (const std::vector<Point<dim> > &points,
                               std::vector<Tensor<1,dim> >    &gradients,
                               const unsigned int              component = 0) const;
 
   /**
-   * For each component of the
-   * function, fill a vector of
-   * gradient values, one for each point.
+   * For each component of the function, fill a vector of gradient values,
+   * one for each point.
    *
-   * The default implementation of
-   * this function in Function calls
-   * value_list() for each
-   * component. In order to improve
-   * performance, this can be
-   * reimplemented in derived
-   * classes to speed up performance.
+   * The default implementation of this function in Function calls
+   * value_list() for each component. In order to improve performance, this
+   * can be reimplemented in derived classes to speed up performance.
    */
   virtual void vector_gradients (const std::vector<Point<dim> >            &points,
                                  std::vector<std::vector<Tensor<1,dim> > > &gradients) const;
 
   /**
-   * Set <tt>gradients</tt> to the gradients of
-   * the function at the <tt>points</tt>,
-   * for all components.
-   * It is assumed that <tt>gradients</tt>
-   * already has the right size, i.e.
-   * the same size as the <tt>points</tt> array.
+   * Set <tt>gradients</tt> to the gradients of the function at the
+   * <tt>points</tt>, for all components. It is assumed that
+   * <tt>gradients</tt> already has the right size, i.e. the same size as
+   * the <tt>points</tt> array.
    *
-   * The outer loop over
-   * <tt>gradients</tt> is over the points
-   * in the list, the inner loop
-   * over the different components
-   * of the function.
+   * The outer loop over <tt>gradients</tt> is over the points in the list,
+   * the inner loop over the different components of the function.
    */
   virtual void vector_gradient_list (const std::vector<Point<dim> >            &points,
                                      std::vector<std::vector<Tensor<1,dim> > > &gradients) const;
 
   /**
-   * Compute the Laplacian of a
-   * given component at point <tt>p</tt>.
+   * Compute the Laplacian of a given component at point <tt>p</tt>.
    */
   virtual double laplacian (const Point<dim>   &p,
                             const unsigned int  component = 0) const;
 
   /**
-   * Compute the Laplacian of all
-   * components at point <tt>p</tt> and
-   * store them in <tt>values</tt>.
+   * Compute the Laplacian of all components at point <tt>p</tt> and store
+   * them in <tt>values</tt>.
    */
   virtual void vector_laplacian (const Point<dim>   &p,
                                  Vector<double>     &values) const;
 
   /**
-   * Compute the Laplacian of one
-   * component at a set of points.
+   * Compute the Laplacian of one component at a set of points.
    */
   virtual void laplacian_list (const std::vector<Point<dim> > &points,
                                std::vector<double>            &values,
                                const unsigned int              component = 0) const;
 
   /**
-   * Compute the Laplacians of all
-   * components at a set of points.
+   * Compute the Laplacians of all components at a set of points.
    */
   virtual void vector_laplacian_list (const std::vector<Point<dim> > &points,
                                       std::vector<Vector<double> >   &values) const;
 
   /**
-   * Determine an estimate for
-   * the memory consumption (in
-   * bytes) of this
-   * object. Since sometimes
-   * the size of objects can
-   * not be determined exactly
-   * (for example: what is the
-   * memory consumption of an
-   * STL <tt>std::map</tt> type with a
-   * certain number of
-   * elements?), this is only
-   * an estimate. however often
-   * quite close to the true
-   * value.
+   * Determine an estimate for the memory consumption (in bytes) of this
+   * object. Since sometimes the size of objects can not be determined
+   * exactly (for example: what is the memory consumption of an STL
+   * <tt>std::map</tt> type with a certain number of elements?), this is
+   * only an estimate. however often quite close to the true value.
    */
   std::size_t memory_consumption () const;
 };
 
 
+
 /**
  * Provide a function which always returns zero. Obviously, also the
  * derivates of this function are zero. Also, it returns zero on all
@@ -390,126 +327,64 @@ class ZeroFunction : public Function<dim>
 {
 public:
   /**
-   * Constructor. The number of
-   * components is preset to one.
+   * Constructor. The number of components is preset to one.
    */
   ZeroFunction (const unsigned int n_components = 1);
 
   /**
-   * Virtual destructor; absolutely
-   * necessary in this case.
+   * Virtual destructor; absolutely necessary in this case.
+   *
    */
   virtual ~ZeroFunction ();
 
-  /**
-   * Return the value of the function
-   * at the given point for one
-   * component.
-   */
   virtual double value (const Point<dim>   &p,
                         const unsigned int  component) const;
 
-  /**
-   * Return the value of the function
-   * at the given point for all
-   * components.
-   */
   virtual void vector_value (const Point<dim> &p,
                              Vector<double>   &return_value) const;
 
-  /**
-   * Set <tt>values</tt> to the point values
-   * of the function at the <tt>points</tt>,
-   * for the given component.
-   * It is assumed that <tt>values</tt>
-   * already has the right size, i.e.
-   * the same size as the <tt>points</tt>
-   * array.
-   */
   virtual void value_list (const std::vector<Point<dim> > &points,
                            std::vector<double>            &values,
                            const unsigned int              component = 0) const;
 
-  /**
-   * Set <tt>values</tt> to the point values
-   * of the function at the <tt>points</tt>,
-   * for all components.
-   * It is assumed that <tt>values</tt>
-   * already has the right size, i.e.
-   * the same size as the <tt>points</tt>
-   * array.
-   */
   virtual void vector_value_list (const std::vector<Point<dim> > &points,
                                   std::vector<Vector<double> >   &values) const;
 
-  /**
-   * Return the gradient of the function
-   * at the given point, for the
-   * given component.
-   */
   virtual Tensor<1,dim> gradient (const Point<dim> &p,
                                   const unsigned int component = 0) const;
 
-  /**
-   * Return the gradient of the
-   * specified component of the
-   * function at the given point,
-   * for all components.
-   */
   virtual void vector_gradient (const Point<dim>            &p,
                                 std::vector<Tensor<1,dim> > &gradients) const;
 
-  /**
-   * Set <tt>gradients</tt> to the gradients of
-   * the function at the <tt>points</tt>,
-   * for the given component.
-   * It is assumed that <tt>values</tt>
-   * already has the right size, i.e.
-   * the same size as the <tt>points</tt> array.
-   */
   virtual void gradient_list (const std::vector<Point<dim> > &points,
                               std::vector<Tensor<1,dim> >    &gradients,
                               const unsigned int              component = 0) const;
 
-  /**
-   * Set <tt>gradients</tt> to the gradients of
-   * the function at the <tt>points</tt>,
-   * for all components.
-   * It is assumed that <tt>gradients</tt>
-   * already has the right size, i.e.
-   * the same size as the <tt>points</tt> array.
-   *
-   * The outer loop over
-   * <tt>gradients</tt> is over the points
-   * in the list, the inner loop
-   * over the different components
-   * of the function.
-   */
   virtual void vector_gradient_list (const std::vector<Point<dim> >            &points,
                                      std::vector<std::vector<Tensor<1,dim> > > &gradients) const;
 };
 
 
+
 /**
  * Provide a function which always returns the constant value
  * handed to the constructor.
  *
- * Obviously, the derivates of this
- * function are zero, which is why we derive this class from
- * <tt>ZeroFunction</tt>: we then only have to overload the value functions,
- * not all the derivatives. In some way, it would be more obvious to
- * do the derivation in the opposite direction, i.e. let
- * <tt>ZeroFunction</tt> be a more specialized version of <tt>ConstantFunction</tt>;
- * however, this would be less efficient, since we could not make
- * use of the fact that the function value of the <tt>ZeroFunction</tt> is
- * known at compile time and need not be looked up somewhere in
- * memory.
+ * Obviously, the derivates of this function are zero, which is why we
+ * derive this class from <tt>ZeroFunction</tt>: we then only have to
+ * overload the value functions, not all the derivatives. In some way, it
+ * would be more obvious to do the derivation in the opposite direction,
+ * i.e. let <tt>ZeroFunction</tt> be a more specialized version of
+ * <tt>ConstantFunction</tt>; however, this would be less efficient, since
+ * we could not make use of the fact that the function value of the
+ * <tt>ZeroFunction</tt> is known at compile time and need not be looked up
+ * somewhere in memory.
  *
  * You can pass to the constructor an integer denoting the number of
  * components this function shall have. It defaults to one. If it is
- * greater than one, then the function will return the constant value
- * in all its components, which might not be overly useful a feature
- * in most cases, however.
+ * greater than one, then the function will return the constant value in
+ * all its components, which might not be overly useful a feature in most
+ * cases, however.
  *
  * @ingroup functions
  * @author Wolfgang Bangerth, 1998, 1999
@@ -519,76 +394,30 @@ class ConstantFunction : public ZeroFunction<dim>
 {
 public:
   /**
-   * Constructor; takes the constant function
-   * value as an argument. The number of
-   * components is preset to one.
+   * Constructor; takes the constant function value as an argument. The
+   * number of components is preset to one.
    */
   ConstantFunction (const double       value,
                     const unsigned int n_components = 1);
 
   /**
-   * Virtual destructor; absolutely
-   * necessary in this case.
+   * Virtual destructor; absolutely necessary in this case.
    */
   virtual ~ConstantFunction ();
 
-  /**
-   * Return the value of the function
-   * at the given point for one
-   * component.
-   */
   virtual double value (const Point<dim>   &p,
                         const unsigned int  component) const;
 
-  /**
-   * Return the value of the function
-   * at the given point for all
-   * components.
-   */
   virtual void   vector_value (const Point<dim> &p,
                                Vector<double>   &return_value) const;
 
-  /**
-   * Set <tt>values</tt> to the point values
-   * of the function at the <tt>points</tt>,
-   * for the given component.
-   * It is assumed that <tt>values</tt>
-   * already has the right size, i.e.
-   * the same size as the <tt>points</tt>
-   * array.
-   */
   virtual void value_list (const std::vector<Point<dim> > &points,
                            std::vector<double>            &values,
                            const unsigned int              component = 0) const;
 
-  /**
-   * Set <tt>values</tt> to the point values
-   * of the function at the <tt>points</tt>,
-   * for all components.
-   * It is assumed that <tt>values</tt>
-   * already has the right size, i.e.
-   * the same size as the <tt>points</tt>
-   * array.
-   */
   virtual void vector_value_list (const std::vector<Point<dim> > &points,
                                   std::vector<Vector<double> >   &values) const;
 
-  /**
-   * Determine an estimate for
-   * the memory consumption (in
-   * bytes) of this
-   * object. Since sometimes
-   * the size of objects can
-   * not be determined exactly
-   * (for example: what is the
-   * memory consumption of an
-   * STL <tt>std::map</tt> type with a
-   * certain number of
-   * elements?), this is only
-   * an estimate. however often
-   * quite close to the true
-   * value.
-   */
   std::size_t memory_consumption () const;
 
 protected:
@@ -602,15 +431,14 @@ protected:
 
 /**
  * This is a constant vector-valued function, in which one or more
- * components of the vector have a constant value and all other
- * components are zero.  It is especially useful as a weight function
- * for VectorTools::integrate_difference, where it allows to
- * integrate only one or a few vector components, rather than the
- * entire vector-valued solution. In other words, it acts as a
- * component mask with a single component selected (see the
- * @ref GlossComponentMask "the glossary entry on component masks").
- * See the step-20
- * tutorial program for a detailed explanation and a use case.
+ * components of the vector have a constant value and all other components
+ * are zero.  It is especially useful as a weight function for
+ * VectorTools::integrate_difference, where it allows to integrate only one
+ * or a few vector components, rather than the entire vector-valued
+ * solution. In other words, it acts as a component mask with a single
+ * component selected (see the @ref GlossComponentMask "the glossary entry
+ * on component masks"). See the step-20 tutorial program for a detailed
+ * explanation and a use case.
  *
  * @ingroup functions
  * @author Guido Kanschat, 2000, Wolfgang Bangerth 2006
@@ -620,120 +448,92 @@ class ComponentSelectFunction : public ConstantFunction<dim>
 {
 public:
   /**
-   * Constructor if only a single
-   * component shall be
-   * non-zero. Arguments denote the
-   * component selected, the value
-   * for that component and the
-   * total number of vector
-   * components.
+   * Constructor if only a single component shall be non-zero. Arguments
+   * denote the component selected, the value for that component and the
+   * total number of vector components.
    */
   ComponentSelectFunction (const unsigned int selected,
                            const double       value,
                            const unsigned int n_components);
 
   /**
-   * Constructor. As before, but
-   * the value for the selected
-   * component is assumed to be
-   * one. In essence, this function
-   * then works as a mask.
+   * Constructor. As before, but the value for the selected component is
+   * assumed to be one. In essence, this function then works as a mask.
    */
   ComponentSelectFunction (const unsigned int selected,
                            const unsigned int n_components);
 
   /**
-   * Constructor if multiple
-   * components shall have
-   * non-zero, unit values
-   * (i.e. this should be a mask
-   * for multiple components). The
-   * first argument denotes a
-   * half-open interval of
-   * components (for example
-   * std::pair(0,dim) for the first
-   * dim components), and the
-   * second argument is the total
-   * number of vector components.
+   * Constructor if multiple components shall have non-zero, unit values
+   * (i.e. this should be a mask for multiple components). The first
+   * argument denotes a half-open interval of components (for example
+   * std::pair(0,dim) for the first dim components), and the second
+   * argument is the total number of vector components.
    */
   ComponentSelectFunction (const std::pair<unsigned int, unsigned int> &selected,
                            const unsigned int n_components);
 
   /**
-   * Return the value of the function
-   * at the given point for all
+   * Return the value of the function at the given point for all
    * components.
    */
   virtual void   vector_value (const Point<dim> &p,
                                Vector<double>   &return_value) const;
 
   /**
-   * Set <tt>values</tt> to the point values
-   * of the function at the <tt>points</tt>,
-   * for all components.
-   * It is assumed that <tt>values</tt>
-   * already has the right size, i.e.
-   * the same size as the <tt>points</tt>
-   * array.
+   * Set <tt>values</tt> to the point values of the function at the
+   * <tt>points</tt>, for all components. It is assumed that
+   * <tt>values</tt> already has the right size, i.e. the same size as the
+   * <tt>points</tt> array.
    */
   virtual void vector_value_list (const std::vector<Point<dim> > &points,
                                   std::vector<Vector<double> >   &values) const;
 
   /**
-   * Determine an estimate for
-   * the memory consumption (in
-   * bytes) of this
-   * object. Since sometimes
-   * the size of objects can
-   * not be determined exactly
-   * (for example: what is the
-   * memory consumption of an
-   * STL <tt>std::map</tt> type with a
-   * certain number of
-   * elements?), this is only
-   * an estimate. however often
-   * quite close to the true
-   * value.
+   * Determine an estimate for the memory consumption (in bytes) of this
+   * object. Since sometimes the size of objects can not be determined
+   * exactly (for example: what is the memory consumption of an STL
+   * <tt>std::map</tt> type with a certain number of elements?), this is
+   * only an estimate. however often quite close to the true value.
    */
   std::size_t memory_consumption () const;
 
 protected:
   /**
-   * Half-open interval of the
-   * indices of selected
-   * components.
+   * Half-open interval of the indices of selected components.
    */
   const std::pair<unsigned int,unsigned int> selected_components;
 };
 
 
+
 /**
  * This class provides a way to convert a scalar function of the kind
  * @code
  *   double foo (const Point<dim> &);
  * @endcode
- * into an object of type Function@<dim@>.
- * Since the argument returns a scalar, the result is clearly a
- * Function object for which <code>function.n_components==1</code>.
- * The class works by storing a pointer to the given function and
- * every time <code>function.value(p,component)</code> is called,
- * calls <code>foo(p)</code> and returns the corresponding value. It
- * also makes sure that <code>component</code> is in fact zero, as needs
- * be for scalar functions.
+ * into an object of type Function@<dim@>. Since the argument returns a
+ * scalar, the result is clearly a Function object for which
+ * <code>function.n_components==1</code>. The class works by storing a
+ * pointer to the given function and every time
+ * <code>function.value(p,component)</code> is called, calls
+ * <code>foo(p)</code> and returns the corresponding value. It also makes
+ * sure that <code>component</code> is in fact zero, as needs be for scalar
+ * functions.
  *
  * The class provides an easy way to turn a simple global function into
  * something that has the required Function@<dim@> interface for operations
- * like VectorTools::interpolate_boundary_values() etc., and thereby
- * allows for simpler experimenting without having to write all the
- * boiler plate code of declaring a class that is derived from Function
- * and implementing the Function::value() function.
+ * like VectorTools::interpolate_boundary_values() etc., and thereby allows
+ * for simpler experimenting without having to write all the boiler plate
+ * code of declaring a class that is derived from Function and implementing
+ * the Function::value() function.
  *
  * The class gains additional expressvive power because the argument it
  * takes does not have to be a pointer to an actual function. Rather, it is
- * a function object, i.e., it can also be the result of call to
- * std::bind (or boost::bind) or some other object that can be called with
- * a single argument. For example, if you need a Function object that
- * returns the norm of a point, you could write it like so:
+ * a function object, i.e., it can also be the result of call to std::bind
+ * (or boost::bind) or some other object that can be called with a single
+ * argument. For example, if you need a Function object that returns the
+ * norm of a point, you could write it like so:
  * @code
  *   template <int dim>
  *   class Norm : public Function<dim> {
@@ -747,8 +547,8 @@ protected:
  *
  *    Norm<2> my_norm_object;
  * @endcode
- * and then pass the <code>my_norm_object</code> around, or you could write it
- * like so:
+ * and then pass the <code>my_norm_object</code> around, or you could write
+ * it like so:
  * @code
  *   ScalarFunctionFromFunctionObject<dim> my_norm_object (&Point<dim>::norm);
  * @endcode
@@ -788,18 +588,14 @@ class ScalarFunctionFromFunctionObject : public Function<dim>
 {
 public:
   /**
-   * Given a function object that takes a Point and returns a double
-   * value, convert this into an object that matches the Function<dim>
-   * interface.
+   * Given a function object that takes a Point and returns a double value,
+   * convert this into an object that matches the Function<dim> interface.
    */
   ScalarFunctionFromFunctionObject (const std_cxx1x::function<double (const Point<dim> &)> &function_object);
 
   /**
-   * Return the value of the
-   * function at the given
-   * point. Returns the value the
-   * function given to the constructor
-   * produces for this point.
+   * Return the value of the function at the given point. Returns the value
+   * the function given to the constructor produces for this point.
    */
   virtual double value (const Point<dim>   &p,
                         const unsigned int  component = 0) const;
@@ -813,24 +609,25 @@ private:
 };
 
 
+
 /**
- * This class is similar to the ScalarFunctionFromFunctionObject class in that it
- * allows for the easy conversion of a function object to something that
- * satisfies the interface of the Function base class. The difference is
- * that here, the given function object is still a scalar function
- * (i.e. it has a single value at each space point) but that the Function
- * object generated is vector valued. The number of vector components
- * is specified in the constructor, where one also selectes a single
- * one of these vector components that should be filled by the passed
- * object. The result is a vector Function object that returns zero in
- * each component except the single selected one where it returns the
- * value returned by the given as the first argument to the constructor.
+ * This class is similar to the ScalarFunctionFromFunctionObject class in
+ * that it allows for the easy conversion of a function object to something
+ * that satisfies the interface of the Function base class. The difference
+ * is that here, the given function object is still a scalar function (i.e.
+ * it has a single value at each space point) but that the Function object
+ * generated is vector valued. The number of vector components is specified
+ * in the constructor, where one also selectes a single one of these vector
+ * components that should be filled by the passed object. The result is a
+ * vector Function object that returns zero in each component except the
+ * single selected one where it returns the value returned by the given as
+ * the first argument to the constructor.
  *
- * @note In the above discussion, note the difference between the
- * (scalar) "function object" (i.e., a C++ object <code>x</code> that can
- * be called as in <code>x(p)</code>) and the capitalized (vector valued)
- * "Function object" (i.e., an object of a class that is derived from
- * the Function base class).
+ * @note In the above discussion, note the difference between the (scalar)
+ * "function object" (i.e., a C++ object <code>x</code> that can be called
+ * as in <code>x(p)</code>) and the capitalized (vector valued) "Function
+ * object" (i.e., an object of a class that is derived from the Function
+ * base class).
  *
  * To be more concrete, let us consider the following example:
  * @code
@@ -838,12 +635,12 @@ private:
  *   VectorFunctionFromScalarFunctionObject<2>
  *      component_mask (&one, 1, 3);
  * @endcode
- * Here, <code>component_mask</code> then represents a Function object
- * that for every point returns the vector $(0, 1, 0)^T$, i.e. a mask
- * function that could, for example, be passed to VectorTools::integrate_difference().
- * This effect can also be achieved using the ComponentSelectFunction
- * class but is obviously easily extended to functions that are
- * non-constant in their one component.
+ * Here, <code>component_mask</code> then represents a Function object that
+ * for every point returns the vector $(0, 1, 0)^T$, i.e. a mask function
+ * that could, for example, be passed to
+ * VectorTools::integrate_difference(). This effect can also be achieved
+ * using the ComponentSelectFunction class but is obviously easily extended
+ * to functions that are non-constant in their one component.
  *
  * @author Wolfgang Bangerth, 2011
  */
@@ -868,23 +665,17 @@ public:
                                           const unsigned int n_components);
 
   /**
-   * Return the value of the
-   * function at the given
-   * point. Returns the value the
-   * function given to the constructor
-   * produces for this point.
+   * Return the value of the function at the given point. Returns the value
+   * the function given to the constructor produces for this point.
    */
   virtual double value (const Point<dim>   &p,
                         const unsigned int  component = 0) const;
 
   /**
-   * Return all components of a
-   * vector-valued function at a
-   * given point.
+   * Return all components of a vector-valued function at a given point.
    *
-   * <tt>values</tt> shall have the right
-   * size beforehand,
-   * i.e. #n_components.
+   * <tt>values</tt> shall have the right size beforehand, i.e.
+   * #n_components.
    */
   virtual void vector_value (const Point<dim>   &p,
                              Vector<double>     &values) const;
@@ -897,22 +688,22 @@ private:
   const std_cxx1x::function<double (const Point<dim> &)> function_object;
 
   /**
-   * The vector component whose value is to be filled by the
-   * given scalar function.
+   * The vector component whose value is to be filled by the given scalar
+   * function.
    */
   const unsigned int selected_component;
 };
 
 
 /**
- * This class is built as a means of translating
- * the <code>Tensor<1,dim> </code> values produced by objects of type
- * TensorFunction and returning them as a multiple
- * component version of the same thing as a Vector for use in, for example,
- * the VectorTools::interpolate or the many other functions taking Function objects.
- * It allows the user to place the desired components into an <tt>n_components</tt>
- * long vector starting at the <tt>selected_component</tt> location in that vector and have all other
- * components be 0.
+ * This class is built as a means of translating the <code>Tensor<1,dim>
+ * </code> values produced by objects of type TensorFunction and returning
+ * them as a multiple component version of the same thing as a Vector for
+ * use in, for example, the VectorTools::interpolate or the many other
+ * functions taking Function objects. It allows the user to place the
+ * desired components into an <tt>n_components</tt> long vector starting at
+ * the <tt>selected_component</tt> location in that vector and have all
+ * other components be 0.
  *
  *  For example: Say you created a class called
  *  @code
@@ -923,11 +714,12 @@ private:
  *    RightHandSide<1,dim> rhs;
  *  @endcode
  *  of that class which you want to interpolate onto your mesh using the
- *  VectorTools::interpolate function, but the finite element you use for the DoFHandler
- *  object has 3 copies of a finite element with <tt>dim</tt> components, for a total of 3*dim
- *  components. To interpolate onto that DoFHandler, you need an object of type Function
- *  that has 3*dim vector components. Creating such an object from the existing <code>rhs</code>
- *  object is done using this piece of code:
+ *  VectorTools::interpolate function, but the finite element you use for
+ *  the DoFHandler object has 3 copies of a finite element with
+ *  <tt>dim</tt> components, for a total of 3*dim components. To
+ *  interpolate onto that DoFHandler, you need an object of type Function
+ *  that has 3*dim vector components. Creating such an object from the
+ *  existing <code>rhs</code> object is done using this piece of code:
  *  @code
  *      RighHandSide<1,dim> rhs;
  *      VectorFunctionFromTensorFunction<dim> rhs_vector_function (rhs, 0, 3*dim);
@@ -942,77 +734,70 @@ class VectorFunctionFromTensorFunction : public Function<dim>
 {
 public:
   /**
-   * Given a TensorFunction object that takes a <tt>Point</tt> and returns a <tt>Tensor<1,dim></tt>
-   * value, convert this into an object that matches the Function@<dim@>
-   * interface.
+   * Given a TensorFunction object that takes a <tt>Point</tt> and returns
+   * a <tt>Tensor<1,dim></tt> value, convert this into an object that
+   * matches the Function@<dim@> interface.
    *
-   * By default, create a Vector object of the same size as <tt>tensor_function</tt>
-   * returns, i.e., with <tt>dim</tt> components.
+   * By default, create a Vector object of the same size as
+   * <tt>tensor_function</tt> returns, i.e., with <tt>dim</tt> components.
    *
    * @param tensor_function The TensorFunction that will form one component
    *     of the resulting Vector Function object.
    * @param n_components The total number of vector components of the
    *     resulting TensorFunction object.
    * @param selected_component The first component that should be
-   *     filled by the first argument.  This should be such that the entire tensor_function
-   *     fits inside the <tt>n_component</tt> length return vector.
+   *     filled by the first argument.  This should be such that the entire
+   *     tensor_function fits inside the <tt>n_component</tt> length return
+   *     vector.
    */
   VectorFunctionFromTensorFunction (const TensorFunction<1,dim> &tensor_function,
                                     const unsigned int selected_component=0,
                                     const unsigned int n_components=dim);
 
   /**
-   * This destructor is defined as
-   * virtual so as to coincide with all
-   * other aspects of class.
+   * This destructor is defined as virtual so as to coincide with all other
+   * aspects of class.
    */
   virtual ~VectorFunctionFromTensorFunction();
 
   /**
-   * Return a single component of a
-   * vector-valued function at a
-   * given point.
+   * Return a single component of a vector-valued function at a given
+   * point.
    */
   virtual double value (const Point<dim> &p,
                         const unsigned int component = 0) const;
 
   /**
-   * Return all components of a
-   * vector-valued function at a
-   * given point.
+   * Return all components of a vector-valued function at a given point.
    *
-   * <tt>values</tt> shall have the right
-   * size beforehand,
-   * i.e. #n_components.
+   * <tt>values</tt> shall have the right size beforehand, i.e.
+   * #n_components.
    */
   virtual void vector_value (const Point<dim> &p,
                              Vector<double>   &values) const;
 
   /**
-   * Return all components of a
-   * vector-valued function at a
-   * list of points.
+   * Return all components of a vector-valued function at a list of points.
    *
-   * <tt>value_list</tt> shall be the same
-   * size as <tt>points</tt> and each element
-   * of the vector will be passed to
-   * vector_value() to evaluate
-   * the function
+   * <tt>value_list</tt> shall be the same size as <tt>points</tt> and each
+   * element of the vector will be passed to vector_value() to evaluate the
+   * function
    */
   virtual void vector_value_list (const std::vector<Point<dim> > &points,
                                   std::vector<Vector<double> >   &value_list) const;
 
 private:
   /**
-   * The TensorFunction object which we call when this class's vector_value()
-   * or vector_value_list() functions are called.
+   * The TensorFunction object which we call when this class's
+   * vector_value() or vector_value_list() functions are called.
    **/
-  const TensorFunction<1,dim> & tensor_function;
+  const TensorFunction<1,dim> &tensor_function;
 
   /**
-   * The first vector component whose value is to be filled by the
-   * given TensorFunction.  The values will be placed in components
-   * selected_component to selected_component+dim-1 for a <tt>TensorFunction<1,dim></tt> object.
+   * The first vector component whose value is to be filled by the given
+   * TensorFunction.  The values will be placed in components
+   * selected_component to selected_component+dim-1 for a
+   * <tt>TensorFunction<1,dim></tt> object.
    */
   const unsigned int selected_component;
 };
index 0b7f3c144aafda55c87056155a283402ce09e7cf..269b908e59ad33784c03bed124794fc9c09b3aa9 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__function_bessel_h
 #define __deal2__function_bessel_h
 
index 03400629d8da7a2bbf16be919e3b9921de247939..a918b1bb61489dc98f9374ef6a1ee97fafb95248 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__function_derivative_h
 #define __deal2__function_derivative_h
 
index 26bd37c9524a1849d319888571c9981d7412af1f..5e4921226962dc9ed90450558552e6612807c462 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__function_lib_h
 #define __deal2__function_lib_h
 
index 7002002685e72ab4b1d9bec856b3d14f551a08ad..0fff67c271a451f1ca59da08c06657fe4772a891 100644 (file)
@@ -1,15 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #ifndef __deal2__function_parser_h
 #define __deal2__function_parser_h
index 62fbb75cd91b21bef9022a11ae81ae3cdb746f19..3615f51f73a30042aec1c31a20d3dec39c4824aa 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__function_time_h
 #define __deal2__function_time_h
 
index b2d09128bc89e5dd425f513e0f468933c81a02aa..4704ebfdf63a78cf4d0b3bb8dd3d7699657b969a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__geometry_info_h
 #define __deal2__geometry_info_h
 
@@ -1208,8 +1213,8 @@ struct GeometryInfo<0>
  * from one cell, whereas it is according to the standard looking at it from the
  * neighboring cell sharing that particular face. In order to cope with this,
  * two flags <tt>face_flip</tt> and <tt>face_rotation</tt> are available, to
- * represent rotations by 90 and 180 degree, respectively. Setting both flags
- * accumulates to a rotation of 270 degrees (all counterclockwise). You can ask
+ * represent rotations by 180 and 90 degree, respectively. Setting both flags
+ * amounts to a rotation of 270 degrees (all counterclockwise). You can ask
  * the cell for these flags like for the <tt>face_orientation</tt>. In order to
  * enable rotated faces, even lines can deviate from their standard direction in
  * 3d. This information is available as the <tt>line_orientation</tt> flag for
index aff873cba72e080a40943198687a2193719e0c4f..b5b439d9901d9ffe870737e9c2e8ce2e7be1f7c6 100644 (file)
@@ -1,21 +1,25 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__index_set_h
 #define __deal2__index_set_h
 
 #include <deal.II/base/config.h>
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/exceptions.h>
-
 #include <vector>
 #include <algorithm>
 
@@ -27,7 +31,9 @@
 #include <mpi.h>
 #else
 typedef int MPI_Comm;
-#define MPI_COMM_WORLD 0
+#  ifndef MPI_COMM_WORLD
+#    define MPI_COMM_WORLD 0
+#  endif
 #endif
 
 DEAL_II_NAMESPACE_OPEN
@@ -64,7 +70,7 @@ public:
    * overall size of the index
    * range.
    */
-  explicit IndexSet (const unsigned int size);
+  explicit IndexSet (const types::global_dof_index size);
 
   /**
    * Remove all indices from this
@@ -84,7 +90,7 @@ public:
    * This can be achieved by calling
    * clear(), for example.
    */
-  void set_size (const unsigned int size);
+  void set_size (const types::global_dof_index size);
 
   /**
    * Return the size of the index
@@ -96,7 +102,7 @@ public:
    * set. The latter information is
    * returned by n_elements().
    */
-  unsigned int size () const;
+  types::global_dof_index size () const;
 
   /**
    * Add the half-open range
@@ -104,14 +110,14 @@ public:
    * the set of indices represented
    * by this class.
    */
-  void add_range (const unsigned int begin,
-                  const unsigned int end);
+  void add_range (const types::global_dof_index begin,
+                  const types::global_dof_index end);
 
   /**
    * Add an individual index to the
    * set of indices.
    */
-  void add_index (const unsigned int index);
+  void add_index (const types::global_dof_index index);
 
   /**
    * Add a whole set of indices
@@ -128,15 +134,30 @@ public:
    * Add the given IndexSet @p other to the
    * current one, constructing the union of
    * *this and @p other.
+   *
+   * If the @p offset argument is nonzero, then every
+   * index in @p other is shifted by @p offset before being
+   * added to the current index set. This allows to construct,
+   * for example, one index set from several others that are
+   * supposed to represent index sets corresponding to
+   * different ranges (e.g., when constructing the set of
+   * nonzero entries of a block vector from the sets of nonzero
+   * elements of the individual blocks of a vector).
+   *
+   * This function will generate an exception if any of the
+   * (possibly shifted) indices of the @p other index set
+   * lie outside the range <code>[0,size())</code> represented
+   * by the current object.
    */
-  void add_indices(const IndexSet &other);
+  void add_indices(const IndexSet &other,
+                   const unsigned int offset = 0);
 
   /**
    * Return whether the specified
    * index is an element of the
    * index set.
    */
-  bool is_element (const unsigned int index) const;
+  bool is_element (const types::global_dof_index index) const;
 
   /**
    * Return whether the index set
@@ -151,7 +172,7 @@ public:
    * Return the number of elements
    * stored in this index set.
    */
-  unsigned int n_elements () const;
+  types::global_dof_index n_elements () const;
 
   /**
    * Return the global index of the local
@@ -160,7 +181,7 @@ public:
    * local_index obviously needs to be less
    * than n_elements().
    */
-  unsigned int nth_index_in_set (const unsigned int local_index) const;
+  types::global_dof_index nth_index_in_set (const unsigned int local_index) const;
 
   /**
    * Return the how-manyth element of this
@@ -172,7 +193,7 @@ public:
    * a member of this index set, i.e. if
    * is_element(global_index) is false.
    */
-  unsigned int index_within_set (const unsigned int global_index) const;
+  types::global_dof_index index_within_set (const types::global_dof_index global_index) const;
 
   /**
    * Each index set can be
@@ -255,8 +276,8 @@ public:
    * a <i>window</i> through which we see the set represented
    * by the current object.
    */
-  IndexSet get_view (const unsigned int begin,
-                     const unsigned int end) const;
+  IndexSet get_view (const types::global_dof_index begin,
+                     const types::global_dof_index end) const;
 
 
   /**
@@ -273,7 +294,7 @@ public:
    * Fills the given vector with all
    * indices contained in this IndexSet.
    */
-  void fill_index_vector(std::vector<unsigned int> &indices) const;
+  void fill_index_vector(std::vector<types::global_dof_index> &indices) const;
 
   /**
    * Fill the given vector with either
@@ -408,7 +429,7 @@ public:
    */
   std::size_t memory_consumption () const;
 
-  DeclException1 (ExcIndexNotPresent, int,
+  DeclException1 (ExcIndexNotPresent, types::global_dof_index,
                   << "The global index " << arg1
                   << " is not an element of this set.");
 
@@ -437,10 +458,10 @@ private:
    */
   struct Range
   {
-    unsigned int begin;
-    unsigned int end;
+    types::global_dof_index begin;
+    types::global_dof_index end;
 
-    unsigned int nth_index_in_set;
+    types::global_dof_index nth_index_in_set;
 
     /**
      * Default constructor. Since there is no useful choice for
@@ -459,8 +480,8 @@ private:
      * @param i1 Left end point of the interval.
      * @param i2 First index greater than the last index of the indicated range.
      **/
-    Range (const unsigned int i1,
-           const unsigned int i2);
+    Range (const types::global_dof_index i1,
+           const types::global_dof_index i2);
 
     friend
     inline bool operator< (const Range &range_1,
@@ -544,7 +565,7 @@ private:
    * set have to have a smaller
    * number than this value.
    */
-  unsigned int index_space_size;
+  types::global_dof_index index_space_size;
 
   /**
    * This integer caches the index of the
@@ -561,7 +582,7 @@ private:
    * owned range), whereas there are only a
    * few other elements (ghosts).
    */
-  mutable unsigned int largest_range;
+  mutable types::global_dof_index largest_range;
 
   /**
    * Actually perform the compress()
@@ -602,14 +623,14 @@ IndexSet complete_index_set (const unsigned int N)
 inline
 IndexSet::Range::Range ()
   :
-  begin(numbers::invalid_unsigned_int),
-  end(numbers::invalid_unsigned_int)
+  begin(numbers::invalid_dof_index),
+  end(numbers::invalid_dof_index)
 {}
 
 
 inline
-IndexSet::Range::Range (const unsigned int i1,
-                        const unsigned int i2)
+IndexSet::Range::Range (const types::global_dof_index i1,
+                        const types::global_dof_index i2)
   :
   begin(i1),
   end(i2)
@@ -627,7 +648,7 @@ IndexSet::IndexSet ()
 
 
 inline
-IndexSet::IndexSet (const unsigned int size)
+IndexSet::IndexSet (const types::global_dof_index size)
   :
   is_compressed (true),
   index_space_size (size),
@@ -648,7 +669,7 @@ IndexSet::clear ()
 
 inline
 void
-IndexSet::set_size (const unsigned int sz)
+IndexSet::set_size (const types::global_dof_index sz)
 {
   Assert (ranges.empty(),
           ExcMessage ("This function can only be called if the current "
@@ -660,7 +681,7 @@ IndexSet::set_size (const unsigned int sz)
 
 
 inline
-unsigned int
+types::global_dof_index
 IndexSet::size () const
 {
   return index_space_size;
@@ -682,17 +703,17 @@ IndexSet::compress () const
 
 inline
 void
-IndexSet::add_range (const unsigned int begin,
-                     const unsigned int end)
+IndexSet::add_range (const types::global_dof_index begin,
+                     const types::global_dof_index end)
 {
   Assert ((begin < index_space_size)
           ||
           ((begin == index_space_size) && (end == index_space_size)),
-          ExcIndexRange (begin, 0, index_space_size));
+          ExcIndexRangeType<types::global_dof_index> (begin, 0, index_space_size));
   Assert (end <= index_space_size,
-          ExcIndexRange (end, 0, index_space_size+1));
+          ExcIndexRangeType<types::global_dof_index> (end, 0, index_space_size+1));
   Assert (begin <= end,
-          ExcIndexRange (begin, 0, end));
+          ExcIndexRangeType<types::global_dof_index> (begin, 0, end));
 
   if (begin != end)
     {
@@ -716,10 +737,10 @@ IndexSet::add_range (const unsigned int begin,
 
 inline
 void
-IndexSet::add_index (const unsigned int index)
+IndexSet::add_index (const types::global_dof_index index)
 {
   Assert (index < index_space_size,
-          ExcIndexRange (index, 0, index_space_size));
+          ExcIndexRangeType<types::global_dof_index> (index, 0, index_space_size));
 
   const Range new_range(index, index+1);
   if (ranges.size() == 0 || index > ranges.back().end)
@@ -748,8 +769,8 @@ IndexSet::add_indices (const ForwardIterator &begin,
   // range
   for (ForwardIterator p=begin; p!=end;)
     {
-      const unsigned int begin_index = *p;
-      unsigned int       end_index   = begin_index + 1;
+      const types::global_dof_index begin_index = *p;
+      types::global_dof_index       end_index   = begin_index + 1;
       ForwardIterator q = p;
       ++q;
       while ((q != end) && (*q == end_index))
@@ -767,16 +788,17 @@ IndexSet::add_indices (const ForwardIterator &begin,
 
 inline
 void
-IndexSet::add_indices(const IndexSet &other)
+IndexSet::add_indices(const IndexSet &other,
+                      const unsigned int offset)
 {
-  if (this == &other)
+  if ((this == &other) && (offset == 0))
     return;
 
   for (std::vector<Range>::iterator range = other.ranges.begin();
        range != other.ranges.end();
        ++range)
     {
-      add_range(range->begin, range->end);
+      add_range(range->begin+offset, range->end+offset);
     }
 
   compress();
@@ -786,7 +808,7 @@ IndexSet::add_indices(const IndexSet &other)
 
 inline
 bool
-IndexSet::is_element (const unsigned int index) const
+IndexSet::is_element (const types::global_dof_index index) const
 {
   if (ranges.empty() == false)
     {
@@ -864,14 +886,14 @@ IndexSet::is_contiguous () const
 
 
 inline
-unsigned int
+types::global_dof_index
 IndexSet::n_elements () const
 {
   // make sure we have
   // non-overlapping ranges
   compress ();
 
-  unsigned int v = 0;
+  types::global_dof_index v = 0;
   if (!ranges.empty())
     {
       Range &r = ranges.back();
@@ -879,7 +901,7 @@ IndexSet::n_elements () const
     }
 
 #ifdef DEBUG
-  unsigned int s = 0;
+  types::global_dof_index s = 0;
   for (std::vector<Range>::iterator range = ranges.begin();
        range != ranges.end();
        ++range)
@@ -893,13 +915,13 @@ IndexSet::n_elements () const
 
 
 inline
-unsigned int
+types::global_dof_index
 IndexSet::nth_index_in_set (const unsigned int n) const
 {
   // to make this call thread-safe, compress()
   // must not be called through this function
   Assert (is_compressed == true, ExcMessage ("IndexSet must be compressed."));
-  Assert (n < n_elements(), ExcIndexRange (n, 0, n_elements()));
+  Assert (n < n_elements(), ExcIndexRangeType<types::global_dof_index> (n, 0, n_elements()));
 
   // first check whether the index is in the
   // largest range
@@ -937,21 +959,21 @@ IndexSet::nth_index_in_set (const unsigned int n) const
   else
     {
       Assert (false, ExcInternalError());
-      return numbers::invalid_unsigned_int;
+      return numbers::invalid_dof_index;
     }
 }
 
 
 
 inline
-unsigned int
-IndexSet::index_within_set (const unsigned int n) const
+types::global_dof_index
+IndexSet::index_within_set (const types::global_dof_index n) const
 {
   // to make this call thread-safe, compress()
   // must not be called through this function
   Assert (is_compressed == true, ExcMessage ("IndexSet must be compressed."));
   Assert (is_element(n) == true, ExcIndexNotPresent (n));
-  Assert (n < size(), ExcIndexRange (n, 0, size()));
+  Assert (n < size(), ExcIndexRangeType<types::global_dof_index> (n, 0, size()));
 
   // check whether the index is in the largest
   // range. use the result to perform a
@@ -1033,7 +1055,7 @@ IndexSet::fill_binary_vector (Vector &vector) const
   for (std::vector<Range>::iterator it = ranges.begin();
        it != ranges.end();
        ++it)
-    for (unsigned int i=it->begin; i<it->end; ++i)
+    for (types::global_dof_index i=it->begin; i<it->end; ++i)
       vector[i] = 1;
 }
 
index d39688e652b99415a4dfeec7baf44f4e924987c1..0a0a557a6838f43b76dc1e9408ac9ac5d545cddf 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__job_identifier_h
 #define __deal2__job_identifier_h
 
index 98617b69a8342436fa931355f331ec4622723b0a..8afb3ea2cbc51c1de9971646c3f205afdda3588c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__logstream_h
 #define __deal2__logstream_h
 
@@ -171,8 +176,11 @@ public:
 
   /**
    * Enable output to a second stream <tt>o</tt>.
+   *
+   * The optional argument @p print_job_id specifies whether
    */
-  void attach (std::ostream &o);
+  void attach (std::ostream &o,
+               const bool    print_job_id = true);
 
 
   /**
@@ -567,7 +575,7 @@ LogStream::get_stream()
   // note that in all of this we need not worry about thread-safety
   // because we operate on a thread-local object and by definition
   // there can only be one access at a time
-  if (outstreams.get() == 0)
+  if (outstreams.get().get() == 0)
     {
       outstreams.get().reset (new std::ostringstream);
       outstreams.get()->setf(std::ios::showpoint | std::ios::left);
index 619e3ba5d99c95b02ba2deeeff2ea79f5a4f52bf..f5add851caf54a7b2e452f542dce3fb2537aa59a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__memory_consumption_h
 #define __deal2__memory_consumption_h
 
@@ -152,6 +157,14 @@ namespace MemoryConsumption
   inline
   std::size_t memory_consumption (const unsigned int);
 
+  /**
+   * Determine the amount of memory
+   * in bytes consumed by a <tt>unsigned long long int</tt>
+   * variable.
+   */
+  inline
+  std::size_t memory_consumption (const unsigned long long int);
+
   /**
    * Determine the amount of memory
    * in bytes consumed by a <tt>float</tt>
@@ -470,6 +483,14 @@ namespace MemoryConsumption
 
 
 
+  inline
+  std::size_t memory_consumption (const unsigned long long int)
+  {
+    return sizeof(unsigned long long int);
+  }
+
+
+
   inline
   std::size_t memory_consumption (const float)
   {
@@ -514,7 +535,7 @@ namespace MemoryConsumption
   std::size_t memory_consumption (const std::vector<T> &v)
   {
     std::size_t mem = sizeof(std::vector<T>);
-    const unsigned int n = v.size();
+    const unsigned int n = static_cast<unsigned int>(v.size());
     for (unsigned int i=0; i<n; ++i)
       mem += memory_consumption(v[i]);
     mem += (v.capacity() - n)*sizeof(T);
index eca7a5f5343cd5186307fd6039bd408976706759..cbd7a305746eaf68d714a094fd1726456ddef8b6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_level_object_h
 #define __deal2__mg_level_object_h
 
index 4887776510af105cc8ffd64993f0f64632b4135a..cb88fcc2ec199fa6530d1d9acca28f33f373dcfb 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012 by deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mpi_h
 #define __deal2__mpi_h
 
@@ -377,8 +381,8 @@ namespace Utilities
        * Called by the constructors.
        */
       void do_init(int    &argc,
-          char ** &argv,
-          unsigned int max_num_threads);
+                   char ** &argv,
+                   unsigned int max_num_threads);
     };
 
     namespace internal
@@ -412,6 +416,12 @@ namespace Utilities
       }
 
 
+      inline MPI_Datatype mpi_type_id (const unsigned long long int *)
+      {
+        return MPI_UNSIGNED_LONG_LONG;
+      }
+
+
       inline MPI_Datatype mpi_type_id (const float *)
       {
         return MPI_FLOAT;
index 181926b82f48d42c659241a3949cba37181fef64..3b7297555679d3609373a77b81edc814309b4ff6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__multithread_info_h
 #define __deal2__multithread_info_h
 //---------------------------------------------------------------------------
@@ -37,7 +42,7 @@ DEAL_II_NAMESPACE_OPEN
  * To set n_default_threads add the following at the start of your main():
  * <code>
  * multithread_info.n_default_threads=1;
- * </code> 
+ * </code>
  *
  * @ingroup threads
  * @author Thomas Richter, Wolfgang Bangerth, 2000
index 6d4c7b3af11c315a3aca73dee4e66355af3adb8f..d177e6a1a1d99b1e195c19c9a9d36420987e6f41 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__named_data_h
 #define __deal2__named_data_h
 
index 482719b75f9edcd5ad7c87af1c933277d91b0aee..ae0f861106ddd57c12021f4974c1c52eaaf93c94 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__numbers_h
 #define __deal2__numbers_h
 
index 3ffdda181b6b2be35115d3c79da1c494fe0f1b38..819d60f29604e0599820e522974d87412ac6fa59 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__parallel_h
 #define __deal2__parallel_h
 
index bf9aad7c0ec7d1ca39b22b7caeb090ffc09cb269..f6bfc184de8ec1befeb10d0a42438fd1f6612ebf 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__parameter_handler_h
 #define __deal2__parameter_handler_h
 
@@ -55,241 +60,147 @@ namespace Patterns
 {
 
   /**
-   * Base class to declare common
-   * interface. The purpose of this
-   * class is mostly to define the
-   * interface of patterns, and to
-   * force derived classes to have a
-   * <tt>clone</tt> function. It is thus,
-   * in the languages of the "Design
-   * Patterns" book (Gamma et al.), a
-   * "prototype".
+   * Base class to declare common interface. The purpose of this class is
+   * mostly to define the interface of patterns, and to force derived
+   * classes to have a <tt>clone</tt> function. It is thus, in the
+   * languages of the "Design Patterns" book (Gamma et al.), a "prototype".
    */
   class PatternBase
   {
   public:
     /**
-     * Make destructor of this and all
-     * derived classes virtual.
+     * Make destructor of this and all derived classes virtual.
      */
     virtual ~PatternBase ();
 
     /**
-     * Return <tt>true</tt> if the given string
-     * matches the pattern.
+     * Return <tt>true</tt> if the given string matches the pattern.
      */
     virtual bool match (const std::string &test_string) const = 0;
 
     /**
-     * Return a string describing the
-     * pattern.
+     * Return a string describing the pattern.
      */
     virtual std::string description () const = 0;
 
     /**
-     * Return a pointer to an
-     * exact copy of the
-     * object. This is necessary
-     * since we want to store
-     * objects of this type in
-     * containers, were we need
-     * to copy objects without
-     * knowledge of their actual
-     * data type (we only have
-     * pointers to the base
-     * class).
+     * Return a pointer to an exact copy of the object. This is necessary
+     * since we want to store objects of this type in containers, were we
+     * need to copy objects without knowledge of their actual data type (we
+     * only have pointers to the base class).
      *
-     * Ownership of the objects
-     * returned by this function
-     * is passed to the caller of
-     * this function.
+     * Ownership of the objects returned by this function is passed to the
+     * caller of this function.
      */
     virtual PatternBase *clone () const = 0;
 
     /**
-     * Determine an estimate for
-     * the memory consumption (in
-     * bytes) of this object. To
-     * avoid unnecessary
-     * overhead, we do not force
-     * derived classes to provide
-     * this function as a virtual
-     * overloaded one, but rather
-     * try to cast the present
-     * object to one of the known
-     * derived classes and if
-     * that fails then take the
-     * size of this base class
-     * instead and add 32 byte
-     * (this value is arbitrary,
-     * it should account for
-     * virtual function tables,
-     * and some possible data
-     * elements). Since there are
-     * usually not many thousands
-     * of objects of this type
-     * around, and since the
-     * memory_consumption
-     * mechanism is used to find
-     * out where memory in the
-     * range of many megabytes
-     * is, this seems like a
+     * Determine an estimate for the memory consumption (in bytes) of this
+     * object. To avoid unnecessary overhead, we do not force derived
+     * classes to provide this function as a virtual overloaded one, but
+     * rather try to cast the present object to one of the known derived
+     * classes and if that fails then take the size of this base class
+     * instead and add 32 byte (this value is arbitrary, it should account
+     * for virtual function tables, and some possible data elements). Since
+     * there are usually not many thousands of objects of this type around,
+     * and since the memory_consumption mechanism is used to find out where
+     * memory in the range of many megabytes is, this seems like a
      * reasonable approximation.
      *
-     * On the other hand, if you
-     * know that your class
-     * deviates from this
-     * assumption significantly,
-     * you can still overload
-     * this function.
+     * On the other hand, if you know that your class deviates from this
+     * assumption significantly, you can still overload this function.
      */
     virtual std::size_t memory_consumption () const;
   };
 
   /**
-  * Returns pointer to the correct
-  * derived class based on description.
+  * Returns pointer to the correct derived class based on description.
   */
   PatternBase *pattern_factory (const std::string &description);
 
   /**
-   * Test for the string being an
-   * integer. If bounds are given
-   * to the constructor, then the
-   * integer given also needs to be
-   * within the interval specified
-   * by these bounds. Note that
-   * unlike common convention in
-   * the C++ standard library, both
-   * bounds of this interval are
-   * inclusive; the reason is that
-   * in practice in most cases, one
-   * needs closed intervals, but
-   * these can only be realized
-   * with inclusive bounds for
-   * non-integer values. We thus
-   * stay consistent by always
-   * using closed intervals.
+   * Test for the string being an integer. If bounds are given to the
+   * constructor, then the integer given also needs to be within the
+   * interval specified by these bounds. Note that unlike common convention
+   * in the C++ standard library, both bounds of this interval are
+   * inclusive; the reason is that in practice in most cases, one needs
+   * closed intervals, but these can only be realized with inclusive bounds
+   * for non-integer values. We thus stay consistent by always using closed
+   * intervals.
    *
-   * If the upper bound given to
-   * the constructor is smaller
-   * than the lower bound, then the
-   * infinite interval is implied,
-   * i.e. every integer is allowed.
+   * If the upper bound given to the constructor is smaller than the lower
+   * bound, then the infinite interval is implied, i.e. every integer is
+   * allowed.
    *
-   * Giving bounds may be useful if
-   * for example a value can only
-   * be positive and less than a
-   * reasonable upper bound (for
-   * example the number of
-   * refinement steps to be
-   * performed), or in many other
-   * cases.
+   * Giving bounds may be useful if for example a value can only be
+   * positive and less than a reasonable upper bound (for example the
+   * number of refinement steps to be performed), or in many other cases.
    */
   class Integer : public PatternBase
   {
   public:
     /**
-     * Minimal integer value. If
-     * the numeric_limits class
-     * is available use this
-     * information to obtain the
-     * extremal values, otherwise
-     * set it so that this class
-     * understands that all values
-     * are allowed.
+     * Minimal integer value. If the numeric_limits class is available use
+     * this information to obtain the extremal values, otherwise set it so
+     * that this class understands that all values are allowed.
      */
     static const int min_int_value;
 
     /**
-     * Maximal integer value. If
-     * the numeric_limits class
-     * is available use this
-     * information to obtain the
-     * extremal values, otherwise
-     * set it so that this class
-     * understands that all values
-     * are allowed.
+     * Maximal integer value. If the numeric_limits class is available use
+     * this information to obtain the extremal values, otherwise set it so
+     * that this class understands that all values are allowed.
      */
     static const int max_int_value;
 
     /**
-     * Constructor. Bounds can be
-     * specified within which a
-     * valid parameter has to
-     * be. If the upper bound is
-     * smaller than the lower
-     * bound, then the infinite
-     * interval is meant. The
-     * default values are chosen
-     * such that no bounds are
-     * enforced on parameters.
+     * Constructor. Bounds can be specified within which a valid parameter
+     * has to be. If the upper bound is smaller than the lower bound, then
+     * the infinite interval is meant. The default values are chosen such
+     * that no bounds are enforced on parameters.
      */
     Integer (const int lower_bound = min_int_value,
              const int upper_bound = max_int_value);
 
     /**
-     * Return <tt>true</tt> if the
-     * string is an integer and
-     * its value is within the
-     * specified range.
+     * Return <tt>true</tt> if the string is an integer and its value is
+     * within the specified range.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match. If bounds were
-     * specified to the
-     * constructor, then include
-     * them into this
-     * description.
+     * Return a description of the pattern that valid strings are expected
+     * to match. If bounds were specified to the constructor, then include
+     * them into this description.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static Integer *create (const std::string &description);
 
   private:
     /**
-     * Value of the lower
-     * bound. A number that
-     * satisfies the @ref match
-     * operation of this class
-     * must be equal to this
-     * value or larger, if the
-     * bounds of the interval for
-     * a valid range.
+     * Value of the lower bound. A number that satisfies the @ref match
+     * operation of this class must be equal to this value or larger, if
+     * the bounds of the interval for a valid range.
      */
     const int lower_bound;
 
     /**
-     * Value of the upper
-     * bound. A number that
-     * satisfies the @ref match
-     * operation of this class
-     * must be equal to this
-     * value or less, if the
-     * bounds of the interval for
-     * a valid range.
+     * Value of the upper bound. A number that satisfies the @ref match
+     * operation of this class must be equal to this value or less, if the
+     * bounds of the interval for a valid range.
      */
     const int upper_bound;
 
@@ -300,144 +211,90 @@ namespace Patterns
   };
 
   /**
-   * Test for the string being a
-   * <tt>double</tt>. If bounds are
-   * given to the constructor, then
-   * the integer given also needs
-   * to be within the interval
-   * specified by these
-   * bounds. Note that unlike
-   * common convention in the C++
-   * standard library, both bounds
-   * of this interval are
-   * inclusive; the reason is that
-   * in practice in most cases, one
-   * needs closed intervals, but
-   * these can only be realized
-   * with inclusive bounds for
-   * non-integer values. We thus
-   * stay consistent by always
-   * using closed intervals.
+   * Test for the string being a <tt>double</tt>. If bounds are given to
+   * the constructor, then the integer given also needs to be within the
+   * interval specified by these bounds. Note that unlike common convention
+   * in the C++ standard library, both bounds of this interval are
+   * inclusive; the reason is that in practice in most cases, one needs
+   * closed intervals, but these can only be realized with inclusive bounds
+   * for non-integer values. We thus stay consistent by always using closed
+   * intervals.
    *
-   * If the upper bound given to
-   * the constructor is smaller
-   * than the lower bound, then the
-   * infinite interval is implied,
-   * i.e. every integer is allowed.
+   * If the upper bound given to the constructor is smaller than the lower
+   * bound, then the infinite interval is implied, i.e. every integer is
+   * allowed.
    *
-   * Giving bounds may be useful if
-   * for example a value can only
-   * be positive and less than a
-   * reasonable upper bound (for
-   * example damping parameters are
-   * frequently only reasonable if
-   * between zero and one), or in
-   * many other cases.
+   * Giving bounds may be useful if for example a value can only be
+   * positive and less than a reasonable upper bound (for example damping
+   * parameters are frequently only reasonable if between zero and one), or
+   * in many other cases.
    */
   class Double : public PatternBase
   {
   public:
     /**
-     * Minimal double value. If the
-     * <tt>std::numeric_limits</tt>
-     * class is available use this
-     * information to obtain the
-     * extremal values, otherwise
-     * set it so that this class
-     * understands that all values
-     * are allowed.
+     * Minimal double value. If the <tt>std::numeric_limits</tt> class is
+     * available use this information to obtain the extremal values,
+     * otherwise set it so that this class understands that all values are
+     * allowed.
      */
     static const double min_double_value;
 
     /**
-     * Maximal double value. If the
-     * numeric_limits class is
-     * available use this
-     * information to obtain the
-     * extremal values, otherwise
-     * set it so that this class
-     * understands that all values
-     * are allowed.
+     * Maximal double value. If the numeric_limits class is available use
+     * this information to obtain the extremal values, otherwise set it so
+     * that this class understands that all values are allowed.
      */
     static const double max_double_value;
 
     /**
-     * Constructor. Bounds can be
-     * specified within which a
-     * valid parameter has to
-     * be. If the upper bound is
-     * smaller than the lower
-     * bound, then the infinite
-     * interval is meant. The
-     * default values are chosen
-     * such that no bounds are
-     * enforced on parameters.
+     * Constructor. Bounds can be specified within which a valid parameter
+     * has to be. If the upper bound is smaller than the lower bound, then
+     * the infinite interval is meant. The default values are chosen such
+     * that no bounds are enforced on parameters.
      */
     Double (const double lower_bound = min_double_value,
             const double upper_bound = max_double_value);
 
     /**
-     * Return <tt>true</tt> if the
-     * string is a number and its
-     * value is within the
-     * specified range.
+     * Return <tt>true</tt> if the string is a number and its value is
+     * within the specified range.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match. If bounds were
-     * specified to the
-     * constructor, then include
-     * them into this
-     * description.
+     * Return a description of the pattern that valid strings are expected
+     * to match. If bounds were specified to the constructor, then include
+     * them into this description.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static Double *create (const std::string &description);
 
   private:
     /**
-     * Value of the lower
-     * bound. A number that
-     * satisfies the @ref match
-     * operation of this class
-     * must be equal to this
-     * value or larger, if the
-     * bounds of the interval for
-     * a valid range.
+     * Value of the lower bound. A number that satisfies the @ref match
+     * operation of this class must be equal to this value or larger, if
+     * the bounds of the interval for a valid range.
      */
     const double lower_bound;
 
     /**
-     * Value of the upper
-     * bound. A number that
-     * satisfies the @ref match
-     * operation of this class
-     * must be equal to this
-     * value or less, if the
-     * bounds of the interval for
-     * a valid range.
+     * Value of the upper bound. A number that satisfies the @ref match
+     * operation of this class must be equal to this value or less, if the
+     * bounds of the interval for a valid range.
      */
     const double upper_bound;
 
@@ -448,83 +305,59 @@ namespace Patterns
   };
 
   /**
-   * Test for the string being one
-   * of a sequence of values given
-   * like a regular expression. For
-   * example, if the string given
-   * to the constructor is
-   * <tt>"red|blue|black"</tt>, then the
-   * @ref match function returns
-   * <tt>true</tt> exactly if the string
-   * is either "red" or "blue" or
-   * "black". Spaces around the
-   * pipe signs do not matter and
-   * are eliminated.
+   * Test for the string being one of a sequence of values given like a
+   * regular expression. For example, if the string given to the
+   * constructor is <tt>"red|blue|black"</tt>, then the @ref match function
+   * returns <tt>true</tt> exactly if the string is either "red" or "blue"
+   * or "black". Spaces around the pipe signs do not matter and are
+   * eliminated.
    */
   class Selection : public PatternBase
   {
   public:
     /**
-     * Constructor. Take the
-     * given parameter as the
-     * specification of valid
+     * Constructor. Take the given parameter as the specification of valid
      * strings.
      */
     Selection (const std::string &seq);
 
     /**
-     * Return <tt>true</tt> if the
-     * string is an element of
-     * the description list
-     * passed to the constructor.
+     * Return <tt>true</tt> if the string is an element of the description
+     * list passed to the constructor.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match. Here, this is the
-     * list of valid strings
-     * passed to the constructor.
+     * Return a description of the pattern that valid strings are expected
+     * to match. Here, this is the list of valid strings passed to the
+     * constructor.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Determine an estimate for
-     * the memory consumption (in
-     * bytes) of this object.
+     * Determine an estimate for the memory consumption (in bytes) of this
+     * object.
      */
     std::size_t memory_consumption () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static Selection *create (const std::string &description);
 
   private:
     /**
-     * List of valid strings as
-     * passed to the
-     * constructor. We don't make
-     * this string constant, as
-     * we process it somewhat in
-     * the constructor.
+     * List of valid strings as passed to the constructor. We don't make
+     * this string constant, as we process it somewhat in the constructor.
      */
     std::string sequence;
 
@@ -536,40 +369,28 @@ namespace Patterns
 
 
   /**
-   * This pattern matches a list of
-   * comma-separated values each of which
-   * have to match a pattern given to the
-   * constructor. With two additional
-   * parameters, the number of elements this
-   * list has to have can be specified. If
-   * none is specified, the list may have
-   * zero or more entries.
+   * This pattern matches a list of comma-separated values each of which
+   * have to match a pattern given to the constructor. With two additional
+   * parameters, the number of elements this list has to have can be
+   * specified. If none is specified, the list may have zero or more
+   * entries.
    */
   class List : public PatternBase
   {
   public:
     /**
-     * Maximal integer value. If
-     * the numeric_limits class
-     * is available use this
-     * information to obtain the
-     * extremal values, otherwise
-     * set it so that this class
-     * understands that all values
-     * are allowed.
+     * Maximal integer value. If the numeric_limits class is available use
+     * this information to obtain the extremal values, otherwise set it so
+     * that this class understands that all values are allowed.
      */
     static const unsigned int max_int_value;
 
     /**
-     * Constructor. Take the
-     * given parameter as the
-     * specification of valid
+     * Constructor. Take the given parameter as the specification of valid
      * elements of the list.
      *
-     * The two other arguments can
-     * be used to denote minimal
-     * and maximal allowable
-     * lengths of the list.
+     * The two other arguments can be used to denote minimal and maximal
+     * allowable lengths of the list.
      */
     List (const PatternBase  &base_pattern,
           const unsigned int  min_elements = 0,
@@ -582,45 +403,34 @@ namespace Patterns
 
     /**
      * Return <tt>true</tt> if the
-     * string is a comma-separated
-     * list of strings each of
-     * which match the pattern
-     * given to the constructor.
+     * string is a comma-separated list of strings each of which match the
+     * pattern given to the constructor.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match.
+     * Return a description of the pattern that valid strings are expected
+     * to match.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static List *create (const std::string &description);
 
     /**
-     * Determine an estimate for
-     * the memory consumption (in
-     * bytes) of this object.
+     * Determine an estimate for the memory consumption (in bytes) of this
+     * object.
      */
     std::size_t memory_consumption () const;
 
@@ -637,21 +447,17 @@ namespace Patterns
     //@}
   private:
     /**
-     * Copy of the pattern that
-     * each element of the list has
-     * to satisfy.
+     * Copy of the pattern that each element of the list has to satisfy.
      */
     PatternBase *pattern;
 
     /**
-     * Minimum number of elements
-     * the list must have.
+     * Minimum number of elements the list must have.
      */
     const unsigned int min_elements;
 
     /**
-     * Maximum number of elements
-     * the list must have.
+     * Maximum number of elements the list must have.
      */
     const unsigned int max_elements;
 
@@ -663,47 +469,33 @@ namespace Patterns
 
 
   /**
-   * This pattern matches a list of
-   * comma-separated values each of which
-   * denotes a pair of key and value. Both key and value
-   * have to match a pattern given to the
-   * constructor. For each entry of the map,
-   * parameters have to be entered in the form
-   * <code>key: value</code>. In other words, a
-   * map is described in the form
+   * This pattern matches a list of comma-separated values each of which
+   * denotes a pair of key and value. Both key and value have to match a
+   * pattern given to the constructor. For each entry of the map,
+   * parameters have to be entered in the form <code>key: value</code>. In
+   * other words, a map is described in the form
    * <code>key1: value1, key2: value2, key3: value3, ...</code>.
    *
-   * With two additional
-   * parameters, the number of elements this
-   * list has to have can be specified. If
-   * none is specified, the map may have
-   * zero or more entries.
+   * With two additional parameters, the number of elements this list has
+   * to have can be specified. If none is specified, the map may have zero
+   * or more entries.
    */
   class Map : public PatternBase
   {
   public:
     /**
-     * Maximal integer value. If
-     * the numeric_limits class
-     * is available use this
-     * information to obtain the
-     * extremal values, otherwise
-     * set it so that this class
-     * understands that all values
-     * are allowed.
+     * Maximal integer value. If the numeric_limits class is available use
+     * this information to obtain the extremal values, otherwise set it so
+     * that this class understands that all values are allowed.
      */
     static const unsigned int max_int_value;
 
     /**
-     * Constructor. Take the
-     * given parameter as the
-     * specification of valid
+     * Constructor. Take the given parameter as the specification of valid
      * elements of the list.
      *
-     * The two other arguments can
-     * be used to denote minimal
-     * and maximal allowable
-     * lengths of the list.
+     * The two other arguments can be used to denote minimal and maximal
+     * allowable lengths of the list.
      */
     Map (const PatternBase  &key_pattern,
          const PatternBase  &value_pattern,
@@ -716,46 +508,34 @@ namespace Patterns
     virtual ~Map ();
 
     /**
-     * Return <tt>true</tt> if the
-     * string is a comma-separated
-     * list of strings each of
-     * which match the pattern
-     * given to the constructor.
+     * Return <tt>true</tt> if the string is a comma-separated list of
+     * strings each of which match the pattern given to the constructor.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match.
+     * Return a description of the pattern that valid strings are expected
+     * to match.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static Map *create (const std::string &description);
 
     /**
-     * Determine an estimate for
-     * the memory consumption (in
-     * bytes) of this object.
+     * Determine an estimate for the memory consumption (in bytes) of this
+     * object.
      */
     std::size_t memory_consumption () const;
 
@@ -772,22 +552,19 @@ namespace Patterns
     //@}
   private:
     /**
-     * Copy of the patterns that
-     * each key and each value of the map has
-     * to satisfy.
+     * Copy of the patterns that each key and each value of the map has to
+     * satisfy.
      */
     PatternBase *key_pattern;
     PatternBase *value_pattern;
 
     /**
-     * Minimum number of elements
-     * the list must have.
+     * Minimum number of elements the list must have.
      */
     const unsigned int min_elements;
 
     /**
-     * Maximum number of elements
-     * the list must have.
+     * Maximum number of elements the list must have.
      */
     const unsigned int max_elements;
 
@@ -799,80 +576,55 @@ namespace Patterns
 
 
   /**
-   * This class is much like the
-   * Selection class, but it
-   * allows the input to be a
-   * comma-separated list of values
-   * which each have to be given in
-   * the constructor
-   * argument. Alternatively, it
-   * could be viewed as a
-   * specialization of the List
-   * class. For example, if the
-   * string to the constructor was
-   * <tt>"ucd|gmv|eps"</tt>, then the
-   * following would be legal input:
-   * <tt>eps</tt>, <tt>gmv</tt>. You may give an
-   * arbitrarily long list of values,
-   * where there may be as many
-   * spaces around commas as you
-   * like.  However, commas are not
-   * allowed inside the values given
+   * This class is much like the Selection class, but it allows the input
+   * to be a comma-separated list of values which each have to be given in
+   * the constructor argument. Alternatively, it could be viewed as a
+   * specialization of the List class. For example, if the string to the
+   * constructor was <tt>"ucd|gmv|eps"</tt>, then the following would be
+   * legal input: <tt>eps</tt>, <tt>gmv</tt>. You may give an arbitrarily
+   * long list of values, where there may be as many spaces around commas
+   * as you like.  However, commas are not allowed inside the values given
    * to the constructor.
    */
   class MultipleSelection : public PatternBase
   {
   public:
     /**
-     * Constructor. Take the
-     * given parameter as the
-     * specification of valid
+     * Constructor. Take the given parameter as the specification of valid
      * strings.
      */
     MultipleSelection (const std::string &seq);
 
     /**
-     * Return <tt>true</tt> if the
-     * string is an element of
-     * the description list
-     * passed to the constructor.
+     * Return <tt>true</tt> if the string is an element of the description
+     * list passed to the constructor.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match. Here, this is the
-     * list of valid strings
-     * passed to the constructor.
+     * Return a description of the pattern that valid strings are expected
+     * to match. Here, this is the list of valid strings passed to the
+     * constructor.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static MultipleSelection *create (const std::string &description);
 
     /**
-     * Determine an estimate for
-     * the memory consumption (in
-     * bytes) of this object.
+     * Determine an estimate for the memory consumption (in bytes) of this
+     * object.
      */
     std::size_t memory_consumption () const;
 
@@ -889,12 +641,8 @@ namespace Patterns
     //@}
   private:
     /**
-     * List of valid strings as
-     * passed to the
-     * constructor. We don't make
-     * this string constant, as
-     * we process it somewhat in
-     * the constructor.
+     * List of valid strings as passed to the constructor. We don't make
+     * this string constant, as we process it somewhat in the constructor.
      */
     std::string sequence;
 
@@ -905,10 +653,8 @@ namespace Patterns
   };
 
   /**
-   * Test for the string being
-   * either "true" or "false". This
-   * is mapped to the Selection
-   * class.
+   * Test for the string being either "true" or "false". This is mapped to
+   * the Selection class.
    */
   class Bool : public Selection
   {
@@ -919,30 +665,22 @@ namespace Patterns
     Bool ();
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match.
+     * Return a description of the pattern that valid strings are expected
+     * to match.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static Bool *create (const std::string &description);
 
@@ -954,54 +692,40 @@ namespace Patterns
   };
 
   /**
-   * Always returns <tt>true</tt> when testing a
-   * string.
+   * Always returns <tt>true</tt> when testing a string.
    */
   class Anything : public PatternBase
   {
   public:
     /**
-     * Constructor. (Allow for at
-     * least one non-virtual
-     * function in this class, as
-     * otherwise sometimes no
-     * virtual table is emitted.)
+     * Constructor. (Allow for at least one non-virtual function in this
+     * class, as otherwise sometimes no virtual table is emitted.)
      */
     Anything ();
 
     /**
-     * Return <tt>true</tt> if the
-     * string matches its
-     * constraints, i.e. always.
+     * Return <tt>true</tt> if the string matches its constraints, i.e.
+     * always.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match. Here, this is the
-     * string <tt>"[Anything]"</tt>.
+     * Return a description of the pattern that valid strings are expected
+     * to match. Here, this is the string <tt>"[Anything]"</tt>.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static Anything *create (const std::string &description);
 
@@ -1014,70 +738,51 @@ namespace Patterns
 
 
   /**
-   * A pattern that can be used to indicate
-   * when a parameter is intended to be the
-   * name of a file. By itself, this class
-   * does not check whether the string that
-   * is given in a parameter file actually
-   * corresponds to an existing file (it
-   * could, for example, be the name of a
-   * file to which you want to write
-   * output). Functionally, the class is
-   * therefore equivalent to the Anything
-   * class. However, it allows to specify the
-   * <i>intent</i> of a parameter. The flag
-   * given to the constructor also allows to
-   * specify whether the file is supposed to
-   * be an input or output file.
+   * A pattern that can be used to indicate when a parameter is intended to
+   * be the name of a file. By itself, this class does not check whether
+   * the string that is given in a parameter file actually corresponds to
+   * an existing file (it could, for example, be the name of a file to
+   * which you want to write output). Functionally, the class is therefore
+   * equivalent to the Anything class. However, it allows to specify the
+   * <i>intent</i> of a parameter. The flag given to the constructor also
+   * allows to specify whether the file is supposed to be an input or
+   * output file.
    *
-   * The reason for the existence of this
-   * class is to support graphical user
-   * interfaces for editing parameter
-   * files. These may open a file selection
-   * dialog if the filename is supposed to
-   * represent an input file.
+   * The reason for the existence of this class is to support graphical
+   * user interfaces for editing parameter files. These may open a file
+   * selection dialog if the filename is supposed to represent an input
+   * file.
    */
   class FileName : public PatternBase
   {
   public:
     /**
-     * Files can be used for input
-     * or output. This can be
-     * specified in the constructor
-     * by choosing the flag <tt>type</tt>.
+     * Files can be used for input or output. This can be specified in the
+     * constructor by choosing the flag <tt>type</tt>.
      */
     enum FileType {input = 0, output = 1};
 
     /**
-     * Constructor.  The type of the file
-     * can be specified by choosing the
+     * Constructor.  The type of the file can be specified by choosing the
      * flag.
      */
     FileName (const FileType type = input);
 
     /**
-     * Return <tt>true</tt> if the
-     * string matches its
-     * constraints, i.e. always.
+     * Return <tt>true</tt> if the string matches its constraints, i.e.
+     * always.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match. Here, this is the
-     * string <tt>"[Filename]"</tt>.
+     * Return a description of the pattern that valid strings are expected
+     * to match. Here, this is the string <tt>"[Filename]"</tt>.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
@@ -1088,11 +793,9 @@ namespace Patterns
     FileType  file_type;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static FileName *create (const std::string &description);
 
@@ -1105,22 +808,16 @@ namespace Patterns
 
 
   /**
-   * A pattern that can be used to indicate
-   * when a parameter is intended to be the
-   * name of a directory. By itself, this
-   * class does not check whether the string
-   * that is given in a parameter file
-   * actually corresponds to an existing
-   * directory. Functionally, the class is
-   * therefore equivalent to the Anything
-   * class. However, it allows to specify the
-   * <i>intent</i> of a parameter.
+   * A pattern that can be used to indicate when a parameter is intended to
+   * be the name of a directory. By itself, this class does not check
+   * whether the string that is given in a parameter file actually
+   * corresponds to an existing directory. Functionally, the class is
+   * therefore equivalent to the Anything class. However, it allows to
+   * specify the <i>intent</i> of a parameter.
    *
-   * The reason for the existence of this
-   * class is to support graphical user
-   * interfaces for editing parameter
-   * files. These may open a file selection
-   * dialog to select or create a directory.
+   * The reason for the existence of this class is to support graphical
+   * user interfaces for editing parameter files. These may open a file
+   * selection dialog to select or create a directory.
    */
   class DirectoryName : public PatternBase
   {
@@ -1131,38 +828,28 @@ namespace Patterns
     DirectoryName ();
 
     /**
-     * Return <tt>true</tt> if the
-     * string matches its
-     * constraints, i.e. always.
+     * Return <tt>true</tt> if the string matches its constraints, i.e.
+     * always.
      */
     virtual bool match (const std::string &test_string) const;
 
     /**
-     * Return a description of
-     * the pattern that valid
-     * strings are expected to
-     * match. Here, this is the
-     * string <tt>"[Filename]"</tt>.
+     * Return a description of the pattern that valid strings are expected
+     * to match. Here, this is the string <tt>"[Filename]"</tt>.
      */
     virtual std::string description () const;
 
     /**
-     * Return a copy of the
-     * present object, which is
-     * newly allocated on the
-     * heap. Ownership of that
-     * object is transferred to
-     * the caller of this
+     * Return a copy of the present object, which is newly allocated on the
+     * heap. Ownership of that object is transferred to the caller of this
      * function.
      */
     virtual PatternBase *clone () const;
 
     /**
-     * Creates new object if the start of
-     * description matches
-     * description_init.  Ownership of that
-     * object is transferred to the caller
-     * of this function.
+     * Creates new object if the start of description matches
+     * description_init.  Ownership of that object is transferred to the
+     * caller of this function.
      */
     static DirectoryName *create (const std::string &description);
 
@@ -1176,10 +863,11 @@ namespace Patterns
 
 
 /**
- *   The ParameterHandler class provides a standard interface to an input file
- *   which provides at run-time for program parameters such as time step
- *   sizes, geometries, right hand sides etc. The input for the program is
- *   given in files, streams or strings in memory using text like
+ *   The ParameterHandler class provides a standard interface to an input
+ *   file which provides at run-time for program parameters such as time
+ *   step sizes, geometries, right hand sides etc. The input for the
+ *   program is given in files, streams or strings in memory using text
+ *   like
  *   @code
  *     set Time step size = 0.3
  *     set Geometry       = [0,1]x[0,3]
@@ -1187,16 +875,15 @@ namespace Patterns
  *   Input may be sorted into subsection trees in order to give the input a
  *   logical structure.
  *
- *   The ParameterHandler class is discussed in detail in the @ref
- *   step_19 "step-19" example program, and is used in more realistic
- *   situations in step-29, step-33
- *   and step-34.
+ *   The ParameterHandler class is discussed in detail in the @ref step_19
+ *   "step-19" example program, and is used in more realistic situations in
+ *   step-29, step-33 and step-34.
  *
  *   <h3>Declaring entries</h3>
  *
- *   In order to use the facilities of a ParameterHandler object, one first has
- *   to make known the different entries the input file may or may not contain. This
- *   is done in the following way:
+ *   In order to use the facilities of a ParameterHandler object, one first
+ *   has to make known the different entries the input file may or may not
+ *   contain. This is done in the following way:
  *
  *   @code
  *     ...
@@ -1210,26 +897,24 @@ namespace Patterns
  *                       Patterns::Anything());
  *     ...
  *   @endcode
- *   Each entry is declared using the function declare_entry(). The
- *   first parameter is the name of the entry (in short: the
- *   entry). The second is the default answer to be taken in case the
- *   entry is not specified in the input file. The third parameter is
- *   a regular expression which the input (and the default answer) has
- *   to match.  Several such regular expressions are defined in
- *   Patterns. This parameter can be omitted, in which case it
- *   will default to Patterns::Anything, i.e. a pattern that
+ *   Each entry is declared using the function declare_entry(). The first
+ *   parameter is the name of the entry (in short: the entry). The second
+ *   is the default answer to be taken in case the entry is not specified
+ *   in the input file. The third parameter is a regular expression which
+ *   the input (and the default answer) has to match.  Several such regular
+ *   expressions are defined in Patterns. This parameter can be omitted, in
+ *   which case it will default to Patterns::Anything, i.e. a pattern that
  *   matches every input string. The fourth parameter can be used to
  *   document the intent or expected format of an entry; its value is
- *   printed as a comment when writing all entries of a
- *   ParameterHandler object using the print_parameters()
- *   function to allow for easier understanding of a parameter
- *   file. It can be omitted as well, in which case no such
- *   documentation will be printed.
- *
- *   Entries may be located in subsections which form a kind of input tree. For example
- *   input parameters for linear solver routines should be classified in a subsection
- *   named <tt>Linear solver</tt> or any other suitable name. This is accomplished in the
- *   following way:
+ *   printed as a comment when writing all entries of a ParameterHandler
+ *   object using the print_parameters() function to allow for easier
+ *   understanding of a parameter file. It can be omitted as well, in which
+ *   case no such documentation will be printed.
+ *
+ *   Entries may be located in subsections which form a kind of input tree.
+ *   For example input parameters for linear solver routines should be
+ *   classified in a subsection named <tt>Linear solver</tt> or any other
+ *   suitable name. This is accomplished in the following way:
  *   @code
  *     ...
  *       LinEq eq;
@@ -1252,9 +937,10 @@ namespace Patterns
  *     }
  *   @endcode
  *
- *   Subsections may be nested. For example a nonlinear solver may have a linear solver
- *   as member object. Then the function call tree would be something like (if the class
- *   <tt>NonLinEq</tt> has a member variables <tt>eq</tt> of type <tt>LinEq</tt>):
+ *   Subsections may be nested. For example a nonlinear solver may have a
+ *   linear solver as member object. Then the function call tree would be
+ *   something like (if the class <tt>NonLinEq</tt> has a member variables
+ *   <tt>eq</tt> of type <tt>LinEq</tt>):
  *   @code
  *     void NonLinEq::declare_parameters (ParameterHandler &prm) {
  *       prm.enter_subsection ("Nonlinear solver");
@@ -1268,15 +954,15 @@ namespace Patterns
  *     }
  *   @endcode
  *
- *   For class member functions which declare the different entries we propose
- *   to use the common name <tt>declare_parameters</tt>. In normal cases this
- *   method can be <tt>static</tt> since the entries will not depend on any
- *   previous knowledge. Classes for which entries should logically be grouped
- *   into subsections should declare these subsections themselves. If a class
- *   has two or more member variables of the same type both of which should
- *   have their own parameters, this parent class' method
- *   <tt>declare_parameters</tt> is responsible to group them into different
- *   subsections:
+ *   For class member functions which declare the different entries we
+ *   propose to use the common name <tt>declare_parameters</tt>. In normal
+ *   cases this method can be <tt>static</tt> since the entries will not
+ *   depend on any previous knowledge. Classes for which entries should
+ *   logically be grouped into subsections should declare these subsections
+ *   themselves. If a class has two or more member variables of the same
+ *   type both of which should have their own parameters, this parent
+ *   class' method <tt>declare_parameters</tt> is responsible to group them
+ *   into different subsections:
  *   @code
  *     void NonLinEq::declare_parameters (ParameterHandler &prm) {
  *       prm.enter_subsection ("Nonlinear solver");
@@ -1313,27 +999,30 @@ namespace Patterns
  *     end
  *     ...                       # other stuff
  *   @endcode
- *   The words <tt>subsection</tt>, <tt>set</tt> and <tt>end</tt> may be either written in lowercase or uppercase
- *   letters. Leading and trailing whitespace is removed, multiple whitespace is condensed into
- *   only one. Since the latter applies also to the name of an entry, an entry name will not
- *   be recognized if in the declaration multiple whitespace is used.
+ *   The words <tt>subsection</tt>, <tt>set</tt> and <tt>end</tt> may be
+ *   either written in lowercase or uppercase letters. Leading and trailing
+ *   whitespace is removed, multiple whitespace is condensed into only one.
+ *   Since the latter applies also to the name of an entry, an entry name
+ *   will not be recognized if in the declaration multiple whitespace is
+ *   used.
  *
- *   In entry names and values the following characters are not allowed: <tt>\#</tt>, <tt>{</tt>,
- *   <tt>}</tt>, <tt>|</tt>. Their use is reserved for the MultipleParameterLoop class.
+ *   In entry names and values the following characters are not allowed:
+ *   <tt>\#</tt>, <tt>{</tt>, <tt>}</tt>, <tt>|</tt>. Their use is reserved
+ *   for the MultipleParameterLoop class.
  *
  *   Comments starting with \# are skipped.
  *
- *   We propose to use the following
- *   scheme to name entries: start the first word with a capital letter and use lowercase
- *   letters further on. The same applies to the possible entry values to the right of the
+ *   We propose to use the following scheme to name entries: start the
+ *   first word with a capital letter and use lowercase letters further on.
+ *   The same applies to the possible entry values to the right of the
  *   <tt>=</tt> sign.
  *
  *
  *   <h3>Reading data from input sources</h3>
  *
- *   In order to read input you can use three possibilities: reading from an
- *   <tt>std::istream</tt> object, reading from a file of which the name is
- *   given and reading from a string in memory in which the lines are
+ *   In order to read input you can use three possibilities: reading from
+ *   an <tt>std::istream</tt> object, reading from a file of which the name
+ *   is given and reading from a string in memory in which the lines are
  *   separated by <tt>@\n</tt> characters. These possibilities are used as
  *   follows:
  *   @code
@@ -1349,40 +1038,42 @@ namespace Patterns
  *     prm.read_input_from_string (in);
  *     ...
  *   @endcode
- *   You can use several sources of input successively. Entries which are changed more than
- *   once will be overwritten every time they are used.
+ *   You can use several sources of input successively. Entries which are
+ *   changed more than once will be overwritten every time they are used.
  *
  *   You should not try to declare entries using declare_entry() and
  *   enter_subsection() with as yet unknown subsection names after
  *   using read_input(). The results in this case are unspecified.
  *
- *   If an error occurs upon reading the input, error messages are written to
- *   <tt>std::cerr</tt> and the reader function returns with a return value of
- *   <code>false</code>. This is opposed to almost all other functions in
- *   deal.II, which would normally throw an exception if an error occurs; this
- *   difference in behavior is a relic of the fact that this class predates
- *   deal.II and had previously been written for a different project.
+ *   If an error occurs upon reading the input, error messages are written
+ *   to <tt>std::cerr</tt> and the reader function returns with a return
+ *   value of <code>false</code>. This is opposed to almost all other
+ *   functions in deal.II, which would normally throw an exception if an
+ *   error occurs; this difference in behavior is a relic of the fact that
+ *   this class predates deal.II and had previously been written for a
+ *   different project.
  *
  *
  *   <h3>Using the %ParameterHandler Graphical User Interface</h3>
  *
  *   An alternative to using the hand-written input files shown above is to
- *   use the graphical user interface (GUI) that accompanies this class. For
- *   this, you first need to write a description of all the parameters, their
- *   default values, patterns and documentation strings into a file in a
- *   format that the GUI can understand; this is done using the
- *   ParameterHandler::print_parameters() function with ParameterHandler::XML
- *   as second argument, as discussed in more detail below in the
- *   <i>Representation of Parameters</i> section. This file can then be loaded
- *   using the executable for the GUI, which should be located in
- *   <code>lib/bin/dealii_parameter_gui</code> of your deal.II installation,
- *   assuming that you have a sufficiently recent version of the <a
- *   href="http://qt.nokia.com/">Qt toolkit</a> installed.
+ *   use the graphical user interface (GUI) that accompanies this class.
+ *   For this, you first need to write a description of all the parameters,
+ *   their default values, patterns and documentation strings into a file
+ *   in a format that the GUI can understand; this is done using the
+ *   ParameterHandler::print_parameters() function with
+ *   ParameterHandler::XML as second argument, as discussed in more detail
+ *   below in the <i>Representation of Parameters</i> section. This file
+ *   can then be loaded using the executable for the GUI, which should be
+ *   located in <code>lib/bin/dealii_parameter_gui</code> of your deal.II
+ *   installation, assuming that you have a sufficiently recent version of
+ *   the <a href="http://qt.nokia.com/">Qt toolkit</a> installed.
  *
  *   Once loaded, the GUI displays subsections and individual parameters in
  *   tree form (see also the discussion in the <i>Representation of
- *   Parameters</i> section below). Here is a screen shot with some
- *   sub-sections expanded and one parameter selected for editing:
+ *   Parameters</i> section below). Here is a screen shot
+ *   with some sub-sections expanded and one parameter selected for
+ *   editing:
  *
  *   @image html parameter_gui.png "Parameter GUI"
  *
@@ -1403,54 +1094,61 @@ namespace Patterns
  *       prm.leave_subsection ();
  *     }
  *   @endcode
- *   get() returns the value of the given entry. If the entry was not specified in the input
- *   source(s), the default value is returned. You have to enter and leave subsections
- *   exactly as you did when declaring subsection. You may chose the order in which to
- *   transverse the subsection tree.
- *
- *   It is guaranteed that only entries matching the given regular expression are returned,
- *   i.e. an input entry value which does not match the regular expression is not stored.
- *
- *   You can use get() to retrieve the parameter in text form, get_integer() to get an integer
- *   or get_double() to get a double. You can also use get_bool().
- *   It will cause an internal error if the string could not be
- *   converted to an integer, double or a bool. This should, though, not
- *   happen if you correctly specified the regular expression for this entry; you should not
- *   try to get out an integer or a double from an entry for which no according regular
- *   expression was set. The internal error is raised through the Assert() macro family
- *   which only works in debug mode.
+ *   get() returns the value of the given entry. If the entry was not
+ *   specified in the input source(s), the default value is returned. You
+ *   have to enter and leave subsections exactly as you did when declaring
+ *   subsection. You may chose the order in which to transverse the
+ *   subsection tree.
+ *
+ *   It is guaranteed that only entries matching the given regular
+ *   expression are returned, i.e. an input entry value which does not
+ *   match the regular expression is not stored.
+ *
+ *   You can use get() to retrieve the parameter in text form,
+ *   get_integer() to get an integer or get_double() to get a double. You
+ *   can also use get_bool(). It will cause an internal error if the string
+ *   could not be converted to an integer, double or a bool. This should,
+ *   though, not happen if you correctly specified the regular expression
+ *   for this entry; you should not try to get out an integer or a double
+ *   from an entry for which no according regular expression was set. The
+ *   internal error is raised through the Assert() macro family which only
+ *   works in debug mode.
  *
  *   If you want to print out all user selectable features, use the
- *   print_parameters() function. It is generally a good idea to print all parameters
- *   at the beginning of a log file, since this way input and output are together in
- *   one file which makes matching at a later time easier. Additionally, the function
- *   also print those entries which have not been modified in the input file und are
- *   thus set to default values; since default values may change in the process of
- *   program development, you cannot know the values of parameters not specified in the
- *   input file.
+ *   print_parameters() function. It is generally a good idea to print all
+ *   parameters at the beginning of a log file, since this way input and
+ *   output are together in one file which makes matching at a later time
+ *   easier. Additionally, the function also print those entries which have
+ *   not been modified in the input file und are thus set to default
+ *   values; since default values may change in the process of program
+ *   development, you cannot know the values of parameters not specified in
+ *   the input file.
  *
  *
  *   <h3>Style guide for data retrieval</h3>
  *
- *   We propose that every class which gets data out of a
- *   ParameterHandler object provides a function named
- *   <tt>get_parameters</tt>. This should be declared
- *   <tt>virtual</tt>. <tt>get_parameters</tt> functions in derived classes
- *   should call the <tt>BaseClass::get_parameters</tt> function.
+ *   We propose that every class which gets data out of a ParameterHandler
+ *   object provides a function named <tt>get_parameters</tt>. This should
+ *   be declared <tt>virtual</tt>. <tt>get_parameters</tt> functions in
+ *   derived classes should call the <tt>BaseClass::get_parameters</tt>
+ *   function.
  *
  *
  *   <h3>Experience with large parameter lists</h3>
  *
- *   Experience has shown that in programs defining larger numbers of parameters (more than,
- *   say, fifty) it is advantageous to define an additional class holding these parameters.
- *   This class is more like a C-style structure, having a large number of variables,
- *   usually public. It then has at least two functions, which declare and parse the
- *   parameters. In the main program, the main class has an object of this parameter class
- *   and delegates declaration and parsing of parameters to this object.
+ *   Experience has shown that in programs defining larger numbers of
+ *   parameters (more than, say, fifty) it is advantageous to define an
+ *   additional class holding these parameters. This class is more like a
+ *   C-style structure, having a large number of variables, usually public.
+ *   It then has at least two functions, which declare and parse the
+ *   parameters. In the main program, the main class has an object of this
+ *   parameter class and delegates declaration and parsing of parameters to
+ *   this object.
  *
- *   The advantage of this approach is that you can keep out the technical details
- *   (declaration and parsing) out of the main class and additionally don't clutter
- *   up your main class with dozens or more variables denoting the parameters.
+ *   The advantage of this approach is that you can keep out the technical
+ *   details (declaration and parsing) out of the main class and
+ *   additionally don't clutter up your main class with dozens or more
+ *   variables denoting the parameters.
  *
  *
  *
@@ -1701,9 +1399,9 @@ namespace Patterns
  *     prm.leave_subsection ();
  *   @endcode
  *
- *   We can think of the parameters so arranged as a file system in which every
- *   parameter is a directory. The name of this directory is the name of the
- *   parameter, and in this directory lie files that describe the
+ *   We can think of the parameters so arranged as a file system in which
+ *   every parameter is a directory. The name of this directory is the name
+ *   of the parameter, and in this directory lie files that describe the
  *   parameter. These files are:
  *   - <code>value</code>: The content of this file is the current value of this
  *     parameter; initially, the content of the file equals the default value of
@@ -1720,13 +1418,13 @@ namespace Patterns
  *   With the exception of the <code>value</code> file, the contents of files
  *   are never changed after declaration of a parameter.
  *
- *   Alternatively, a directory in this file system may not have a file called
- *   <code>value</code> in it. In that case, the directory represents a
- *   subsection as declared above, and the directory's name will correspond to
- *   the name of the subsection. It will then have no files in it at all, but
- *   it may have further directories in it: some of these directories will be
- *   parameters (indicates by the presence of files) or further nested
- *   subsections.
+ *   Alternatively, a directory in this file system may not have a file
+ *   called <code>value</code> in it. In that case, the directory
+ *   represents a subsection as declared above, and the directory's name
+ *   will correspond to the name of the subsection. It will then have no
+ *   files in it at all, but it may have further directories in it: some of
+ *   these directories will be parameters (indicates by the presence of
+ *   files) or further nested subsections.
  *
  *   Given this explanation, the code above will lead to a hierarchical
  *   representation of data that looks like this (the content of files is
@@ -1791,74 +1489,57 @@ class ParameterHandler : public Subscriptor
 {
 private:
   /**
-   * Inhibit automatic
-   * CopyConstructor.
+   * Inhibit automatic CopyConstructor.
    */
   ParameterHandler (const ParameterHandler &);
 
   /**
-   * Inhibit automatic
-   * assignment operator.
+   * Inhibit automatic assignment operator.
    */
   ParameterHandler &operator= (const ParameterHandler &);
 
 public:
   /**
-   * List of possible output
-   * formats.
+   * List of possible output formats.
    *
-   * The formats down the list with
-   * prefix <em>Short</em> and bit
-   * 6 and 7 set reproduce the old
-   * behavior of not writing
-   * comments or original values to
-   * the files.
+   * The formats down the list with prefix <em>Short</em> and bit 6 and 7
+   * set reproduce the old behavior of not writing comments or original
+   * values to the files.
    */
   enum OutputStyle
   {
     /**
-     * Write human readable
-     * output suitable to be
-     * read by ParameterHandler
+     * Write human readable output suitable to be read by ParameterHandler
      * again.
      */
     Text = 1,
     /**
-     * Write parameters as a
-     * LaTeX table.
+     * Write parameters as a LaTeX table.
      */
     LaTeX = 2,
     /**
-     * Write out declared parameters
-     * with description and possible
-     * values.
+     * Write out declared parameters with description and possible values.
      */
     Description = 3,
 
     /**
-     * Write out everything as
-     * an <a href="http://en.wikipedia.org/wiki/XML">XML</a>
-     * file.
+     * Write out everything as an <a
+     * href="http://en.wikipedia.org/wiki/XML">XML</a> file.
      *
-     * See the general
-     * documentation of this
-     * class for an example of
+     * See the general documentation of this class for an example of
      * output.
      */
     XML = 4,
 
     /**
-     * Write out everything as
-     * a <a href="http://en.wikipedia.org/wiki/JSON">JSON</a>
-     * file.
+     * Write out everything as a <a
+     * href="http://en.wikipedia.org/wiki/JSON">JSON</a> file.
      */
     JSON = 5,
 
     /**
-     * Write input for
-     * ParameterHandler without
-     * comments or changed
-     * default values.
+     * Write input for ParameterHandler without comments or changed default
+     * values.
      */
     ShortText = 193
   };
@@ -1871,73 +1552,51 @@ public:
   ParameterHandler ();
 
   /**
-   * Destructor. Declare this only
-   * to have a virtual destructor,
-   * which is safer as we have
-   * virtual functions.  It
-   * actually does nothing
+   * Destructor. Declare this only to have a virtual destructor, which is
+   * safer as we have virtual functions.  It actually does nothing
    * spectacular.
    */
   virtual ~ParameterHandler ();
 
   /**
-   * Read input from a stream until
-   * stream returns <tt>eof</tt>
-   * condition or error.
+   * Read input from a stream until stream returns <tt>eof</tt> condition
+   * or error.
    *
-   * Return whether the read was
-   * successful.
+   * Return whether the read was successful.
    */
   virtual bool read_input (std::istream &input);
 
   /**
-   * Read input from a file the
-   * name of which is given. The
-   * PathSearch class "PARAMETERS"
-   * is used to find the file.
+   * Read input from a file the name of which is given. The PathSearch
+   * class "PARAMETERS" is used to find the file.
    *
-   * Return whether the read was
-   * successful.
+   * Return whether the read was successful.
    *
-   * Unless <tt>optional</tt> is
-   * <tt>true</tt>, this function
-   * will automatically generate
-   * the requested file with
-   * default values if the file did
-   * not exist. This file will not
-   * contain additional comments if
-   * <tt>write_stripped_file</tt>
-   * is <tt>true</tt>.
+   * Unless <tt>optional</tt> is <tt>true</tt>, this function will
+   * automatically generate the requested file with default values if the
+   * file did not exist. This file will not contain additional comments if
+   * <tt>write_stripped_file</tt> is <tt>true</tt>.
    */
   virtual bool read_input (const std::string &filename,
                            const bool optional = false,
                            const bool write_stripped_file = false);
 
   /**
-   * Read input from a string in
-   * memory. The lines in memory
-   * have to be separated by <tt>@\n</tt>
-   * characters.
+   * Read input from a string in memory. The lines in memory have to be
+   * separated by <tt>@\n</tt> characters.
    *
-   * Return whether the read was
-   * successful.
+   * Return whether the read was successful.
    */
   virtual bool read_input_from_string (const char *s);
 
   /**
-   * Read a parameter file in XML
-   * format. This could be from a file
-   * originally written by the
-   * print_parameters() function using the
-   * XML output style and then modified by
-   * hand as necessary; or from a file
-   * written using this method and then
-   * modified by the graphical parameter
-   * GUI (see the general documentation of
-   * this class).
+   * Read a parameter file in XML format. This could be from a file
+   * originally written by the print_parameters() function using the XML
+   * output style and then modified by hand as necessary; or from a file
+   * written using this method and then modified by the graphical parameter
+   * GUI (see the general documentation of this class).
    *
-   * Return whether the read was
-   * successful.
+   * Return whether the read was successful.
    */
   virtual bool read_input_from_xml (std::istream &input);
 
@@ -1948,30 +1607,17 @@ public:
 
 
   /**
-   * Declare a new entry with name
-   * <tt>entry</tt>, default and for
-   * which any input has to match
-   * the <tt>pattern</tt> (default: any
-   * pattern).
+   * Declare a new entry with name <tt>entry</tt>, default and for which
+   * any input has to match the <tt>pattern</tt> (default: any pattern).
    *
-   * The last parameter defaulting
-   * to an empty string is used to
-   * add a documenting text to each
-   * entry which will be printed as
-   * a comment when this class is
-   * asked to write out all
-   * declarations to a stream using
-   * the print_parameters()
-   * function.
+   * The last parameter defaulting to an empty string is used to add a
+   * documenting text to each entry which will be printed as a comment when
+   * this class is asked to write out all declarations to a stream using
+   * the print_parameters() function.
    *
-   * The function generates an
-   * exception if the default value
-   * doesn't match the given
-   * pattern. An entry can be
-   * declared more than once
-   * without generating an error,
-   * for example to override an
-   * earlier default value.
+   * The function generates an exception if the default value doesn't match
+   * the given pattern. An entry can be declared more than once without
+   * generating an error, for example to override an earlier default value.
    */
   void declare_entry (const std::string           &entry,
                       const std::string           &default_value,
@@ -1979,221 +1625,146 @@ public:
                       const std::string           &documentation = std::string());
 
   /**
-   * Enter a subsection; if not yet
-   * existent, declare it.
+   * Enter a subsection; if not yet existent, declare it.
    */
   void enter_subsection (const std::string &subsection);
 
   /**
-   * Leave present subsection.
-   * Return <tt>false</tt> if there is
-   * no subsection to leave; <tt>true</tt>
-   * otherwise.
+   * Leave present subsection. Return <tt>false</tt> if there is no
+   * subsection to leave; <tt>true</tt> otherwise.
    */
   bool leave_subsection ();
 
   /**
-   * Return value of entry
-   * <tt>entry_string</tt>.  If the
-   * entry was changed, then the
-   * changed value is returned,
-   * otherwise the default
-   * value. If the value of an
-   * undeclared entry is required,
-   * an exception will be thrown.
+   * Return value of entry <tt>entry_string</tt>.  If the entry was
+   * changed, then the changed value is returned, otherwise the default
+   * value. If the value of an undeclared entry is required, an exception
+   * will be thrown.
    */
   std::string get (const std::string &entry_string) const;
 
   /**
-   * Return value of entry
-   * <tt>entry_string</tt> as <tt>long
-   * int</tt>. (A long int is chosen so
-   * that even very large unsigned values
-   * can be returned by this function).
+   * Return value of entry <tt>entry_string</tt> as <tt>long int</tt>. (A
+   * long int is chosen so that even very large unsigned values can be
+   * returned by this function).
    */
   long int       get_integer (const std::string &entry_string) const;
 
   /**
-   * Return value of entry
-   * <tt>entry_name</tt> as
-   * <tt>double</tt>.
+   * Return value of entry <tt>entry_name</tt> as <tt>double</tt>.
    */
   double         get_double (const std::string &entry_name) const;
 
   /**
-   * Return value of entry
-   * <tt>entry_name</tt> as <tt>bool</tt>.
-   * The entry may be "true" or "yes"
-   * for <tt>true</tt>, "false" or
-   * "no" for <tt>false</tt> respectively.
+   * Return value of entry <tt>entry_name</tt> as <tt>bool</tt>. The entry
+   * may be "true" or "yes" for <tt>true</tt>, "false" or "no" for
+   * <tt>false</tt> respectively.
    */
   bool           get_bool (const std::string &entry_name) const;
 
   /**
-   * Change the value presently stored for
-   * <tt>entry_name</tt> to the one given
-   * in the second argument.
+   * Change the value presently stored for <tt>entry_name</tt> to the one
+   * given in the second argument.
    *
-   * The parameter must already exist in
-   * the present subsection.
+   * The parameter must already exist in the present subsection.
    *
-   * The function throws an
-   * exception of type
-   * ExcValueDoesNotMatchPattern
-   * if the new value does not
-   * conform to the pattern for
-   * this entry.
+   * The function throws an exception of type ExcValueDoesNotMatchPattern
+   * if the new value does not conform to the pattern for this entry.
    */
   void           set (const std::string &entry_name,
                       const std::string &new_value);
 
   /**
-   * Same as above, but an overload where
-   * the second argument is a character
-   * pointer. This is necessary, since
-   * otherwise the call to
-   * <tt>set("abc","def")</code> will be
-   * mapped to the function taking one
-   * string and a bool as arguments, which
-   * is certainly not what is most often
-   * intended.
+   * Same as above, but an overload where the second argument is a
+   * character pointer. This is necessary, since otherwise the call to
+   * <tt>set("abc","def")</code> will be mapped to the function taking one
+   * string and a bool as arguments, which is certainly not what is most
+   * often intended.
    *
-   * The function throws an
-   * exception of type
-   * ExcValueDoesNotMatchPattern
-   * if the new value does not
-   * conform to the pattern for
-   * this entry.
+   * The function throws an exception of type ExcValueDoesNotMatchPattern
+   * if the new value does not conform to the pattern for this entry.
    */
   void           set (const std::string &entry_name,
                       const char        *new_value);
 
   /**
-   * Change the value presently stored for
-   * <tt>entry_name</tt> to the one given
-   * in the second argument.
+   * Change the value presently stored for <tt>entry_name</tt> to the one
+   * given in the second argument.
    *
-   * The parameter must already exist in
-   * the present subsection.
+   * The parameter must already exist in the present subsection.
    *
-   * The function throws an
-   * exception of type
-   * ExcValueDoesNotMatchPattern
-   * if the new value does not
-   * conform to the pattern for
-   * this entry.
+   * The function throws an exception of type ExcValueDoesNotMatchPattern
+   * if the new value does not conform to the pattern for this entry.
    */
   void           set (const std::string &entry_name,
                       const long int    &new_value);
 
   /**
-   * Change the value presently stored for
-   * <tt>entry_name</tt> to the one given
-   * in the second argument.
+   * Change the value presently stored for <tt>entry_name</tt> to the one
+   * given in the second argument.
    *
-   * The parameter must already exist in
-   * the present subsection.
+   * The parameter must already exist in the present subsection.
    *
-   * For internal purposes, the new value
-   * needs to be converted to a
-   * string. This is done using 16 digits
-   * of accuracy, so the set value and the
-   * one you can get back out using
-   * get_double() may differ in the 16th
+   * For internal purposes, the new value needs to be converted to a
+   * string. This is done using 16 digits of accuracy, so the set value and
+   * the one you can get back out using get_double() may differ in the 16th
    * digit.
    *
-   * The function throws an
-   * exception of type
-   * ExcValueDoesNotMatchPattern
-   * if the new value does not
-   * conform to the pattern for
-   * this entry.
+   * The function throws an exception of type ExcValueDoesNotMatchPattern
+   * if the new value does not conform to the pattern for this entry.
    */
   void           set (const std::string &entry_name,
                       const double      &new_value);
 
   /**
-   * Change the value presently stored for
-   * <tt>entry_name</tt> to the one given
-   * in the second argument.
+   * Change the value presently stored for <tt>entry_name</tt> to the one
+   * given in the second argument.
    *
-   * The parameter must already exist in
-   * the present subsection.
+   * The parameter must already exist in the present subsection.
    *
-   * The function throws an
-   * exception of type
-   * ExcValueDoesNotMatchPattern
-   * if the new value does not
-   * conform to the pattern for
-   * this entry.
+   * The function throws an exception of type ExcValueDoesNotMatchPattern
+   * if the new value does not conform to the pattern for this entry.
    */
   void           set (const std::string &entry_name,
                       const bool        &new_value);
 
 
   /**
-   * Print all parameters with the
-   * given style to
-   * <tt>out</tt>. Presently only
-   * <tt>Text</tt> and <tt>LaTeX</tt> are
-   * implemented.
+   * Print all parameters with the given style to <tt>out</tt>. Presently
+   * only <tt>Text</tt> and <tt>LaTeX</tt> are implemented.
    *
-   * In <tt>Text</tt> format, the output
-   * is formatted in such a way
-   * that it is possible to use it
-   * for later input again. This is
-   * most useful to record the
-   * parameters for a specific run,
-   * since if you output the
-   * parameters using this function
-   * into a log file, you can
-   * always recover the results by
-   * simply copying the output to
-   * your input file.
+   * In <tt>Text</tt> format, the output is formatted in such a way that it
+   * is possible to use it for later input again. This is most useful to
+   * record the parameters for a specific run, since if you output the
+   * parameters using this function into a log file, you can always recover
+   * the results by simply copying the output to your input file.
    *
-   * Besides the name and value of
-   * each entry, the output also
-   * contains the default value of
-   * entries if it is different
-   * from the actual value, as well
-   * as the documenting string
-   * given to the
-   * declare_entry() function
+   * Besides the name and value of each entry, the output also contains the
+   * default value of entries if it is different from the actual value, as
+   * well as the documenting string given to the declare_entry() function
    * if available.
    *
-   * In <tt>Text</tt> format, the
-   * output contains the same information
-   * but in a format so that the
-   * resulting file can be input into
-   * a latex document such as a manual
-   * for the code for which this object
-   * handles run-time parameters.
-   * The various sections of parameters
-   * are then represented by latex
-   * section and subsection commands
-   * as well as by nested enumerations.
+   * In <tt>Text</tt> format, the output contains the same information but
+   * in a format so that the resulting file can be input into a latex
+   * document such as a manual for the code for which this object handles
+   * run-time parameters. The various sections of parameters are then
+   * represented by latex section and subsection commands as well as by
+   * nested enumerations.
    *
-   * In addition, all parameter names
-   * are listed with <code>@\index</code>
-   * statements in two indices called
-   * <code>prmindex</code> (where the
-   * name of each parameter is listed
-   * in the index) and <code>prmindexfull</code>
-   * where parameter names are listed
-   * sorted by the section in which
-   * they exist. By default, the LaTeX
-   * program ignores these <code>@\index</code>
-   * commands, but they can be used to
-   * generate an index by using the
-   * following commands in the preamble
-   * of the latex file:
+   * In addition, all parameter names are listed with <code>@\index</code>
+   * statements in two indices called <code>prmindex</code> (where the name
+   * of each parameter is listed in the index) and
+   * <code>prmindexfull</code> where parameter names are listed sorted by
+   * the section in which they exist. By default, the LaTeX program ignores
+   * these <code>@\index</code> commands, but they can be used to generate
+   * an index by using the following commands in the preamble of the latex
+   * file:
    * @code
    * \usepackage{imakeidx}
    * \makeindex[name=prmindex, title=Index of run-time parameter entries]
    * \makeindex[name=prmindexfull, title=Index of run-time parameters with section names]
    * @endcode
-   * and at the end of the file
-   * this:
+   * and at the end of the file this:
    * @code
    * \printindex[prmindex]
    * \printindex[prmindexfull]
@@ -2203,76 +1774,51 @@ public:
                                   const OutputStyle  style);
 
   /**
-   * Print out the parameters of
-   * the present subsection as
-   * given by the
-   * <tt>subsection_path</tt> member
-   * variable. This variable is
-   * controlled by entering and
-   * leaving subsections through
-   * the enter_subsection() and
-   * leave_subsection()
-   * functions.
+   * Print out the parameters of the present subsection as given by the
+   * <tt>subsection_path</tt> member variable. This variable is controlled
+   * by entering and leaving subsections through the enter_subsection() and
+   * leave_subsection() functions.
    *
-   * In most cases, you will not
-   * want to use this function
-   * directly, but have it called
-   * recursively by the previous
-   * function.
+   * In most cases, you will not want to use this function directly, but
+   * have it called recursively by the previous function.
    */
   void print_parameters_section (std::ostream       &out,
                                  const OutputStyle   style,
                                  const unsigned int  indent_level);
 
   /**
-   * Print parameters to a
-   * logstream.  This function
-   * allows to print all parameters
-   * into a log-file.  Sections
-   * will be indented in the usual
+   * Print parameters to a logstream. This function allows to print all
+   * parameters into a log-file. Sections will be indented in the usual
    * log-file style.
    */
   void log_parameters (LogStream &out);
 
   /**
-   * Log parameters in the present
-   * subsection. The subsection is
-   * determined by the
-   * <tt>subsection_path</tt> member
-   * variable. This variable is
-   * controlled by entering and
-   * leaving subsections through
-   * the enter_subsection() and
-   * leave_subsection()
-   * functions.
+   * Log parameters in the present subsection. The subsection is determined
+   * by the <tt>subsection_path</tt> member variable. This variable is
+   * controlled by entering and leaving subsections through the
+   * enter_subsection() and leave_subsection() functions.
    *
-   * In most cases, you will not
-   * want to use this function
-   * directly, but have it called
-   * recursively by the previous
-   * function.
+   * In most cases, you will not want to use this function directly, but
+   * have it called recursively by the previous function.
    */
   void log_parameters_section (LogStream &out);
 
   /**
-   * Determine an estimate for
-   * the memory consumption (in
-   * bytes) of this
+   * Determine an estimate for the memory consumption (in bytes) of this
    * object.
    */
   std::size_t memory_consumption () const;
 
   /**
-   * Write the data of this object to a
-   * stream for the purpose of
+   * Write the data of this object to a stream for the purpose of
    * serialization.
    */
   template <class Archive>
   void save (Archive &ar, const unsigned int version) const;
 
   /**
-   * Read the data of this object from a
-   * stream for the purpose of
+   * Read the data of this object from a stream for the purpose of
    * serialization.
    */
   template <class Archive>
@@ -2320,104 +1866,73 @@ public:
   //@}
 private:
   /**
-   * The separator used when
-   * accessing elements of a path
-   * into the parameter tree.
+   * The separator used when accessing elements of a path into the
+   * parameter tree.
    */
   static const char path_separator = '.';
 
   /**
-   * The complete tree of sections
-   * and entries. See the general
-   * documentation of this class
-   * for a description how data is
-   * stored in this variable.
+   * The complete tree of sections and entries. See the general
+   * documentation of this class for a description how data is stored in
+   * this variable.
    *
-   * The variable is a pointer so
-   * that we can use an incomplete
-   * type, rather than having to
-   * include all of the
-   * property_tree stuff from
-   * boost. This works around a
-   * problem with gcc 4.5.
+   * The variable is a pointer so that we can use an incomplete type,
+   * rather than having to include all of the property_tree stuff from
+   * boost. This works around a problem with gcc 4.5.
    */
   std::auto_ptr<boost::property_tree::ptree> entries;
 
   /**
-   * A list of patterns that are
-   * used to describe the
-   * parameters of this object. The
-   * are indexed by nodes in the
-   * property tree.
+   * A list of patterns that are used to describe the parameters of this
+   * object. The are indexed by nodes in the property tree.
    */
   std::vector<std_cxx1x::shared_ptr<const Patterns::PatternBase> > patterns;
 
   /**
-   * Mangle a string so that it
-   * doesn't contain any special
-   * characters or spaces.
+   * Mangle a string so that it doesn't contain any special characters or
+   * spaces.
    */
   static std::string mangle (const std::string &s);
 
   /**
-   * Unmangle a string into its
-   * original form.
+   * Unmangle a string into its original form.
    */
   static std::string demangle (const std::string &s);
 
   /**
-   * Return whether a given node is
-   * a parameter node or a
-   * subsection node.
+   * Return whether a given node is a parameter node or a subsection node.
    */
   static bool is_parameter_node (const boost::property_tree::ptree &);
 
   /**
-   * Path of presently selected
-   * subsections; empty list means
-   * top level
+   * Path of presently selected subsections; empty list means top level
    */
   std::vector<std::string> subsection_path;
 
   /**
-   * Return the string that
-   * identifies the current path
-   * into the property tree. This
-   * is only a path, i.e. it is not
-   * terminated by the
+   * Return the string that identifies the current path into the property
+   * tree. This is only a path, i.e. it is not terminated by the
    * path_separator character.
    */
   std::string get_current_path () const;
 
   /**
-   * Given the name of an entry as
-   * argument, the function
-   * computes a full path into the
-   * parameter tree using the
-   * current subsection.
+   * Given the name of an entry as argument, the function computes a full
+   * path into the parameter tree using the current subsection.
    */
   std::string get_current_full_path (const std::string &name) const;
 
   /**
-   * Scan one line of input.
-   * <tt>lineno</tt> is the number of
-   * the line presently scanned
-   * (for the logs if there are
-   * messages). Return <tt>false</tt> if
-   * line contained stuff that
-   * could not be understood, the
-   * uppermost subsection was to be
-   * left by an <tt>END</tt> or <tt>end</tt>
-   * statement, a value for a
-   * non-declared entry was given
-   * or the entry value did not
-   * match the regular
-   * expression. <tt>true</tt> otherwise.
+   * Scan one line of input. <tt>lineno</tt> is the number of the line
+   * presently scanned (for the logs if there are messages). Return
+   * <tt>false</tt> if line contained stuff that could not be understood,
+   * the uppermost subsection was to be left by an <tt>END</tt> or
+   * <tt>end</tt> statement, a value for a non-declared entry was given or
+   * the entry value did not match the regular expression. <tt>true</tt>
+   * otherwise.
    *
-   * The function modifies its
-   * argument, but also takes it by
-   * value, so the caller's
-   * variable is not changed.
+   * The function modifies its argument, but also takes it by value, so the
+   * caller's variable is not changed.
    */
   bool scan_line (std::string         line,
                   const unsigned int  lineno);
@@ -2428,57 +1943,64 @@ private:
 
 
 /**
- *   The class MultipleParameterLoop offers an easy possibility to test several
- *   parameter sets during one run of the program. For this it uses the
- *   ParameterHandler class to read in data in a standardized form, searches for
- *   variant entry values and performs a loop over all combinations of parameters.
+ *   The class MultipleParameterLoop offers an easy possibility to test
+ *   several parameter sets during one run of the program. For this it uses
+ *   the ParameterHandler class to read in data in a standardized form,
+ *   searches for variant entry values and performs a loop over all
+ *   combinations of parameters.
  *
  *   Variant entry values are given like this:
  *   @verbatim
  *     set Time step size = { 0.1 | 0.2 | 0.3 }
  *   @endverbatim
- *   The loop will then perform three runs of the program, one for each value
- *   of <tt>Time step size</tt>, while all other parameters are as specified or with their
- *   default value. If there are several variant entry values in the input, a loop is
- *   performed for each combination of variant values:
+ *   The loop will then perform three runs of the program, one for each
+ *   value of <tt>Time step size</tt>, while all other parameters are as
+ *   specified or with their default value. If there are several variant
+ *   entry values in the input, a loop is performed for each combination of
+ *   variant values:
  *   @verbatim
  *     set Time step size = { 0.1 | 0.2 }
  *     set Solver         = { CG  | GMRES }
  *   @endverbatim
- *   will result in four runs of the programs, with time step 0.1 and 0.2 for each
- *   of the two solvers.
+ *   will result in four runs of the programs, with time step 0.1 and 0.2
+ *   for each of the two solvers.
  *
- *   In addition to variant entries, this class also supports <i>array entries</i> that look like this:
+ *   In addition to variant entries, this class also supports <i>array
+ *   entries</i> that look like this:
  *   @verbatim
  *     set Output file = ofile.{{ 1 | 2 | 3 | 4 }}
  *   @endverbatim
- *   This indicates that if there are variant entries producing a total of four
- *   different runs, then we will write their results to the files <tt>ofile.1</tt>, <tt>ofile.2</tt>,
- *   <tt>ofile.3</tt> and <tt>ofile.4</tt>, respectively. Array entries do not generate multiple
- *   runs of the main loop themselves, but if there are variant entries, then in
- *   the <i>n</i>th run of the main loop, also the <i>n</i>th value of an array is returned.
- *
- *   Since the different variants are constructed in the order of declaration, not in
- *   the order in which the variant entries appear in the input file, it may be
- *   difficult to guess the mapping between the different variants and the appropriate
- *   entry in an array. You will have to check the order of declaration, or use
- *   only one variant entry.
- *
- *   It is guaranteed that only selections which match the regular expression (pattern) given
- *   upon declaration of an entry are given back to the program. If a variant value
- *   does not match the regular expression, the default value is stored and an error
- *   is issued. Before the first run of the loop, all possible values are checked
- *   for their conformance, so that the error is issued at the very beginning of the
+ *   This indicates that if there are variant entries producing a total of
+ *   four different runs, then we will write their results to the files
+ *   <tt>ofile.1</tt>, <tt>ofile.2</tt>, <tt>ofile.3</tt> and
+ *   <tt>ofile.4</tt>, respectively. Array entries do not generate multiple
+ *   runs of the main loop themselves, but if there are variant entries,
+ *   then in the <i>n</i>th run of the main loop, also the <i>n</i>th value
+ *   of an array is returned.
+ *
+ *   Since the different variants are constructed in the order of
+ *   declaration, not in the order in which the variant entries appear in
+ *   the input file, it may be difficult to guess the mapping between the
+ *   different variants and the appropriate entry in an array. You will
+ *   have to check the order of declaration, or use only one variant entry.
+ *
+ *   It is guaranteed that only selections which match the regular
+ *   expression (pattern) given upon declaration of an entry are given back
+ *   to the program. If a variant value does not match the regular
+ *   expression, the default value is stored and an error is issued. Before
+ *   the first run of the loop, all possible values are checked for their
+ *   conformance, so that the error is issued at the very beginning of the
  *   program.
  *
  *
  *   <h3>Usage</h3>
  *
- *   The usage of this class is similar to the ParameterHandler class. First the
- *   entries and subsections have to be declared, then a loop is performed in which
- *   the different parameter sets are set, a new instance of a user class is created
- *   which is then called. Taking the classes of the example for the
- *   ParameterHandler class, the extended program would look like this:
+ *   The usage of this class is similar to the ParameterHandler class.
+ *   First the entries and subsections have to be declared, then a loop is
+ *   performed in which the different parameter sets are set, a new
+ *   instance of a user class is created which is then called. Taking the
+ *   classes of the example for the ParameterHandler class, the extended
+ *   program would look like this:
  *   @code
  *     class HelperClass : public MultipleParameterLoop::UserClass {
  *       public:
@@ -2525,25 +2047,25 @@ private:
  *     }
  *   @endcode
  *
- *   As can be seen, first a new helper class has to be set up. This must contain
- *   a virtual constructor for a problem class. You can also derive your problem
- *   class from MultipleParameterLoop::UserClass and let <tt>create_new</tt> clear all
- *   member variables. If you have access to all inherited member variables in
- *   some way this is the recommended procedure. A third possibility is to use
- *   multiple inheritance and derive a helper class from both the
- *   MultipleParameterLoop::UserClass and the problem class. In any case,
- *   <tt>create_new</tt> has to provide a clean problem object which is the problem in
- *   the second and third possibility.
- *
- *   The derived class also
- *   has to provide for member functions which declare the entries and which run
- *   the program. Running the program includes getting the parameters out of the
- *   ParameterHandler object.
+ *   As can be seen, first a new helper class has to be set up. This must
+ *   contain a virtual constructor for a problem class. You can also derive
+ *   your problem class from MultipleParameterLoop::UserClass and let
+ *   <tt>create_new</tt> clear all member variables. If you have access to
+ *   all inherited member variables in some way this is the recommended
+ *   procedure. A third possibility is to use multiple inheritance and
+ *   derive a helper class from both the MultipleParameterLoop::UserClass
+ *   and the problem class. In any case, <tt>create_new</tt> has to provide
+ *   a clean problem object which is the problem in the second and third
+ *   possibility.
+ *
+ *   The derived class also has to provide for member functions which
+ *   declare the entries and which run the program. Running the program
+ *   includes getting the parameters out of the ParameterHandler object.
  *
  *   After defining an object of this helper class and an object of the
- *   MultipleParameterLoop class, the entries have to be declared in the same way
- *   as for the ParameterHandler class. Then the input has to be read. Finally
- *   the loop is called. This executes the following steps:
+ *   MultipleParameterLoop class, the entries have to be declared in the
+ *   same way as for the ParameterHandler class. Then the input has to be
+ *   read. Finally the loop is called. This executes the following steps:
  *   @code
  *     for (each combination)
  *       {
@@ -2554,9 +2076,9 @@ private:
  *         UserObject.run (*this);
  *       }
  *   @endcode
- *   <tt>UserObject</tt> is the parameter to the <tt>loop</tt> function. <tt>create_new</tt> is given the number
- *   of the run (starting from one) to enable naming output files differently for each
*   run.
+ *   <tt>UserObject</tt> is the parameter to the <tt>loop</tt> function.
+ *   <tt>create_new</tt> is given the number of the run (starting from one)
 *   to enable naming output files differently for each run.
  *
  *
  *   <h3>Syntax for variant and array entry values</h3>
@@ -2574,8 +2096,8 @@ private:
  *
  *   <h3>Worked example</h3>
  *
- *   Given the above extensions to the example program for the ParameterHandler and the
- *   following input file
+ *   Given the above extensions to the example program for the
+ *   ParameterHandler and the following input file
  *   @verbatim
  *     set Equation 1 = Poisson
  *     set Equation 2 = Navier-Stokes
@@ -2630,8 +2152,8 @@ private:
  *              eq1=Poisson, eq2=Navier-Stokes
  *              Matrix1=Sparse, Matrix2=Full
  *   @endverbatim
- *   Since <tt>create_new</tt> gets the number of the run it would also be possible to output
- *   the number of the run.
+ *   Since <tt>create_new</tt> gets the number of the run it would also be
+ *   possible to output the number of the run.
  *
  *
  *   @ingroup input
@@ -2641,37 +2163,32 @@ class MultipleParameterLoop : public ParameterHandler
 {
 public:
   /**
-   * This is the class the helper class or the
-   * problem class has to be derived of.
+   * This is the class the helper class or the problem class has to be
+   * derived of.
    */
   class UserClass
   {
   public:
     /**
-     * Destructor. It doesn't actually do
-     * anything, but is declared to force
-     * derived classes to have a virtual
-     * destructor.
+     * Destructor. It doesn't actually do anything, but is declared to
+     * force derived classes to have a virtual destructor.
      */
     virtual ~UserClass ();
 
     /**
-     * <tt>create_new</tt> must provide a clean
-     * object, either by creating a new one
-     * or by cleaning an old one.
+     * <tt>create_new</tt> must provide a clean object, either by creating
+     * a new one or by cleaning an old one.
      */
     virtual void create_new (const unsigned int run_no) = 0;
 
     /**
-     * This should declare parameters and call
-     * the <tt>declare_parameters</tt> function of the
-     * problem class.
+     * This should declare parameters and call the
+     * <tt>declare_parameters</tt> function of the problem class.
      */
     virtual void declare_parameters (ParameterHandler &prm) = 0;
 
     /**
-     * Get the parameters and run any
-     * necessary action.
+     * Get the parameters and run any necessary action.
      */
     virtual void run (ParameterHandler &prm) = 0;
   };
@@ -2682,10 +2199,9 @@ public:
   MultipleParameterLoop ();
 
   /**
-   * Destructor. Declare this only to have
-   * a virtual destructor, which is safer
-   * as we have virtual functions.
-   * It actually does nothing spectacular.
+   * Destructor. Declare this only to have a virtual destructor, which is
+   * safer as we have virtual functions. It actually does nothing
+   * spectacular.
    */
   virtual ~MultipleParameterLoop ();
 
@@ -2695,9 +2211,8 @@ public:
                            const bool write_stripped_file = false);
 
   /**
-   * Read input from a string in memory. The
-   *  lines in memory have to be separated by
-   *  <tt>@\n</tt> characters.
+   * Read input from a string in memory. The lines in memory have to be
+   * separated by <tt>@\n</tt> characters.
    */
   virtual bool read_input_from_string (const char *s);
 
@@ -2707,9 +2222,7 @@ public:
   void loop (UserClass &uc);
 
   /**
-   * Determine an estimate for
-   * the memory consumption (in
-   * bytes) of this
+   * Determine an estimate for the memory consumption (in bytes) of this
    * object.
    */
   std::size_t memory_consumption () const;
@@ -2717,17 +2230,14 @@ public:
 private:
 
   /**
-   * An object in the list of entries with
-   * multiple values.
+   * An object in the list of entries with multiple values.
    */
   class Entry
   {
   public:
     /**
-     * Declare what a multiple entry
-     * is: a variant * entry (in
-     * curly braces <tt>{</tt>, <tt>}</tt>) or an
-     * array (in double curly braces
+     * Declare what a multiple entry is: a variant * entry (in curly braces
+     * <tt>{</tt>, <tt>}</tt>) or an array (in double curly braces
      * <tt>{{</tt>, <tt>}}</tt>).
      */
     enum MultipleEntryType
@@ -2741,18 +2251,16 @@ private:
     Entry () : type (array) {}
 
     /**
-     * Construct an object with given subsection
-     * path, name and value. The splitting up
-     * into the different variants is done
-     * later by <tt>split_different_values</tt>.
+     * Construct an object with given subsection path, name and value. The
+     * splitting up into the different variants is done later by
+     * <tt>split_different_values</tt>.
      */
     Entry (const std::vector<std::string> &Path,
            const std::string              &Name,
            const std::string              &Value);
 
     /**
-     * Split the entry value into the different
-     * branches.
+     * Split the entry value into the different branches.
      */
     void split_different_values ();
 
@@ -2772,22 +2280,18 @@ private:
     std::string         entry_value;
 
     /**
-     * List of entry values constructed out of
-     * what was given in the input file (that
-     * is stored in EntryValue.
+     * List of entry values constructed out of what was given in the input
+     * file (that is stored in EntryValue.
      */
     std::vector<std::string> different_values;
 
     /**
-     * Store whether this entry is a variant
-     * entry or an array.
+     * Store whether this entry is a variant entry or an array.
      */
     MultipleEntryType      type;
 
     /**
-     * Determine an estimate for
-     * the memory consumption (in
-     * bytes) of this
+     * Determine an estimate for the memory consumption (in bytes) of this
      * object.
      */
     std::size_t memory_consumption () const;
@@ -2799,37 +2303,26 @@ private:
   std::vector<Entry> multiple_choices;
 
   /**
-   * Number of branches constructed
-   * from the different
-   * combinations of the variants.
-   * This obviously equals the
-   * number of runs to be
-   * performed.
+   * Number of branches constructed from the different combinations of the
+   * variants. This obviously equals the number of runs to be performed.
    */
   unsigned int n_branches;
 
   /**
-   * Initialize the different
-   * branches, i.e.  construct the
-   * combinations.
+   * Initialize the different branches, i.e.  construct the combinations.
    */
   void init_branches ();
 
   /**
-   * Traverse the section currently
-   * set by
-   * enter_subsection()/leave_subsection()
-   * and see which of the entries
-   * are variante/array
-   * entries. Then fill the
-   * multiple_choices variable
-   * using this information.
+   * Traverse the section currently set by
+   * enter_subsection()/leave_subsection() and see which of the entries are
+   * variante/array entries. Then fill the multiple_choices variable using
+   * this information.
    */
   void init_branches_current_section ();
 
   /**
-   * Transfer the entry values for one run
-   * to the entry tree.
+   * Transfer the entry values for one run to the entry tree.
    */
   void fill_entry_values (const unsigned int run_no);
 };
index b0bcf54e0414423c577fd2d5ebeedbd4712f45b1..408ec9ae178f59ab07e78c9cc548e49e95b55bfe 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2009, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__parsed_function_h
 #define __deal2__parsed_function_h
index 68d4c4d720bcb8cc73e616815fe10106dfa04f83..977f40a3216fd768b4bb2dce280cd7f22521a236 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012 by deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__partitioner_h
 #define __deal2__partitioner_h
 
@@ -20,6 +24,7 @@
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/memory_consumption.h>
 
+#include <limits>
 
 
 DEAL_II_NAMESPACE_OPEN
@@ -204,7 +209,7 @@ namespace Utilities
        * the individual processor on the ghost
        * elements present (second entry).
        */
-      const std::vector<std::pair<unsigned int,unsigned int> > &
+      const std::vector<std::pair<unsigned int, types::global_dof_index> > &
       ghost_targets() const;
 
       /**
@@ -215,7 +220,7 @@ namespace Utilities
        * but tailored to be iterated over, and some
        * indices may be duplicates.
        */
-      const std::vector<std::pair<unsigned int, unsigned int> > &
+      const std::vector<std::pair<types::global_dof_index, types::global_dof_index> > &
       import_indices() const;
 
       /**
@@ -233,7 +238,7 @@ namespace Utilities
        * indices that are ghosts on other
        * processors.
        */
-      const std::vector<std::pair<unsigned int,unsigned int> > &
+      const std::vector<std::pair<unsigned int, types::global_dof_index> > &
       import_targets() const;
 
       /**
@@ -272,7 +277,7 @@ namespace Utilities
        * Returns the MPI communicator underlying the
        * partitioner object.
        */
-      const MPI_Commget_communicator() const;
+      const MPI_Comm &get_communicator() const;
 
       /**
        * Computes the memory consumption of this
@@ -284,7 +289,8 @@ namespace Utilities
        * Exception
        */
       DeclException2 (ExcIndexNotPresent,
-                      unsigned int, unsigned int,
+                      types::global_dof_index,
+                      unsigned int,
                       << "Global index " << arg1
                       << " neither owned nor ghost on proc " << arg2);
 
@@ -325,7 +331,7 @@ namespace Utilities
        * ghost indices belong to and how many those
        * indices are
        */
-      std::vector<std::pair<unsigned int,unsigned int> > ghost_targets_data;
+      std::vector<std::pair<unsigned int, types::global_dof_index> > ghost_targets_data;
 
       /**
        * The set of (local) indices that we are
@@ -335,7 +341,7 @@ namespace Utilities
        * but tailored to be iterated over, and some
        * indices may be duplicates.
        */
-      std::vector<std::pair<unsigned int, unsigned int> > import_indices_data;
+      std::vector<std::pair<types::global_dof_index, types::global_dof_index> > import_indices_data;
 
       /**
        * Caches the number of ghost indices. It
@@ -349,7 +355,7 @@ namespace Utilities
        * The set of processors and length of data
        * field which send us their ghost data
        */
-      std::vector<std::pair<unsigned int,unsigned int> > import_targets_data;
+      std::vector<std::pair<unsigned int,types::global_dof_index> > import_targets_data;
 
       /**
        * The ID of the current processor in the MPI
@@ -405,7 +411,10 @@ namespace Utilities
     unsigned int
     Partitioner::local_size () const
     {
-      return local_range_data.second - local_range_data.first;
+      types::global_dof_index size= local_range_data.second - local_range_data.first;
+      Assert(size<=std::numeric_limits<unsigned int>::max(),
+             ExcNotImplemented());
+      return static_cast<unsigned int>(size);
     }
 
 
@@ -441,10 +450,10 @@ namespace Utilities
       Assert(in_local_range(global_index) || is_ghost_entry (global_index),
              ExcIndexNotPresent(global_index, my_pid));
       if (in_local_range(global_index))
-        return global_index - local_range_data.first;
+        return static_cast<unsigned int>(global_index - local_range_data.first);
       else if (is_ghost_entry (global_index))
         return (local_size() +
-                ghost_indices_data.index_within_set (global_index));
+                static_cast<unsigned int>(ghost_indices_data.index_within_set (global_index)));
       else
         // should only end up here in
         // optimized mode, when we use this
@@ -487,7 +496,7 @@ namespace Utilities
 
 
     inline
-    const std::vector<std::pair<unsigned int,unsigned int> > &
+    const std::vector<std::pair<unsigned int, types::global_dof_index> > &
     Partitioner::ghost_targets() const
     {
       return ghost_targets_data;
@@ -495,7 +504,7 @@ namespace Utilities
 
 
     inline
-    const std::vector<std::pair<unsigned int, unsigned int> > &
+    const std::vector<std::pair<types::global_dof_index, types::global_dof_index> > &
     Partitioner::import_indices() const
     {
       return import_indices_data;
@@ -513,7 +522,7 @@ namespace Utilities
 
 
     inline
-    const std::vector<std::pair<unsigned int,unsigned int> > &
+    const std::vector<std::pair<unsigned int,types::global_dof_index> > &
     Partitioner::import_targets() const
     {
       return import_targets_data;
@@ -565,7 +574,7 @@ namespace Utilities
 
 
     inline
-    const MPI_Comm&
+    const MPI_Comm &
     Partitioner::get_communicator() const
     {
       return communicator;
index c9c3ea70e3e5f0ebf23eb182306ed4018cc539c2..0f47865a7a5e1bd177a8b216bf5a835a07fe2724 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__path_search_h
 #define __deal2__path_search_h
 
index c33ea938c8d2536fc41a85d83a77c91e9137035a..921fe9e463ae4a46113b364e63cbbb4ff0c40565 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__point_h
 #define __deal2__point_h
 
index ec33ec38a819d3ce49f9402e875910e15663aeaa..49b75b09c283b87ef253f53879561ff1c04f1748 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__polynomial_h
 #define __deal2__polynomial_h
 
index 7fa0ca79dc53ec1a73d04b7736b07f47b9102f81..7865f3f5818e09e5f05b740fd90fbf47623e4e76 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__polynomial_space_h
 #define __deal2__polynomial_space_h
 
@@ -44,7 +49,7 @@ DEAL_II_NAMESPACE_OPEN
  * set_numbering() function.
  *
  * The standard ordering of polynomials is that indices for the first
- * space dimension vasry fastest and the last space dimension is
+ * space dimension vary fastest and the last space dimension is
  * slowest. In particular, if we take for simplicity the vector of
  * monomials <i>x<sup>0</sup>, x<sup>1</sup>, x<sup>2</sup>,...,
  * x<sup>n</sup></i>, we get
index e211186dfb78da5dc968398416968d8855c0a1d8..9219937e03a1fccad17cd285a6c729ec6a948d3f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__polynomials_abf_h
 #define __deal2__polynomials_abf_h
 
index a840d1f5c426096bad5ccd955fe66b3efd647ba5..dbff105228f491039a6677ece8539dd2509370e8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__polynomials_adini_h
 #define __deal2__polynomials_adini_h
index 5eb1b18620dff462450d5a2a22a2fba54f88337c..83f4bf1bab4bbd6780333897b1695e97053f5e2c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__polynomials_BDM_h
 #define __deal2__polynomials_BDM_h
 
index e571bfb9283fbb13fe83d3c87944e2299a3a62e6..7fa2cce6e7ba5deca256f6889f7d537deb29b7d6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__polynomials_nedelec_h
 #define __deal2__polynomials_nedelec_h
index e7a50068affd9f8ffc8caabbe55f9a8941d17f1b..1723f120e042214a5c3b447cf3b7f3f507103e8e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__polynomials_P_h
 #define __deal2__polynomials_P_h
 
index c9e1dbbcaa1fdb0851cf3376badff96a1b804746..8ff4d0b786e0019bacddd65cce6011b2ef9c1ae4 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__polynomials_piecewise_h
 #define __deal2__polynomials_piecewise_h
 
@@ -187,7 +192,7 @@ namespace Polynomials
               y = offset+step+step-x;
           }
         else
-          { 
+          {
             const number offset = step * interval;
             if (x<offset || x>offset+step)
               return 0;
index 9aa9ae4d4b2d0889ab30b72857f3fb4d70599562..749aae8bec5939df64f0a593a3fa9e37fb6fd40f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__polynomials_raviart_thomas_h
 #define __deal2__polynomials_raviart_thomas_h
 
index c89c41ffe7e87f42948c445561fac55b8605bf74..5831c33fd22d34e88513a7e03882e3a153693a9d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__qprojector_h
 #define __deal2__qprojector_h
 
index cfe06b50fc6309834eebafcf6a1e57fb3899f2e9..58dd4fbc1d4492e82f537ce1e1167d408bf75fda 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__quadrature_h
 #define __deal2__quadrature_h
 
index b152a99937ce2ec609e4b326a68679547652492c..f8759a4a9d13618b8e5a572236c2b4bf0831f9a5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__quadrature_lib_h
 #define __deal2__quadrature_lib_h
 
@@ -295,7 +300,7 @@ public:
    * $[x_0,1]$, the actual location of the
    * singularity, the scale factor inside
    * the logarithmic function and a flag
-   * that decides wether the singularity is
+   * that decides whether the singularity is
    * left inside the quadrature formula or
    * it is factored out, to be included in
    * the integrand.
@@ -334,7 +339,7 @@ protected:
  * original quadrature, and this process is repeated for the next half
  * element.
  *
- * Upon construction it is possible to specify wether we want the
+ * Upon construction it is possible to specify whether we want the
  * singularity removed, or not. In other words, this quadrature can be
  * used to integrate $g(x) = 1/R\ f(x)$, or simply $f(x)$, with the $1/R$
  * factor already included in the quadrature weights.
index be61b286d1c967daa75da668af9b025042968121..48fe8dffe0b1fa855a9d2d1a622dd42b968c28b0 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__quadrature_selector_h
 #define __deal2__quadrature_selector_h
index b1a1fbfce641a179bb5a3dbb010c6c4f4523c407..f61e2b3681c31875138ed95bd4056916ed536076 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__smartpointer_h
 #define __deal2__smartpointer_h
 
index b9e7a72f8b04b6e2cd35962b3f9feb9c790bb883..c660d09b546f6eb07af66fbc6871a6f17046b8ea 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_array_h
 #define __deal2__std_cxx1x_array_h
 
index 49979bef2e1aa2c02f585b22855a279b56e69e0f..0c14d2ad0af34ab2ae95dee913e6b7f88d756a7c 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_bind_h
 #define __deal2__std_cxx1x_bind_h
 
index b439d5c91ab0f06f519a64530091626b9e8702dc..89429ef2fcfb4f0e6f3c7c5b08421becf0a60b70 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_condition_variable_h
 #define __deal2__std_cxx1x_condition_variable_h
 
index 18f807e49947fa4d84b7b3a0016ddce1643b5dfd..d3e902ff894ea5b655d0bc2bb43484a5bca929d7 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_function_h
 #define __deal2__std_cxx1x_function_h
 
index df5652a4be097643b75000ba20a3007897de9690..817ebda660445380dfdf35dd2aa74e07ac80e1ff 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_mutex_h
 #define __deal2__std_cxx1x_mutex_h
 
index d51ccb5a2b8442757b4382a369546de1ae6f0889..f8a6744ce536e07ee589badad51a88011b7f4a2d 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_shared_ptr_h
 #define __deal2__std_cxx1x_shared_ptr_h
 
index bcbc1c5dfa91d156e20461b87aafccbf488bb7fd..6b43b2525abe7e2cfcd7d56b6fbccaa863b5e2b0 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_thread_h
 #define __deal2__std_cxx1x_thread_h
 
index 4bcf46951f7dcff3724428ae5fada0b62922296c..0282c112da6354689786e34d95203fb024dfffde 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_tuple_h
 #define __deal2__std_cxx1x_tuple_h
 
index 31bceaaf67415f8e9d4e8cfa49b1fc08671dae81..f64cf36d60a974644a5447e6d02eb1c9a91e58d8 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__std_cxx1x_type_traits_h
 #define __deal2__std_cxx1x_type_traits_h
 
index 0345b95575096f0c5d53a690761768fa389b9d9c..a6372e016eb7b7cd71a886465a61d0f7f41068be 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__subscriptor_h
 #define __deal2__subscriptor_h
 
@@ -131,10 +136,10 @@ public:
                  int, char *, std::string &,
                  << "Object of class " << arg2
                  << " is still used by " << arg1 << " other objects.\n"
-                << "(Additional information: " << arg3 << ")\n"
-                << "Note the entry in the Frequently Asked Questions of "
-                << "deal.II (linked to from http://www.dealii.org/) for "
-                << "more information on what this error means.");
+                 << "(Additional information: " << arg3 << ")\n"
+                 << "Note the entry in the Frequently Asked Questions of "
+                 << "deal.II (linked to from http://www.dealii.org/) for "
+                 << "more information on what this error means.");
 
   /**
    * A subscriber with the
index 6f1d47d62687b317e15a03e312494ee12f768867..dd79b821d5082aba4c513966cce0d87e1c919820 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__symmetric_tensor_h
 #define __deal2__symmetric_tensor_h
 
index 2c47dba5ae6aeeaaac58934c96ee27460775ba33..4bc42d379e84c5332ec083f57966af1e47910adf 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__synchronous_iterator_h
 #define __deal2__synchronous_iterator_h
 
index 83fa7444469ee3c4bbd2e5896fb29e8c61c48db2..4f884dc414d66d5dd4889cb76da5847868fcb48e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__table_h
 #define __deal2__table_h
 
@@ -634,15 +639,27 @@ public:
   operator () (const TableIndices<N> &indices) const;
 
   /**
-   * Determine an estimate for the
-   * memory consumption (in bytes)
-   * of this object.
+   * Swap the contents of this table and the other table @p v. One could do
+   * this operation with a temporary variable and copying over the data
+   * elements, but this function is significantly more efficient since it only
+   * swaps the pointers to the data of the two vectors and therefore does not
+   * need to allocate temporary storage and move data around.
+   *
+   * This function is analog to the the @p swap function of all C++ standard
+   * containers. Also, there is a global function <tt>swap(u,v)</tt> that
+   * simply calls <tt>u.swap(v)</tt>, again in analogy to standard functions.
+   */
+  void swap (TableBase<N,T> &v);
+
+  /**
+   * Determine an estimate for the memory consumption (in bytes) of this
+   * object.
    */
   std::size_t memory_consumption () const;
 
   /**
-   * Write or read the data of this object to or
-   * from a stream for the purpose of serialization.
+   * Write or read the data of this object to or from a stream for the purpose
+   * of serialization.
    */
   template <class Archive>
   void serialize (Archive &ar, const unsigned int version);
@@ -2077,6 +2094,17 @@ TableBase<N,T>::fill (const T2 *entries)
 
 
 
+template <int N, typename T>
+inline
+void
+TableBase<N,T>::swap (TableBase<N,T> &v)
+{
+  values.swap(v.values);
+  std::swap (table_size, v.table_size);
+}
+
+
+
 template <int N, typename T>
 inline
 std::size_t
@@ -3168,6 +3196,23 @@ Table<7,T>::operator () (const TableIndices<7> &indices)
 
 
 #endif // DOXYGEN
+
+
+
+/**
+ * Global function @p swap which overloads the default implementation
+ * of the C++ standard library which uses a temporary object. The
+ * function simply exchanges the data of the two tables.
+ *
+ * @author Martin Kronbichler, 2013
+ */
+template <int N, typename T>
+inline
+void swap (TableBase<N,T> &u, TableBase<N,T> &v)
+{
+  u.swap (v);
+}
+
 DEAL_II_NAMESPACE_CLOSE
 
 #endif
index c760d35523724124fcd50fc0a5a09bd978adf5af..0e2aebf0fe664e8448acb3083f66d63f6968545d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__table_handler_h
 #define __deal2__table_handler_h
 
@@ -120,7 +125,7 @@ namespace internal
     /**
      * Abbreviation for the data type stored by this object.
      */
-    typedef boost::variant<int,unsigned int,double,std::string> value_type;
+    typedef boost::variant<int,unsigned int,unsigned long long int,double,std::string> value_type;
 
     /**
      * Stored value.
index 6e4f5414fe97761f60f19bda6eaa3d4bc7ef675b..44dd9fd9a620e4f018b1db39723b6e7a36532599 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__table_indices_h
 #define __deal2__table_indices_h
 
@@ -42,6 +47,12 @@ public:
    */
   unsigned int operator[] (const unsigned int i) const;
 
+  /**
+   * Write access the value of the
+   * <tt>i</tt>th index.
+   */
+  unsigned int &operator[] (const unsigned int i);
+
   /**
    * Compare two index fields for
    * equality.
@@ -142,7 +153,7 @@ public:
 };
 
 //TODO: Remove the default arguments and trickery below and put all
-//the constructors into the class demplate
+//the constructors into the class template
 
 /**
  * Array of indices of fixed size used for the TableBase
@@ -424,6 +435,14 @@ TableIndicesBase<N>::operator [] (const unsigned int i) const
   return indices[i];
 }
 
+template <int N>
+inline
+unsigned int &
+TableIndicesBase<N>::operator [] (const unsigned int i)
+{
+  Assert (i < N, ExcIndexRange (i, 0, N));
+  return indices[i];
+}
 
 
 template <int N>
index 368251b61edc67e40fe655be206d669d68e17114..f77a552c71b2d1c7d3232d32138c7d0daf38c3df 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__template_constraints_h
 #define __deal2__template_constraints_h
 
index c151cb197fca3174647e9bff510e2873fb3b44a8..5ddc7dc75230a0a170e558d4511c2a20f8d7a3de 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tensor_h
 #define __deal2__tensor_h
 
@@ -71,6 +76,14 @@ public:
    */
   static const unsigned int rank      = rank_;
 
+  /**
+   * Number of independent components of a
+   * tensor of current rank. This is dim times the
+   * number of independent components of each sub-tensor.
+   */
+  static const unsigned int
+  n_independent_components = Tensor<rank_-1,dim>::n_independent_components *dim;
+
   /**
    * Type of stored objects. This
    * is a tensor of lower rank.
@@ -135,6 +148,16 @@ public:
    */
   const Tensor<rank_-1,dim,Number> &operator [] (const unsigned int i) const;
 
+  /**
+   * Read access using TableIndices <tt>indices</tt>
+   */
+  Number operator [](const TableIndices<rank_> &indices) const;
+
+  /**
+   * Read and write access using TableIndices <tt>indices</tt>
+   */
+  Number &operator [](const TableIndices<rank_> &indices);
+
   /**
    *  Assignment operator.
    */
@@ -242,6 +265,24 @@ public:
   template <typename Number2>
   void unroll (Vector<Number2> &result) const;
 
+  /**
+   * Returns an unrolled index in
+   * the range [0,dim^rank-1] for the element of the tensor indexed by
+   * the argument to the function.
+   */
+  static
+  unsigned int
+  component_to_unrolled_index(const TableIndices<rank_> &indices);
+
+  /**
+   * Opposite of  component_to_unrolled_index: For an index in the
+   * range [0,dim^rank-1], return which set of indices it would
+   * correspond to.
+   */
+  static
+  TableIndices<rank_> unrolled_to_component_indices(const unsigned int i);
+
+
 
   /**
    * Reset all values to zero.
@@ -379,7 +420,33 @@ Tensor<rank_,dim,Number>::operator[] (const unsigned int i) const
   return subtensor[i];
 }
 
+template <int rank_, int dim, typename Number>
+inline
+Number
+Tensor<rank_,dim,Number>::operator[] (const TableIndices<rank_> &indices) const
+{
+  const unsigned int inner_ind = indices[0];
+  Assert (inner_ind<dim, ExcIndexRange(inner_ind, 0, dim));
 
+  TableIndices<rank_-1> indices1;
+  for (unsigned int i = 0; i < rank_-1; i++)
+    indices1[i] = indices[i+1];
+  return (subtensor[inner_ind])[indices1];
+}
+
+template <int rank_, int dim, typename Number>
+inline
+Number &
+Tensor<rank_,dim,Number>::operator[] (const TableIndices<rank_> &indices)
+{
+  const unsigned int inner_ind = indices[0];
+  Assert (inner_ind<dim, ExcIndexRange(inner_ind, 0, dim));
+
+  TableIndices<rank_-1> indices1;
+  for (unsigned int i = 0; i < rank_-1; i++)
+    indices1[i] = indices[i+1];
+  return (subtensor[inner_ind])[indices1];
+}
 
 template <int rank_, int dim, typename Number>
 inline
@@ -574,6 +641,41 @@ Tensor<rank_, dim, Number>::unroll_recursion (Vector<Number2> &result,
     }
 }
 
+template <int rank_, int dim, typename Number>
+inline
+unsigned int
+Tensor<rank_, dim, Number>::component_to_unrolled_index(const TableIndices<rank_> &indices)
+{
+  TableIndices<rank_-1> indices1;
+  for (unsigned int i = 0; i < rank_-1; i++)
+    indices1[i] = indices[i];
+
+  Assert (indices[rank_-1] < dim,
+          ExcIndexRange (indices[rank_-1], 0, dim));
+  return ( Tensor<rank_-1,dim,Number>::component_to_unrolled_index(indices1) * dim + indices[rank_-1]);
+}
+
+template <int rank_, int dim, typename Number>
+inline
+TableIndices<rank_>
+Tensor<rank_, dim, Number>::unrolled_to_component_indices(const unsigned int i)
+{
+  Assert (i < n_independent_components,
+          ExcIndexRange (i, 0, n_independent_components));
+
+  TableIndices<rank_>   indices;
+
+  unsigned int remainder = i;
+  for (int r=rank_-1; r>=0; --r)
+    {
+      indices[r] = (remainder % dim);
+      remainder /= dim;
+    }
+  Assert (remainder == 0, ExcInternalError());
+
+  return indices;
+}
+
 
 
 template <int rank_, int dim, typename Number>
index 6574ddc6f2fc0a932b7b04e5abe408b047ac657b..94c8e1b3e990af3df0ea4c11230fedef7a7de1e6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tensor_base_h
 #define __deal2__tensor_base_h
 
@@ -21,6 +26,7 @@
 
 #include <deal.II/base/config.h>
 #include <deal.II/base/exceptions.h>
+#include <deal.II/base/table_indices.h>
 #include <vector>
 
 #include <cmath>
@@ -348,6 +354,13 @@ public:
    */
   static const unsigned int rank      = 1;
 
+  /**
+   * Number of independent components of a
+   * tensor of rank 1.
+   */
+  static const unsigned int
+  n_independent_components = dim;
+
   /**
    * Type of stored objects. This
    * is a Number for a rank 1 tensor.
@@ -427,6 +440,16 @@ public:
    */
   Number &operator [] (const unsigned int index);
 
+  /**
+   * Read access using TableIndices <tt>indices</tt>
+   */
+  Number operator [](const TableIndices<1> &indices) const;
+
+  /**
+   * Read and write access using TableIndices <tt>indices</tt>
+   */
+  Number &operator [](const TableIndices<1> &indices);
+
   /**
    * Assignment operator.
    */
@@ -568,6 +591,31 @@ public:
   template <typename Number2>
   void unroll (Vector<Number2> &result) const;
 
+  /**
+   * Returns an unrolled index in
+   * the range [0,dim-1] for the element of the tensor indexed by
+   * the argument to the function.
+   *
+   * Given that this is a rank-1 object, the returned value
+   * is simply the value of the only index stored by the argument.
+   */
+  static
+  unsigned int
+  component_to_unrolled_index(const TableIndices<1> &indices);
+
+  /**
+   * Opposite of  component_to_unrolled_index: For an index in the
+   * range [0,dim-1], return which set of indices it would
+   * correspond to.
+   *
+   * Given that this is a rank-1 object, the returned set of indices
+   * consists of only a single element with value equal to the argument
+   * to this function.
+   */
+  static
+  TableIndices<1> unrolled_to_component_indices(const unsigned int i);
+
+
   /**
    * Determine an estimate for
    * the memory consumption (in
@@ -949,6 +997,22 @@ Number &Tensor<1,dim,Number>::operator [] (const unsigned int index)
   return values[index];
 }
 
+template <int dim, typename Number>
+inline
+Number Tensor<1,dim,Number>::operator [] (const TableIndices<1> &indices) const
+{
+  Assert (indices[0]<dim, ExcIndexRange (indices[0], 0, dim));
+  return values[indices[0]];
+}
+
+template <int dim, typename Number>
+inline
+Number &Tensor<1,dim,Number>::operator [] (const TableIndices<1> &indices)
+{
+  Assert (indices[0]<dim, ExcIndexRange (indices[0], 0, dim));
+  return values[indices[0]];
+}
+
 
 
 template <>
@@ -1187,6 +1251,23 @@ Tensor<1,dim,Number>::unroll_recursion (Vector<Number2> &result,
 }
 
 
+template <int dim, typename Number>
+inline
+unsigned int
+Tensor<1, dim, Number>::component_to_unrolled_index (const TableIndices<1> &indices)
+{
+  return indices[0];
+}
+
+template <int dim, typename Number>
+inline
+TableIndices<1>
+Tensor<1, dim, Number>::unrolled_to_component_indices (const unsigned int i)
+{
+  return TableIndices<1>(i);
+}
+
+
 
 template <int dim, typename Number>
 inline
index b8a7bd791074dd7311361bf05c307731c92e207c..aab8d601134a82fbad72b7990244417144085095 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tensor_function_h
 #define __deal2__tensor_function_h
 
@@ -57,62 +62,47 @@ class TensorFunction : public FunctionTime,
 {
 public:
   /**
-   * Define typedefs for the return
-   * types of the <tt>value</tt>
-   * functions.
+   * Define typedefs for the return types of the <tt>value</tt> functions.
    */
   typedef Tensor<rank,dim> value_type;
 
   typedef Tensor<rank+1,dim> gradient_type;
 
   /**
-   * Constructor. May take an
-   * initial value for the time
-   * variable, which defaults to
-   * zero.
+   * Constructor. May take an initial value for the time variable, which
+   * defaults to zero.
    */
   TensorFunction (const double initial_time = 0.0);
 
   /**
-   * Virtual destructor; absolutely
-   * necessary in this case, as
-   * classes are usually not used
-   * by their true type, but rather
-   * through pointers to this base
-   * class.
+   * Virtual destructor; absolutely necessary in this case, as classes are
+   * usually not used by their true type, but rather through pointers to
+   * this base class.
    */
   virtual ~TensorFunction ();
 
   /**
-   * Return the value of the function
-   * at the given point.
+   * Return the value of the function at the given point.
    */
   virtual value_type value (const Point<dim> &p) const;
 
   /**
-   * Set <tt>values</tt> to the point
-   * values of the function at the
-   * <tt>points</tt>.  It is assumed
-   * that <tt>values</tt> already has
-   * the right size, i.e.  the same
-   * size as the <tt>points</tt> array.
+   * Set <tt>values</tt> to the point values of the function at the
+   * <tt>points</tt>.  It is assumed that <tt>values</tt> already has the
+   * right size, i.e.  the same size as the <tt>points</tt> array.
    */
   virtual void value_list (const std::vector<Point<dim> > &points,
                            std::vector<value_type> &values) const;
 
   /**
-   * Return the gradient of the
-   * function at the given point.
+   * Return the gradient of the function at the given point.
    */
   virtual gradient_type gradient (const Point<dim> &p) const;
 
   /**
-   * Set <tt>gradients</tt> to the
-   * gradients of the function at
-   * the <tt>points</tt>.  It is assumed
-   * that <tt>values</tt> already has
-   * the right size, i.e.  the same
-   * size as the <tt>points</tt> array.
+   * Set <tt>gradients</tt> to the gradients of the function at the
+   * <tt>points</tt>.  It is assumed that <tt>values</tt> already has the
+   * right size, i.e.  the same size as the <tt>points</tt> array.
    */
   virtual void gradient_list (const std::vector<Point<dim> >   &points,
                               std::vector<gradient_type> &gradients) const;
@@ -131,6 +121,68 @@ public:
 
 };
 
+
+
+/*
+ * Provide a tensor valued function which always returns a constant tensor
+ * value. Obviously, all derivates of this function are zero.
+ *
+ * @ingroup functions
+ * @author Matthias Maier, 2013
+ */
+template <int rank, int dim>
+class ConstantTensorFunction : public TensorFunction<rank, dim>
+{
+public:
+  /**
+   * Constructor; takes the constant tensor value as an argument.
+   * The reference value is copied internally.
+   *
+   * An initial value for the time variable may be specified, otherwise it
+   * defaults to zero.
+   */
+  ConstantTensorFunction (const dealii::Tensor<rank, dim> &value,
+                          const double initial_time = 0.0);
+
+  virtual ~ConstantTensorFunction ();
+
+  virtual typename dealii::TensorFunction<rank, dim>::value_type value (const Point<dim> &p) const;
+
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<typename dealii::TensorFunction<rank, dim>::value_type> &values) const;
+
+  virtual typename dealii::TensorFunction<rank, dim>::gradient_type gradient (const Point<dim> &p) const;
+
+  virtual void gradient_list (const std::vector<Point<dim> > &points,
+                              std::vector<typename dealii::TensorFunction<rank, dim>::gradient_type> &gradients) const;
+
+private:
+  const dealii::Tensor<rank, dim> _value;
+};
+
+
+
+/*
+ * Provide a tensor valued function which always returns zero.
+ * Obviously, all derivates of this function are zero.
+ *
+ * @ingroup functions
+ * @author Matthias Maier, 2013
+ */
+template <int rank, int dim>
+class ZeroTensorFunction : public ConstantTensorFunction<rank, dim>
+{
+public:
+  /**
+   * Constructor.
+   *
+   * An initial value for the time variable may be specified, otherwise it
+   * defaults to zero.
+   */
+  ZeroTensorFunction (const double initial_time = 0.0);
+};
+
+
 DEAL_II_NAMESPACE_CLOSE
 
 #endif
index 3babe00729798499379f0fec3c2713edfbf9dbb0..8f74b0aa685c17d41dc7ec092d15aec281f7a268 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tensor_product_polynomials_h
 #define __deal2__tensor_product_polynomials_h
 
index 82fa269e5fd2914fc9a9efb970bab5da93dce1a7..83c92be80f8df452d1c6c2a41ae8aca7a8972792 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id: tensor_product_polynomials.h 27628 2012-11-20 22:49:26Z heister $
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012, 2013 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tensor_product_polynomials_const_h
 #define __deal2__tensor_product_polynomials_const_h
 
index a97219c44d189b10c530d205e637fe180d4c604b..dccaa2f61fc7f72c6dca4ace185b87408c464eef 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__thread_local_storage_h
 #define __deal2__thread_local_storage_h
 
@@ -29,7 +34,6 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace Threads
 {
-  template <typename T>
   /**
    * @brief A class that provides a separate storage location on each thread that accesses the object.
    *
@@ -60,7 +64,8 @@ namespace Threads
    * provides a reference to a unique object when accessed from different threads.
    * Objects of type T are created lazily, i.e. they are only created whenever a
    * thread actually calls get().
-   **/
+   */
+  template <typename T>
   class ThreadLocalStorage
   {
   public:
index 316ba303b32a9893951a6a6527e4bb235e6bc2ec..f7b97ebdf167155db817346773080bda3cf52b31 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__thread_management_h
 #define __deal2__thread_management_h
 
@@ -2712,7 +2717,7 @@ namespace Threads
   inline
   internal::fun_encapsulator<RT,
            std_cxx1x::tuple<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6>,6>
-  spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6) const) DEAL_II_DEPRECATED;
+           spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6) const) DEAL_II_DEPRECATED;
 
 
   template <typename RT, typename C,
@@ -2745,13 +2750,13 @@ namespace Threads
   inline
   internal::fun_encapsulator<RT,std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6, Arg7>,7>
-  spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7)) DEAL_II_DEPRECATED;
+           spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7)) DEAL_II_DEPRECATED;
 
 
   template <typename RT,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7>
   inline
   internal::fun_encapsulator<RT,std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6, Arg7>,7>
@@ -2776,13 +2781,13 @@ namespace Threads
   inline
   internal::fun_encapsulator<RT,std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6, Arg7>,7>
-  spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7)) DEAL_II_DEPRECATED;
+           spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7)) DEAL_II_DEPRECATED;
 
 
   template <typename RT, typename C,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7>
   inline
   internal::fun_encapsulator<RT,std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6, Arg7>,7>
@@ -2808,13 +2813,13 @@ namespace Threads
   internal::fun_encapsulator<RT,
            std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6, Arg7>,7>
-  spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7) const) DEAL_II_DEPRECATED;
+           spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7) const) DEAL_II_DEPRECATED;
 
 
   template <typename RT, typename C,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7>
   inline
   internal::fun_encapsulator<RT,
            std_cxx1x::tuple<Arg1, Arg2, Arg3,
@@ -2849,9 +2854,9 @@ namespace Threads
 
 
   template <typename RT,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7, typename Arg8>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7, typename Arg8>
   inline
   internal::fun_encapsulator<RT,std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6,
@@ -2884,9 +2889,9 @@ namespace Threads
 
 
   template <typename RT, typename C,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7, typename Arg8>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7, typename Arg8>
   inline
   internal::fun_encapsulator<RT,std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6,
@@ -2920,9 +2925,9 @@ namespace Threads
 
 
   template <typename RT, typename C,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7, typename Arg8>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7, typename Arg8>
   inline
   internal::fun_encapsulator<RT,
            std_cxx1x::tuple<Arg1, Arg2, Arg3,
@@ -2959,9 +2964,9 @@ namespace Threads
 
 
   template <typename RT,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7, typename Arg8, typename Arg9>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7, typename Arg8, typename Arg9>
   inline
   internal::fun_encapsulator<RT,std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6,
@@ -2994,9 +2999,9 @@ namespace Threads
 
 
   template <typename RT, typename C,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7, typename Arg8, typename Arg9>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7, typename Arg8, typename Arg9>
   inline
   internal::fun_encapsulator<RT,std_cxx1x::tuple<Arg1, Arg2, Arg3,
            Arg4, Arg5, Arg6,
@@ -3030,9 +3035,9 @@ namespace Threads
 
 
   template <typename RT, typename C,
-  typename Arg1, typename Arg2, typename Arg3,
-  typename Arg4, typename Arg5, typename Arg6,
-  typename Arg7, typename Arg8, typename Arg9>
+           typename Arg1, typename Arg2, typename Arg3,
+           typename Arg4, typename Arg5, typename Arg6,
+           typename Arg7, typename Arg8, typename Arg9>
   inline
   internal::fun_encapsulator<RT,
            std_cxx1x::tuple<Arg1, Arg2, Arg3,
@@ -4059,7 +4064,18 @@ namespace Threads
         // call the function object
         // and put the return value
         // into the proper place
-        call (task_descriptor.function, task_descriptor.ret_val);
+        try
+          {
+            call (task_descriptor.function, task_descriptor.ret_val);
+          }
+        catch (const std::exception &exc)
+          {
+            internal::handle_std_exception (exc);
+          }
+        catch (...)
+          {
+            internal::handle_unknown_exception ();
+          }
         return 0;
       }
 
@@ -4234,7 +4250,7 @@ namespace Threads
       // the TBB book on pages
       // 230/231 ("Start a large task
       // in parallel with the main
-      // program)
+      // program")
       task = new (tbb::task::allocate_root()) tbb::empty_task;
       task->set_ref_count (2);
 
@@ -4349,6 +4365,7 @@ namespace Threads
       {
         call (function, ret_val);
       }
+
       /**
        * Wait for the task to
        * return. Since we are in
index bb031c3ce52a27a64b6e83d8d35d4a1da1dfbebf..961ed9456eef9ef32a13a7204936800d098d59a9 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__timer_h
 #define __deal2__timer_h
 
@@ -348,7 +353,7 @@ public:
     /**
      * Reference to the TimerOutput object
      */
-    dealii::TimerOutput & timer;
+    dealii::TimerOutput &timer;
     /**
      * Do we still need to exit the section we are in?
      */
@@ -622,8 +627,8 @@ TimerOutput::exit_section (const std::string &section_name)
 
 inline
 TimerOutput::Scope::Scope(dealii::TimerOutput &timer_, const std::string &section_name)
-:
-timer(timer_), in(true)
+  :
+  timer(timer_), in(true)
 {
   timer.enter_section(section_name);
 }
index ec54568f5e4f2bbd9fc7ad4558008d4fd32248df..0da2ba52e6f21631bfe88cedde4eb8a69b2a85a1 100644 (file)
@@ -1,20 +1,25 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2012, 2013 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__types_h
 #define __deal2__types_h
 
 
 #include <deal.II/base/config.h>
-
+#include <cstddef>
 DEAL_II_NAMESPACE_OPEN
 
 /**
@@ -52,14 +57,55 @@ namespace types
    */
   const unsigned int artificial_subdomain_id DEAL_II_DEPRECATED = static_cast<subdomain_id>(-2);
 
+#ifdef DEAL_II_USE_LARGE_INDEX_TYPE
+  /**
+   * The type used for global indices of
+   * degrees of freedom. While in sequential
+   * computations the 4 billion indices of
+   * 32-bit unsigned integers is plenty,
+   * parallel computations using the
+   * parallel::distributed::Triangulation
+   * class can overflow this number and we
+   * need a bigger index space.
+   *
+   * The data type always indicates an
+   * unsigned integer type.
+   */
+  // TODO: we should check that unsigned long long int
+  // has the same size as uint64_t
+  typedef unsigned long long int global_dof_index;
+
   /**
-   * The type used to denote global dof
-   * indices.
+   * An identifier that denotes the MPI type
+   * associated with types::global_dof_index.
+   */
+#  define DEAL_II_DOF_INDEX_MPI_TYPE MPI_UNSIGNED_LONG_LONG
+#else
+  /**
+   * The type used for global indices of
+   * degrees of freedom. While in sequential
+   * computations the 4 billion indices of
+   * 32-bit unsigned integers is plenty,
+   * parallel computations using the
+   * parallel::distributed::Triangulation
+   * class can overflow this number and we
+   * need a bigger index space.
+   *
+   * The data type always indicates an
+   * unsigned integer type.
    */
   typedef unsigned int global_dof_index;
 
   /**
-  *  @deprecated Use numbers::invalid_dof_index
+   * An identifier that denotes the MPI type
+   * associated with types::global_dof_index.
+   */
+#  define DEAL_II_DOF_INDEX_MPI_TYPE MPI_UNSIGNED
+#endif
+
+
+  /**
+   *  @deprecated Use numbers::invalid_dof_index
    */
   const global_dof_index invalid_dof_index DEAL_II_DEPRECATED = static_cast<global_dof_index>(-1);
 
@@ -111,6 +157,25 @@ namespace types
 
 }
 
+namespace TrilinosWrappers
+{
+  namespace types
+  {
+#ifdef DEAL_II_USE_LARGE_INDEX_TYPE
+    /**
+     * Declare type of integer used in the Epetra package of Trilinos.
+     */
+    typedef long long int_type;
+#else
+    /**
+     * Declare type of integer used in the Epetra package of Trilinos.
+     */
+    typedef int int_type;
+#endif
+  }
+}
+
+
 // this part of the namespace numbers got moved to the bottom types.h file,
 // because otherwise we get a circular inclusion of config.h, types.h, and
 // numbers.h
@@ -135,9 +200,29 @@ namespace numbers
   invalid_unsigned_int = static_cast<unsigned int> (-1);
 
   /**
-                           * An invalid value for indices of degrees
-                           * of freedom.
-                           */
+   * Representation of the
+   * largest number that
+   * can be put into a
+   * size_type. This value
+   * is used throughout
+   * the library as a
+   * marker for an
+   * invalid size_type
+   * value, such as
+   * an invalid array
+   * index, an invalid
+   * array size, and the
+   * like. Invalid_size_type
+   * is equivalent to
+   * invalid_dof_index.
+   */
+  const types::global_dof_index
+  invalid_size_type = static_cast<types::global_dof_index> (-1);
+
+  /**
+   * An invalid value for indices of degrees
+   * of freedom.
+   */
   const types::global_dof_index invalid_dof_index = static_cast<types::global_dof_index>(-1);
 
   /**
@@ -226,7 +311,6 @@ namespace numbers
    * more information.
    */
   const types::subdomain_id artificial_subdomain_id = static_cast<types::subdomain_id>(-2);
-
 }
 
 
index a7a3591becff7884d36aa1094e7a1808a13ec554..df17f8f976dfae82f123ee7b1495c1cc501d74b5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__utilities_h
 #define __deal2__utilities_h
 
@@ -324,6 +329,27 @@ namespace Utilities
   std::vector<unsigned int>
   invert_permutation (const std::vector<unsigned int> &permutation);
 
+  /**
+   * Given a permutation vector (i.e. a
+   * vector $p_0\ldots p_{N-1}$ where each
+   * $p_i\in [0,N)$ and $p_i\neq p_j$ for
+   * $i\neq j$), produce the reverse
+   * permutation $q_i=N-1-p_i$.
+   */
+  std::vector<unsigned long long int>
+  reverse_permutation (const std::vector<unsigned long long int> &permutation);
+
+  /**
+   * Given a permutation vector (i.e. a
+   * vector $p_0\ldots p_{N-1}$ where each
+   * $p_i\in [0,N)$ and $p_i\neq p_j$ for
+   * $i\neq j$), produce the inverse
+   * permutation $q_0\ldots q_{N-1}$ so that
+   * $q_{p_i}=p_{q_i}=i$.
+   */
+  std::vector<unsigned long long int>
+  invert_permutation (const std::vector<unsigned long long int> &permutation);
+
   /**
    * A namespace for utility functions that
    * probe system properties.
@@ -666,6 +692,7 @@ namespace Utilities
 
 #endif
 
+
 }
 
 
@@ -725,7 +752,7 @@ namespace Utilities
     Assert (last - first >= 0,
             ExcMessage ("The given iterators do not satisfy the proper ordering."));
 
-    unsigned int len = last-first;
+    unsigned int len = static_cast<unsigned int>(last-first);
 
     if (len==0)
       return first;
index af436af31a0f7051f29c06dd7db54a58f2a2d38f..25d802aef7281b7c1b181d1a5f8328997711ccd4 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__vector_slice_h
 #define __deal2__vector_slice_h
 
index c01ad12dbaca39143851d391518e6c3f3280332c..f2c560f36c502895792e1d4f1cb744bc4063c412 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__vectorization_h
 #define __deal2__vectorization_h
index b44ed33f2cfbd7b3c8b9337219dff882d829d154..d4c9f9f619ba5972b219eb9cf1dc1048f9692962 100644 (file)
@@ -1,23 +1,30 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__work_stream_h
 #define __deal2__work_stream_h
 
 
 #include <deal.II/base/config.h>
 #include <deal.II/base/multithread_info.h>
+#include <deal.II/base/thread_management.h>
 #include <deal.II/base/template_constraints.h>
 #include <deal.II/base/std_cxx1x/function.h>
 #include <deal.II/base/std_cxx1x/bind.h>
+#include <deal.II/base/thread_local_storage.h>
 
 #ifdef DEAL_II_WITH_THREADS
 #  include <deal.II/base/thread_management.h>
@@ -26,6 +33,7 @@
 
 #include <vector>
 #include <utility>
+#include <memory>
 
 
 DEAL_II_NAMESPACE_OPEN
@@ -49,7 +57,7 @@ DEAL_II_NAMESPACE_OPEN
  * shared memory. However, some other part of this work may need to be
  * synchronised and be done in order. In the example of assembling a matrix,
  * the computation of local contributions can be done entirely in parallel,
- * but copying the the local contributions into the global matrix requires
+ * but copying the local contributions into the global matrix requires
  * some care: First, several threads can't write at the same time, but need to
  * synchronise writing using a mutex; secondly, we want the order in which
  * local contributions are added to the global matrix to be always the same
@@ -127,9 +135,14 @@ namespace WorkStream
 
 #ifdef DEAL_II_WITH_THREADS
 
-
   namespace internal
   {
+
+//TODO: The following classes all use std_cxx1x::shared_ptr, but the
+//  correct pointer class would actually be std::unique_ptr. make this
+//  replacement whenever we have a class that provides these semantics
+//  and that is available also as a fall-back whenever via boost or similar
+
     /**
      * A class that creates a sequence of
      * items from a range of iterators.
@@ -142,23 +155,117 @@ namespace WorkStream
     public:
       /**
        * A data type that we use to identify
-       * items to be worked on.
-       *
-       * The first element indicates an array
-       * of iterators to work on; the second
-       * the scratch space; the third an
-       * array of copy data spaces; and the
-       * last the number of elements to work
-       * on. This last argument is an integer
-       * between one and chunk_size. The
-       * arrays have a length of chunk_size.
+       * items to be worked on. This is the structure
+       * that is passed around between the different parts of
+       * the WorkStream implementation to identify what needs
+       * to be done by the various stages of the pipeline.
        */
-      typedef
-      std_cxx1x::tuple<std::vector<Iterator>,
-                ScratchData *,
-                std::vector<CopyData>,
-                unsigned int>
-                ItemType;
+      struct ItemType
+      {
+        /**
+         * A structure that contains a pointer to a scratch data object along
+         * with a flag that indicates whether this object is currently in use.
+         */
+        struct ScratchDataObject
+        {
+          std_cxx1x::shared_ptr<ScratchData> scratch_data;
+          bool                               currently_in_use;
+
+          /**
+           * Default constructor.
+           */
+          ScratchDataObject ()
+            :
+            currently_in_use (false)
+          {}
+
+          ScratchDataObject (ScratchData *p,
+                             const bool in_use)
+            :
+            scratch_data (p),
+            currently_in_use (in_use)
+          {}
+        };
+
+
+        /**
+         * Typedef to a list of scratch data objects. The rationale for this
+         * list is provided in the variables that use these lists.
+         */
+        typedef std::list<ScratchDataObject> ScratchDataList;
+
+        /**
+         * A list of iterators that need to be worked on. Only the first
+         * n_items are relevant.
+         */
+        std::vector<Iterator> work_items;
+
+        /**
+         * The CopyData objects that the Worker part of the pipeline
+         * fills for each work item. Again, only the first n_items
+         * elements are what we care about.
+         */
+        std::vector<CopyData> copy_datas;
+
+        /**
+         * Number of items identified by the work_items array that the
+         * Worker and Copier pipeline stage need to work on. The maximum
+         * value of this variable will be chunk_size.
+         */
+        unsigned int          n_items;
+
+        /**
+         * Pointer to a thread local variable identifying the scratch data objects
+         * this thread will use. The initial implementation of this
+         * class using thread local variables provided only a single
+         * scratch object per thread. This doesn't work, because
+         * the worker functions may start tasks itself and then call
+         * Threads::TaskGroup::join_all() or a similar function, which the
+         * TBB scheduler may use to run something else on the current
+         * thread -- for example another instance of the worker function.
+         * Consequently, there would be two instances of the worker
+         * function that use the same scratch object if we only
+         * provided a single scratch object per thread. The solution is
+         * to provide a list of scratch objects for each thread, together
+         * with a flag indicating whether this scratch object is currently
+         * used. If a thread needs a scratch object, it walks this list
+         * until it finds an unused object, or, if there is none, creates one
+         * itself. Note that we need not use synchronization primitives
+         * for this process since the lists are thread-local and
+         * we are guaranteed that only a single thread accesses them as long
+         * as we have no yield point in between the accesses to the list.
+         *
+         * The pointers to scratch objects stored in each of these lists must
+         * be so that they are deleted on all threads when the thread
+         * local object is destroyed. This is achieved by using shared_ptr.
+         *
+         * Note that when a worker needs to create a scratch object, it allocates
+         * it using sample_scratch_data to copy from. This has
+         * the advantage of a first-touch initialization, i.e., the
+         * memory for the scratch data object is allocated and initialized
+         * by the same thread that will later use it.
+         */
+        Threads::ThreadLocalStorage<ScratchDataList> *scratch_data;
+
+        /**
+         * Pointer to a sample scratch data object, to be used to initialize
+         * the scratch data objects created for each individual thread.
+         */
+        const ScratchData *sample_scratch_data;
+
+
+        /**
+         * Default constructor.
+         * Initialize everything that doesn't
+         * have a default constructor itself.
+         */
+        ItemType ()
+          :
+          n_items (0),
+          scratch_data (0),
+          sample_scratch_data (0)
+        {}
+      };
 
 
       /**
@@ -179,32 +286,23 @@ namespace WorkStream
         tbb::filter (/*is_serial=*/true),
         remaining_iterator_range (begin, end),
         ring_buffer (buffer_size),
+        sample_scratch_data (sample_scratch_data),
         n_emitted_items (0),
         chunk_size (chunk_size)
       {
-        // initialize copies of
-        // additional_data. since
-        // this is frequently
-        // expensive (creating
-        // FEValues objects etc) do
-        // that in parallel
-        Threads::TaskGroup<> tasks;
-        for (unsigned int i=0; i<ring_buffer.size(); ++i)
-          tasks += Threads::new_task (&IteratorRangeToItemStream::init_buffer_elements,
-                                      *this,
-                                      i,
-                                      std_cxx1x::cref(sample_scratch_data),
-                                      std_cxx1x::cref(sample_copy_data));
-        tasks.join_all ();
-      }
-
-      /**
-       * Destructor.
-       */
-      ~IteratorRangeToItemStream ()
-      {
-        for (unsigned int i=0; i<ring_buffer.size(); ++i)
-          delete std_cxx1x::get<1>(ring_buffer[i]);
+       // initialize the elements of the ring buffer
+        for (unsigned int element=0; element<ring_buffer.size(); ++element)
+         {
+           Assert (ring_buffer[element].n_items == 0,
+                   ExcInternalError());
+
+           ring_buffer[element].work_items.resize (chunk_size,
+                                                   remaining_iterator_range.second);
+           ring_buffer[element].scratch_data = &thread_local_scratch;
+           ring_buffer[element].sample_scratch_data = &sample_scratch_data;
+           ring_buffer[element].copy_datas.resize (chunk_size,
+                                                   sample_copy_data);
+         }
       }
 
       /**
@@ -221,20 +319,20 @@ namespace WorkStream
         // initialize the next item. it may
         // consist of at most chunk_size
         // elements
-        std_cxx1x::get<3>(*current_item) = 0;
+        current_item->n_items = 0;
         while ((remaining_iterator_range.first !=
                 remaining_iterator_range.second)
                &&
-               (std_cxx1x::get<3>(*current_item) < chunk_size))
+               (current_item->n_items < chunk_size))
           {
-            std_cxx1x::get<0>(*current_item)[std_cxx1x::get<3>(*current_item)]
+            current_item->work_items[current_item->n_items]
               = remaining_iterator_range.first;
 
             ++remaining_iterator_range.first;
-            ++std_cxx1x::get<3>(*current_item);
+            ++current_item->n_items;
           }
 
-        if (std_cxx1x::get<3>(*current_item) == 0)
+        if (current_item->n_items == 0)
           // there were no items
           // left. terminate the pipeline
           return 0;
@@ -258,12 +356,52 @@ namespace WorkStream
        */
       std::vector<ItemType>        ring_buffer;
 
+      /**
+       * Pointer to a thread local variable identifying the scratch data objects
+       * this thread will use. The initial implementation of this
+       * class using thread local variables provided only a single
+       * scratch object per thread. This doesn't work, because
+       * the worker functions may start tasks itself and then call
+       * Threads::TaskGroup::join_all() or a similar function, which the
+       * TBB scheduler may use to run something else on the current
+       * thread -- for example another instance of the worker function.
+       * Consequently, there would be two instances of the worker
+       * function that use the same scratch object if we only
+       * provided a single scratch object per thread. The solution is
+       * to provide a list of scratch objects for each thread, together
+       * with a flag indicating whether this scratch object is currently
+       * used. If a thread needs a scratch object, it walks this list
+       * until it finds an unused object, or, if there is none, creates one
+       * itself. Note that we need not use synchronization primitives
+       * for this process since the lists are thread-local and
+       * we are guaranteed that only a single thread accesses them as long
+       * as we have no yield point in between the accesses to the list.
+       *
+       * The pointers to scratch objects stored in each of these lists must
+       * be so that they are deleted on all threads when the thread
+       * local object is destroyed. This is achieved by using shared_ptr.
+       *
+       * Note that when a worker needs to create a scratch object, it allocates
+       * it using sample_scratch_data to copy from. This has
+       * the advantage of a first-touch initialization, i.e., the
+       * memory for the scratch data object is allocated and initialized
+       * by the same thread that will later use it.
+       */
+      Threads::ThreadLocalStorage<typename ItemType::ScratchDataList> thread_local_scratch;
+
+      /**
+       * A reference to a sample scratch data that will be used to
+       * initialize the thread-local pointers to a scratch data object
+       * each of the worker tasks uses.
+       */
+      const ScratchData &sample_scratch_data;
+
       /**
        * Counter for the number of emitted
        * items. Each item may consist of up
        * to chunk_size iterator elements.
        */
-      unsigned int                 n_emitted_items;
+      unsigned int       n_emitted_items;
 
       /**
        * Number of elements of the
@@ -285,17 +423,18 @@ namespace WorkStream
        * the ring buffer.
        */
       void init_buffer_elements (const unsigned int element,
-                                 const ScratchData &sample_scratch_data,
                                  const CopyData    &sample_copy_data)
       {
-        Assert (std_cxx1x::get<1>(ring_buffer[element]) == 0,
+        Assert (ring_buffer[element].n_items == 0,
                 ExcInternalError());
 
-        std_cxx1x::get<0>(ring_buffer[element])
+        ring_buffer[element].work_items
         .resize (chunk_size, remaining_iterator_range.second);
-        std_cxx1x::get<1>(ring_buffer[element])
-          = new ScratchData(sample_scratch_data);
-        std_cxx1x::get<2>(ring_buffer[element])
+        ring_buffer[element].scratch_data
+          = &thread_local_scratch;
+        ring_buffer[element].sample_scratch_data
+          = &sample_scratch_data;
+        ring_buffer[element].copy_datas
         .resize (chunk_size, sample_copy_data);
       }
     };
@@ -344,13 +483,85 @@ namespace WorkStream
 
         ItemType *current_item = static_cast<ItemType *> (item);
 
-        // then call the worker function on
-        // each element of the chunk we
-        // were given
-        for (unsigned int i=0; i<std_cxx1x::get<3>(*current_item); ++i)
-          worker (std_cxx1x::get<0>(*current_item)[i],
-                  *std_cxx1x::get<1>(*current_item),
-                  std_cxx1x::get<2>(*current_item)[i]);
+        // we need to find an unused scratch data object in the list that
+        // corresponds to the current thread and then mark it as used. if
+        // we can't find one, create one
+        //
+        // as discussed in the discussion of the documentation of the
+        // IteratorRangeToItemStream::scratch_data variable, there is no
+        // need to synchronize access to this variable using a mutex
+        // as long as we have no yield-point in between. this means that
+        // we can't take an iterator into the list now and expect it to
+        // still be valid after calling the worker, but we at least do
+        // not have to lock the following section
+        ScratchData *scratch_data = 0;
+        {
+          typename ItemType::ScratchDataList &
+          scratch_data_list = current_item->scratch_data->get();
+
+          // see if there is an unused object. if so, grab it and mark
+          // it as used
+          for (typename ItemType::ScratchDataList::iterator
+               p = scratch_data_list.begin();
+               p != scratch_data_list.end(); ++p)
+            if (p->currently_in_use == false)
+              {
+                scratch_data = p->scratch_data.get();
+                p->currently_in_use = true;
+                break;
+              }
+
+          // if no object was found, create one and mark it as used
+          if (scratch_data == 0)
+            {
+              scratch_data = new ScratchData(*current_item->sample_scratch_data);
+
+              typename ItemType::ScratchDataList::value_type
+              new_scratch_object (scratch_data, true);
+              scratch_data_list.push_back (new_scratch_object);
+            }
+        }
+
+        // then call the worker function on each element of the chunk we were
+        // given. since these worker functions are called on separate threads,
+        // nothing good can happen if they throw an exception and we are best
+        // off catching it and showing an error message
+        for (unsigned int i=0; i<current_item->n_items; ++i)
+          {
+            try
+              {
+                worker (current_item->work_items[i],
+                        *scratch_data,
+                        current_item->copy_datas[i]);
+              }
+            catch (const std::exception &exc)
+              {
+                Threads::internal::handle_std_exception (exc);
+              }
+            catch (...)
+              {
+                Threads::internal::handle_unknown_exception ();
+              }
+          }
+
+        // finally mark the scratch object as unused again. as above, there
+        // is no need to lock anything here since the object we work on
+        // is thread-local
+        {
+          typename ItemType::ScratchDataList &
+          scratch_data_list = current_item->scratch_data->get();
+
+          for (typename ItemType::ScratchDataList::iterator p =
+                 scratch_data_list.begin(); p != scratch_data_list.end();
+               ++p)
+            if (p->scratch_data.get() == scratch_data)
+              {
+                Assert(p->currently_in_use == true, ExcInternalError());
+                p->currently_in_use = false;
+              }
+        }
+
+
 
         // then return the original pointer
         // to the now modified object
@@ -415,9 +626,25 @@ namespace WorkStream
 
         ItemType *current_item = static_cast<ItemType *> (item);
 
-        // initiate copying data
-        for (unsigned int i=0; i<std_cxx1x::get<3>(*current_item); ++i)
-          copier (std_cxx1x::get<2>(*current_item)[i]);
+        // initiate copying data. for the same reasons as in the worker class
+        // above, catch exceptions rather than letting it propagate into
+        // unknown territories
+        for (unsigned int i=0; i<current_item->n_items; ++i)
+          {
+            try
+              {
+                copier (current_item->copy_datas[i]);
+              }
+            catch (const std::exception &exc)
+              {
+                Threads::internal::handle_std_exception (exc);
+              }
+            catch (...)
+              {
+                Threads::internal::handle_unknown_exception ();
+              }
+          }
+
 
         // return an invalid
         // item since we are at
index 07d6c9aa2a5e59d99412c60e678e767ba52d986c..a660fe141445f5ca107dfae273111a16cdec8664 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__distribute_grid_refinement_h
 #define __deal2__distribute_grid_refinement_h
 
index 55b0c930f7ff8f70c60f4103a2fbd09fee7681f5..8b1fa0019bd719de0f7ecaf2b8d9d665d26c9bc5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__distributed_solution_transfer_h
 #define __deal2__distributed_solution_transfer_h
 
index b50498644958e9e87639b5a9b425a256f1551dbd..d17c8c082d04f6bec0edb3634b34fcd97bf5e5f4 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__distributed_tria_h
 #define __deal2__distributed_tria_h
 
@@ -538,7 +543,7 @@ namespace parallel
        * of active cells in the
        * distributed triangulation.
        */
-      unsigned int n_global_active_cells () const;
+      types::global_dof_index n_global_active_cells () const;
 
       /**
        * Returns the global maximum level. This may be bigger than n_levels.
@@ -689,7 +694,7 @@ namespace parallel
        * in hierarchical ordering is the ith deal cell starting
        * from begin(0).
        */
-      const std::vector<unsigned int> &
+      const std::vector<types::global_dof_index> &
       get_p4est_tree_to_coarse_cell_permutation() const;
 
     private:
@@ -730,8 +735,10 @@ namespace parallel
       struct NumberCache
       {
         std::vector<unsigned int> n_locally_owned_active_cells;
-        unsigned int              n_global_active_cells;
+        types::global_dof_index   n_global_active_cells;
         unsigned int              n_global_levels;
+
+        NumberCache();
       };
 
       NumberCache number_cache;
@@ -832,8 +839,8 @@ namespace parallel
        * by p4est is located on geometrically
        * close coarse grid cells.
        */
-      std::vector<unsigned int> coarse_cell_to_p4est_tree_permutation;
-      std::vector<unsigned int> p4est_tree_to_coarse_cell_permutation;
+      std::vector<types::global_dof_index> coarse_cell_to_p4est_tree_permutation;
+      std::vector<types::global_dof_index> p4est_tree_to_coarse_cell_permutation;
 
       /**
        * Return a pointer to the p4est
@@ -929,7 +936,7 @@ namespace parallel
        * of active cells in the
        * distributed triangulation.
        */
-      unsigned int n_global_active_cells () const;
+      types::global_dof_index n_global_active_cells () const;
       virtual unsigned int n_global_levels () const;
 
       /**
@@ -963,8 +970,8 @@ namespace parallel
        * these variables at a
        * couple places anyway.
        */
-      std::vector<unsigned int> coarse_cell_to_p4est_tree_permutation;
-      std::vector<unsigned int> p4est_tree_to_coarse_cell_permutation;
+      std::vector<types::global_dof_index> coarse_cell_to_p4est_tree_permutation;
+      std::vector<types::global_dof_index> p4est_tree_to_coarse_cell_permutation;
 
       /**
        * dummy settings
@@ -975,6 +982,9 @@ namespace parallel
         mesh_reconstruction_after_repartitioning = 0x1,
         construct_multigrid_hierarchy = 0x2
       };
+
+
+//TODO: The following variable should really be private, but it is used in dof_handler_policy.cc ...
       /**
        * dummy settings object
        */
index 835d5270e5b4a5186aeace165f4582ef99b9756c..620a59d6a3c61ca50c8b4fe053ae88cc435e7358 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_info_h
 #define __deal2__block_info_h
 
@@ -158,7 +163,7 @@ public:
    * in the standard local
    * numbering of DoFAccessor.
    */
-  unsigned int renumber (const unsigned int i) const;
+  types::global_dof_index renumber (const unsigned int i) const;
 
   /**
    * The number of base elements.
@@ -226,7 +231,7 @@ private:
    * ordering. Filled by
    * initialize().
    */
-  std::vector<unsigned int> local_renumbering;
+  std::vector<types::global_dof_index> local_renumbering;
 };
 
 
@@ -259,9 +264,9 @@ BlockInfo::level (const unsigned int l) const
 
 
 inline
-unsigned int BlockInfo::renumber (const unsigned int i) const
+types::global_dof_index BlockInfo::renumber (const unsigned int i) const
 {
-  AssertIndexRange(i, local_renumbering.size());
+  AssertIndexRange(i, static_cast<unsigned int>(local_renumbering.size()));
   return local_renumbering[i];
 }
 
index fd605cb43c31012559fa00932153339ebcc440be..d91ecaab76a7099ae277b6bd0f89251bf761f8bf 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_accessor_h
 #define __deal2__dof_accessor_h
 
@@ -368,25 +373,18 @@ public:
    */
 
   /**
-   * Return the indices of the dofs of this object in the standard
-   * ordering: dofs on vertex 0, dofs on vertex 1, etc, dofs on line
-   * 0, dofs on line 1, etc, dofs on quad 0, etc.
+   * Return the <i>global</i> indices of the degrees of freedom located on
+   * this object in the standard ordering defined by the finite element (i.e.,
+   * dofs on vertex 0, dofs on vertex 1, etc, dofs on line 0, dofs on line 1,
+   * etc, dofs on quad 0, etc.) This function is only available on
+   * <i>active</i> objects (see @ref GlossActive "this glossary entry").
+   *
+   * The cells needs to be an active cell (and not artificial in a
+   * parallel distributed computation).
    *
    * The vector has to have the right size before being passed to this
    * function.
    *
-   * @note The behavior descibed below for non-active cells will
-   * be removed in a future release. It is not very intuitive and its
-   * use is limited to FE_Q elements of degree 1.
-   *
-   * This function is most often used on active objects (edges, faces,
-   * cells). It can be used on non-active objects as well
-   * (i.e. objects that have children), but only if the finite element
-   * under consideration has degrees of freedom exclusively on
-   * vertices. Otherwise, the function doesn't make much sense, since
-   * for example inactive edges do not have degrees of freedom
-   * associated with them at all.
-   *
    * The last argument denotes the finite element index. For the
    * standard ::DoFHandler class, this value must be equal to its
    * default value since that class only supports the same finite
@@ -411,27 +409,25 @@ public:
    * <code>cell-@>active_fe_index</code> as last argument.
    *
    */
-  void get_dof_indices (std::vector<unsigned int> &dof_indices,
+  void get_dof_indices (std::vector<types::global_dof_index> &dof_indices,
                         const unsigned int fe_index = DH::default_fe_index) const;
 
   /**
-   * Return the indices of the dofs of this
-   * object in the standard ordering: dofs
-   * on vertex 0, dofs on vertex 1, ...
-   * dofs on line 0, dofs on line 1, ...,
-   * then quads, then hexes.
-   *
-   * It is assumed that the vector already
-   * has the right size beforehand. The
-   * indices refer to the local numbering
-   * for the level this line lives on.
+   * Return the global multilevel indices of the degrees of freedom that live
+   * on the current object with respect to the given level within the
+   * multigrid hierarchy. The indices refer to the local numbering for the
+   * level this line lives on.
    */
-  void get_mg_dof_indices (const int level, std::vector<unsigned int> &dof_indices, const unsigned int fe_index = DH::default_fe_index) const;
+  void get_mg_dof_indices (const int level,
+                           std::vector<types::global_dof_index> &dof_indices,
+                           const unsigned int fe_index = DH::default_fe_index) const;
 
   /**
    * Sets the level DoF indices that are returned by get_mg_dof_indices.
    */
-  void set_mg_dof_indices (const int level, const std::vector<unsigned int> &dof_indices, const unsigned int fe_index = DH::default_fe_index);
+  void set_mg_dof_indices (const int level,
+                           const std::vector<types::global_dof_index> &dof_indices,
+                           const unsigned int fe_index = DH::default_fe_index);
 
   /**
    * Global DoF index of the <i>i</i>
@@ -469,19 +465,19 @@ public:
    * match the result of
    * active_fe_index().
    */
-  unsigned int vertex_dof_index (const unsigned int vertex,
-                                 const unsigned int i,
-                                 const unsigned int fe_index = DH::default_fe_index) const;
+  types::global_dof_index vertex_dof_index (const unsigned int vertex,
+                                            const unsigned int i,
+                                            const unsigned int fe_index = DH::default_fe_index) const;
 
   /**
-   * Returns the Global DoF index of the <code>i</code>th degree of
+   * Returns the global DoF index of the <code>i</code>th degree of
    * freedom associated with the <code>vertex</code>th vertex on
    * level @p level. Also see vertex_dof_index().
    */
-  unsigned int mg_vertex_dof_index (const int level,
-                                    const unsigned int vertex,
-                                    const unsigned int i,
-                                    const unsigned int fe_index = DH::default_fe_index) const;
+  types::global_dof_index mg_vertex_dof_index (const int level,
+                                               const unsigned int vertex,
+                                               const unsigned int i,
+                                               const unsigned int fe_index = DH::default_fe_index) const;
 
   /**
    * Index of the <i>i</i>th degree
@@ -537,13 +533,13 @@ public:
    * degrees are defined in the interior of
    * the face.
    */
-  unsigned int dof_index (const unsigned int i,
-                          const unsigned int fe_index = DH::default_fe_index) const;
+  types::global_dof_index dof_index (const unsigned int i,
+                                     const unsigned int fe_index = DH::default_fe_index) const;
 
   /**
    * Returns the dof_index on the given level. Also see dof_index.
    */
-  unsigned int mg_dof_index (const int level, const unsigned int i) const;
+  types::global_dof_index mg_dof_index (const int level, const unsigned int i) const;
 
   /**
    * @}
@@ -754,10 +750,10 @@ protected:
    * active_fe_index().
    */
   void set_dof_index (const unsigned int i,
-                      const unsigned int index,
+                      const types::global_dof_index index,
                       const unsigned int fe_index = DH::default_fe_index) const;
 
-  void set_mg_dof_index (const int level, const unsigned int i, const unsigned int index) const;
+  void set_mg_dof_index (const int level, const unsigned int i, const types::global_dof_index index) const;
 
   /**
    * Set the global index of the <i>i</i>
@@ -797,10 +793,10 @@ protected:
    */
   void set_vertex_dof_index (const unsigned int vertex,
                              const unsigned int i,
-                             const unsigned int index,
+                             const types::global_dof_index index,
                              const unsigned int fe_index = DH::default_fe_index) const;
 
-  void set_mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i, const unsigned int index, const unsigned int fe_index = DH::default_fe_index) const;
+  void set_mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i, const types::global_dof_index index, const unsigned int fe_index = DH::default_fe_index) const;
 
   /**
    * Iterator classes need to be friends
@@ -1079,32 +1075,19 @@ public:
    */
 
   /**
-   * Return the indices of the dofs of this
-   * object in the standard ordering: dofs
-   * on vertex 0, dofs on vertex 1, etc,
-   * dofs on line 0, dofs on line 1, etc,
-   * dofs on quad 0, etc.
+   * Return the <i>global</i> indices of the degrees of freedom located on
+   * this object in the standard ordering defined by the finite element (i.e.,
+   * dofs on vertex 0, dofs on vertex 1, etc, dofs on line 0, dofs on line 1,
+   * etc, dofs on quad 0, etc.) This function is only available on
+   * <i>active</i> objects (see @ref GlossActive "this glossary entry").
+   *
+   * The cells needs to be an active cell (and not artificial in a
+   * parallel distributed computation).
    *
    * The vector has to have the
    * right size before being passed
    * to this function.
    *
-   * This function is most often
-   * used on active objects (edges,
-   * faces, cells). It can be used
-   * on non-active objects as well
-   * (i.e. objects that have
-   * children), but only if the
-   * finite element under
-   * consideration has degrees of
-   * freedom exclusively on
-   * vertices. Otherwise, the
-   * function doesn't make much
-   * sense, since for example
-   * inactive edges do not have
-   * degrees of freedom associated
-   * with them at all.
-   *
    * The last argument denotes the
    * finite element index. For the
    * standard ::DoFHandler class,
@@ -1149,7 +1132,7 @@ public:
    * <code>cell-@>active_fe_index</code>
    * as last argument.
    */
-  void get_dof_indices (std::vector<unsigned int> &dof_indices,
+  void get_dof_indices (std::vector<types::global_dof_index> &dof_indices,
                         const unsigned int fe_index = AccessorData::default_fe_index) const;
 
   /**
@@ -1188,9 +1171,9 @@ public:
    * match the result of
    * active_fe_index().
    */
-  unsigned int vertex_dof_index (const unsigned int vertex,
-                                 const unsigned int i,
-                                 const unsigned int fe_index = AccessorData::default_fe_index) const;
+  types::global_dof_index vertex_dof_index (const unsigned int vertex,
+                                            const unsigned int i,
+                                            const unsigned int fe_index = AccessorData::default_fe_index) const;
 
   /**
    * Index of the <i>i</i>th degree
@@ -1246,8 +1229,8 @@ public:
    * degrees are defined in the interior of
    * the face.
    */
-  unsigned int dof_index (const unsigned int i,
-                          const unsigned int fe_index = AccessorData::default_fe_index) const;
+  types::global_dof_index dof_index (const unsigned int i,
+                                     const unsigned int fe_index = AccessorData::default_fe_index) const;
 
   /**
    * @}
@@ -1436,7 +1419,7 @@ protected:
    * active_fe_index().
    */
   void set_dof_index (const unsigned int i,
-                      const unsigned int index,
+                      const types::global_dof_index index,
                       const unsigned int fe_index = AccessorData::default_fe_index) const;
 
   /**
@@ -1477,7 +1460,7 @@ protected:
    */
   void set_vertex_dof_index (const unsigned int vertex,
                              const unsigned int i,
-                             const unsigned int index,
+                             const types::global_dof_index index,
                              const unsigned int fe_index = AccessorData::default_fe_index) const;
 
   /**
@@ -2076,51 +2059,50 @@ public:
    *
    * Examples for this use are in the implementation of DoFRenumbering.
    */
-  void get_active_or_mg_dof_indices (std::vector<unsigned int> &dof_indices) const;
+  void get_active_or_mg_dof_indices (std::vector<types::global_dof_index> &dof_indices) const;
 
   /**
-   * Return the indices of the dofs of this
-   * quad in the standard ordering: dofs
-   * on vertex 0, dofs on vertex 1, etc,
-   * dofs on line 0, dofs on line 1, etc,
-   * dofs on quad 0, etc.
+   * Return the <i>global</i> indices of the degrees of freedom located on
+   * this object in the standard ordering defined by the finite element (i.e.,
+   * dofs on vertex 0, dofs on vertex 1, etc, dofs on line 0, dofs on line 1,
+   * etc, dofs on quad 0, etc.) This function is only available on
+   * <i>active</i> objects (see @ref GlossActive "this glossary entry").
+   *
+   * @param[out] dof_indices The vector into which the indices will be
+   *     written. It has to have the right size (namely,
+   *     <code>fe.dofs_per_cell</code>, <code>fe.dofs_per_face</code>,
+   *     or <code>fe.dofs_per_line</code>, depending on which kind of
+   *     object this function is called) before being passed to this
+   *     function.
    *
-   * It is assumed that the vector already
-   * has the right size beforehand.
-   *
-   * This function reimplements the
-   * same function in the base
-   * class. The functions in the
-   * base classes are available for
-   * all geometric objects,
-   * i.e. even in 3d they can be
-   * used to access the dof indices
-   * of edges, for example. On the
-   * other hand, the most common
-   * case is clearly the use on
-   * cells, which is why we cache
-   * the array for each cell, but
-   * not edge. To retrieve the
-   * cached values, rather than
-   * collect the necessary
-   * information every time, this
-   * function overwrites the one in
-   * the base class.
-   *
-   * This is a function which requires that the cell be active.
+   * This function reimplements the same function in the base class.
+   * In contrast to the function in the base class, we do not need the
+   * <code>fe_index</code> here because there is always a unique finite
+   * element index on cells.
+   *
+   * This is a function which requires that the cell is active.
    *
    * Also see get_active_or_mg_dof_indices().
    *
+   * @note In many places in the tutorial and elsewhere in the library,
+   *   the argument to this function is called <code>local_dof_indices</code>
+   *   by convention. The name is not meant to indicate the <i>local</i>
+   *   numbers of degrees of freedom (which are always between zero and
+   *   <code>fe.dofs_per_cell</code>) but instead that the returned values
+   *   are the <i>global</i> indices of those degrees of freedom that
+   *   are located locally on the current cell.
+   *
    * @deprecated Currently, this function can also be called for non-active cells, if all degrees of freedom of the FiniteElement are located in vertices. This functionality will vanish in a future release.
    */
-  void get_dof_indices (std::vector<unsigned int> &dof_indices) const;
+  void get_dof_indices (std::vector<types::global_dof_index> &dof_indices) const;
 
   /**
    * @deprecated Use get_active_or_mg_dof_indices() with level_cell_iterator returned from begin_mg().
    *
-   * Retrieve the global indices of the degrees of freedom on this cell in the level vector associated to the level of the cell.
+   * Retrieve the global indices of the degrees of freedom on this cell in the
+   * level vector associated to the level of the cell.
    */
-  void get_mg_dof_indices (std::vector<unsigned int> &dof_indices) const;
+  void get_mg_dof_indices (std::vector<types::global_dof_index> &dof_indices) const;
 
   /**
    * @}
@@ -2170,13 +2152,13 @@ public:
    * cache, if one exists for the
    * given DoF handler class.
    */
-  void set_dof_indices (const std::vector<unsigned int> &dof_indices);
+  void set_dof_indices (const std::vector<types::global_dof_index> &dof_indices);
 
   /**
    * Set the Level DoF indices of this
    * cell to the given values.
    */
-  void set_mg_dof_indices (const std::vector<unsigned int> &dof_indices);
+  void set_mg_dof_indices (const std::vector<types::global_dof_index> &dof_indices);
 
   /**
    * Update the cache in which we
index 3ec680e3428f700ce7ea05720bae831da65c7e35..8006dba0d046b583338f78646f66c8a8bd3fa802 100644 (file)
@@ -1,19 +1,25 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_accessor_templates_h
 #define __deal2__dof_accessor_templates_h
 
 
 #include <deal.II/base/config.h>
+#include <deal.II/base/types.h>
 #include <deal.II/lac/constraint_matrix.h>
 #include <deal.II/dofs/dof_accessor.h>
 #include <deal.II/dofs/dof_levels.h>
@@ -24,6 +30,7 @@
 #include <deal.II/grid/tria_iterator.templates.h>
 
 #include <vector>
+#include <limits>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -219,7 +226,7 @@ namespace internal
        */
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::DoFHandler<1,spacedim>   &dof_handler,
                      const unsigned int                      obj_level,
                      const unsigned int                      obj_index,
@@ -244,7 +251,7 @@ namespace internal
                      const unsigned int              fe_index,
                      const unsigned int              local_index,
                      dealii::internal::int2type<1>,
-                     const unsigned int              global_index)
+                     const types::global_dof_index              global_index)
       {
         dof_handler.levels[obj_level]->dof_object.
         set_dof_index (dof_handler,
@@ -257,7 +264,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::DoFHandler<2,spacedim>   &dof_handler,
                      const unsigned int              obj_level,
                      const unsigned int              obj_index,
@@ -284,7 +291,7 @@ namespace internal
                      const unsigned int              fe_index,
                      const unsigned int              local_index,
                      dealii::internal::int2type<1>,
-                     const unsigned int              global_index)
+                     const types::global_dof_index              global_index)
       {
         // faces have no levels
         Assert (obj_level == 0, ExcInternalError());
@@ -299,7 +306,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::DoFHandler<2,spacedim>   &dof_handler,
                      const unsigned int              obj_level,
                      const unsigned int              obj_index,
@@ -324,7 +331,7 @@ namespace internal
                      const unsigned int              fe_index,
                      const unsigned int              local_index,
                      dealii::internal::int2type<2>,
-                     const unsigned int              global_index)
+                     const types::global_dof_index              global_index)
       {
         dof_handler.levels[obj_level]->dof_object.
         set_dof_index (dof_handler,
@@ -337,7 +344,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::DoFHandler<3,spacedim>   &dof_handler,
                      const unsigned int              obj_level,
                      const unsigned int              obj_index,
@@ -364,7 +371,7 @@ namespace internal
                      const unsigned int              fe_index,
                      const unsigned int              local_index,
                      dealii::internal::int2type<1>,
-                     const unsigned int              global_index)
+                     const types::global_dof_index              global_index)
       {
         // faces have no levels
         Assert (obj_level == 0, ExcInternalError());
@@ -380,7 +387,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::DoFHandler<3,spacedim>   &dof_handler,
                      const unsigned int              obj_level,
                      const unsigned int              obj_index,
@@ -407,7 +414,7 @@ namespace internal
                      const unsigned int              fe_index,
                      const unsigned int              local_index,
                      dealii::internal::int2type<2>,
-                     const unsigned int              global_index)
+                     const types::global_dof_index              global_index)
       {
         // faces have no levels
         Assert (obj_level == 0, ExcInternalError());
@@ -423,7 +430,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::DoFHandler<3,spacedim>   &dof_handler,
                      const unsigned int              obj_level,
                      const unsigned int              obj_index,
@@ -448,7 +455,7 @@ namespace internal
                      const unsigned int              fe_index,
                      const unsigned int              local_index,
                      dealii::internal::int2type<3>,
-                     const unsigned int              global_index)
+                     const types::global_dof_index              global_index)
       {
         dof_handler.levels[obj_level]->dof_object.
         set_dof_index (dof_handler,
@@ -461,7 +468,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
                      const unsigned int       obj_level,
                      const unsigned int       obj_index,
@@ -487,7 +494,7 @@ namespace internal
                      const unsigned int       fe_index,
                      const unsigned int       local_index,
                      const dealii::internal::int2type<1> &,
-                     const unsigned int       global_index)
+                     const types::global_dof_index       global_index)
       {
         dof_handler.levels[obj_level]->dof_object.
         set_dof_index (dof_handler,
@@ -501,7 +508,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
                      const unsigned int       obj_level,
                      const unsigned int       obj_index,
@@ -527,7 +534,7 @@ namespace internal
                      const unsigned int       fe_index,
                      const unsigned int       local_index,
                      const dealii::internal::int2type<1> &,
-                     const unsigned int       global_index)
+                     const types::global_dof_index       global_index)
       {
         dof_handler.faces->lines.
         set_dof_index (dof_handler,
@@ -541,7 +548,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
                      const unsigned int       obj_level,
                      const unsigned int       obj_index,
@@ -567,7 +574,7 @@ namespace internal
                      const unsigned int       fe_index,
                      const unsigned int       local_index,
                      const dealii::internal::int2type<2> &,
-                     const unsigned int       global_index)
+                     const types::global_dof_index       global_index)
       {
         dof_handler.levels[obj_level]->dof_object.
         set_dof_index (dof_handler,
@@ -581,7 +588,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
                      const unsigned int       obj_level,
                      const unsigned int       obj_index,
@@ -607,7 +614,7 @@ namespace internal
                      const unsigned int       fe_index,
                      const unsigned int       local_index,
                      const dealii::internal::int2type<1> &,
-                     const unsigned int       global_index)
+                     const types::global_dof_index       global_index)
       {
         dof_handler.faces->lines.
         set_dof_index (dof_handler,
@@ -621,7 +628,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
                      const unsigned int       obj_level,
                      const unsigned int       obj_index,
@@ -647,7 +654,7 @@ namespace internal
                      const unsigned int       fe_index,
                      const unsigned int       local_index,
                      const dealii::internal::int2type<2> &,
-                     const unsigned int       global_index)
+                     const types::global_dof_index       global_index)
       {
         dof_handler.faces->quads.
         set_dof_index (dof_handler,
@@ -661,7 +668,7 @@ namespace internal
 
       template <int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
                      const unsigned int       obj_level,
                      const unsigned int       obj_index,
@@ -687,7 +694,7 @@ namespace internal
                      const unsigned int       fe_index,
                      const unsigned int       local_index,
                      const dealii::internal::int2type<3> &,
-                     const unsigned int       global_index)
+                     const types::global_dof_index       global_index)
       {
         dof_handler.levels[obj_level]->dof_object.
         set_dof_index (dof_handler,
@@ -1103,7 +1110,7 @@ namespace internal
                             const unsigned int vertex_index,
                             const unsigned int fe_index,
                             const unsigned int local_index,
-                            const unsigned int global_index)
+                            const types::global_dof_index global_index)
       {
         Assert ((fe_index == dealii::DoFHandler<dim,spacedim>::default_fe_index),
                 ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
@@ -1128,7 +1135,7 @@ namespace internal
                             const unsigned int vertex_index,
                             const unsigned int fe_index,
                             const unsigned int local_index,
-                            const unsigned int global_index)
+                            const types::global_dof_index global_index)
       {
         Assert ( (fe_index != dealii::hp::DoFHandler<dim,spacedim>::default_fe_index),
                  ExcMessage ("You need to specify a FE index when working "
@@ -1142,7 +1149,7 @@ namespace internal
         Assert (fe_index < dof_handler.finite_elements->size(),
                 ExcInternalError());
         Assert (dof_handler.vertex_dofs_offsets[vertex_index] !=
-                numbers::invalid_unsigned_int,
+                numbers::invalid_dof_index,
                 ExcMessage ("This vertex is unused and has no DoFs associated with it"));
 
         // hop along the list of index
@@ -1152,15 +1159,17 @@ namespace internal
         // part. trigger an exception if
         // we can't find a set for this
         // particular fe_index
-        const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
-        unsigned int *pointer              = &dof_handler.vertex_dofs[starting_offset];
+        const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
+        types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset];
         while (true)
           {
             Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError());
 
-            const unsigned int this_fe_index = *pointer;
+            // a fe index is always small
+            Assert((*pointer)<std::numeric_limits<unsigned int>::max(), ExcInternalError());
+            const types::global_dof_index this_fe_index = *pointer;
 
-            Assert (this_fe_index != numbers::invalid_unsigned_int,
+            Assert (this_fe_index != numbers::invalid_dof_index,
                     ExcInternalError());
             Assert (this_fe_index < dof_handler.finite_elements->size(),
                     ExcInternalError());
@@ -1171,7 +1180,8 @@ namespace internal
                 return;
               }
             else
-              pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+              pointer += static_cast<types::global_dof_index>(
+                           (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1);
           }
       }
 
@@ -1189,7 +1199,7 @@ namespace internal
 
       template <int dim, int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_vertex_dof_index (const dealii::DoFHandler<dim,spacedim> &dof_handler,
                             const unsigned int vertex_index,
                             const unsigned int fe_index,
@@ -1213,7 +1223,7 @@ namespace internal
 
       template<int dim, int spacedim>
       static
-      unsigned int
+      types::global_dof_index
       get_vertex_dof_index (const dealii::hp::DoFHandler<dim,spacedim> &dof_handler,
                             const unsigned int vertex_index,
                             const unsigned int fe_index,
@@ -1232,7 +1242,7 @@ namespace internal
                 ExcIndexRange (vertex_index, 0,
                                dof_handler.vertex_dofs_offsets.size()));
         Assert (dof_handler.vertex_dofs_offsets[vertex_index] !=
-                numbers::invalid_unsigned_int,
+                numbers::invalid_dof_index,
                 ExcMessage ("This vertex is unused and has no DoFs associated with it"));
 
         // hop along the list of index
@@ -1242,15 +1252,16 @@ namespace internal
         // part. trigger an exception if
         // we can't find a set for this
         // particular fe_index
-        const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
-        const unsigned int *pointer        = &dof_handler.vertex_dofs[starting_offset];
+        const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
+        const types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset];
         while (true)
           {
             Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError());
 
-            const unsigned int this_fe_index = *pointer;
+            Assert((*pointer)<std::numeric_limits<types::global_dof_index>::max(), ExcInternalError());
+            const types::global_dof_index this_fe_index = *pointer;
 
-            Assert (this_fe_index != numbers::invalid_unsigned_int,
+            Assert (this_fe_index != numbers::invalid_dof_index,
                     ExcInternalError());
             Assert (this_fe_index < dof_handler.finite_elements->size(),
                     ExcInternalError());
@@ -1258,7 +1269,8 @@ namespace internal
             if (this_fe_index == fe_index)
               return *(pointer + 1 + local_index);
             else
-              pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+              pointer += static_cast<types::global_dof_index>(
+                           (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1);
           }
       }
 
@@ -1280,16 +1292,16 @@ namespace internal
                             "this DoFHandler"));
 
         // if this vertex is unused, return 0
-        if (dof_handler.vertex_dofs_offsets[vertex_index] == numbers::invalid_unsigned_int)
+        if (dof_handler.vertex_dofs_offsets[vertex_index] == numbers::invalid_dof_index)
           return 0;
 
         // hop along the list of index
         // sets and count the number of
         // hops
-        const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
-        const unsigned int *pointer        = &dof_handler.vertex_dofs[starting_offset];
+        const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
+        const types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset];
 
-        Assert (*pointer != numbers::invalid_unsigned_int,
+        Assert (*pointer != numbers::invalid_dof_index,
                 ExcInternalError());
 
         unsigned int counter = 0;
@@ -1297,13 +1309,14 @@ namespace internal
           {
             Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError());
 
-            const unsigned int this_fe_index = *pointer;
+            const types::global_dof_index this_fe_index = *pointer;
 
-            if (this_fe_index == numbers::invalid_unsigned_int)
+            if (this_fe_index == numbers::invalid_dof_index)
               return counter;
             else
               {
-                pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+                pointer += static_cast<types::global_dof_index>(
+                             (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1);
                 ++counter;
               }
           }
@@ -1332,16 +1345,16 @@ namespace internal
         // make sure we don't ask on
         // unused vertices
         Assert (dof_handler.vertex_dofs_offsets[vertex_index] !=
-                numbers::invalid_unsigned_int,
+                numbers::invalid_dof_index,
                 ExcInternalError());
 
         // hop along the list of index
         // sets and count the number of
         // hops
-        const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
-        const unsigned int *pointer        = &dof_handler.vertex_dofs[starting_offset];
+        const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
+        const types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset];
 
-        Assert (*pointer != numbers::invalid_unsigned_int,
+        Assert (*pointer != numbers::invalid_dof_index,
                 ExcInternalError());
 
         unsigned int counter = 0;
@@ -1349,7 +1362,8 @@ namespace internal
           {
             Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError());
 
-            const unsigned int this_fe_index = *pointer;
+            Assert((*pointer)<std::numeric_limits<unsigned int>::max(), ExcInternalError());
+            const types::global_dof_index this_fe_index = *pointer;
 
             Assert (this_fe_index < dof_handler.finite_elements->size(),
                     ExcInternalError());
@@ -1357,10 +1371,11 @@ namespace internal
             if (counter == n)
               return this_fe_index;
 
-            Assert (this_fe_index != numbers::invalid_unsigned_int,
+            Assert (this_fe_index != numbers::invalid_dof_index,
                     ExcInternalError());
 
-            pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+            pointer += static_cast<types::global_dof_index>(
+                         (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1);
             ++counter;
           }
       }
@@ -1392,28 +1407,29 @@ namespace internal
         // make sure we don't ask on
         // unused vertices
         Assert (dof_handler.vertex_dofs_offsets[vertex_index] !=
-                numbers::invalid_unsigned_int,
+                numbers::invalid_dof_index,
                 ExcInternalError());
 
         // hop along the list of index
         // sets and see whether we find
         // the given index
-        const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
-        const unsigned int *pointer        = &dof_handler.vertex_dofs[starting_offset];
+        const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
+        const types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset];
 
-        Assert (*pointer != numbers::invalid_unsigned_int,
+        Assert (*pointer != numbers::invalid_dof_index,
                 ExcInternalError());
 
         while (true)
           {
             Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError());
 
-            const unsigned int this_fe_index = *pointer;
+            Assert((*pointer)<std::numeric_limits<types::global_dof_index>::max(), ExcInternalError());
+            const types::global_dof_index this_fe_index = *pointer;
 
             Assert (this_fe_index < dof_handler.finite_elements->size(),
                     ExcInternalError());
 
-            if (this_fe_index == numbers::invalid_unsigned_int)
+            if (this_fe_index == numbers::invalid_dof_index)
               return false;
             else if (this_fe_index == fe_index)
               return true;
@@ -1426,7 +1442,7 @@ namespace internal
       static
       void set_mg_dof_indices (const dealii::DoFAccessor<1,DH,lda> &,
                                const int,
-                               const std::vector<unsigned int> &,
+                               const std::vector<types::global_dof_index> &,
                                const unsigned int)
       {
         AssertThrow (false, ExcNotImplemented ()); //TODO[TH]: implement
@@ -1438,11 +1454,11 @@ namespace internal
       static
       void set_mg_dof_indices (dealii::DoFAccessor<2, DH,lda> &accessor,
                                const int level,
-                               const std::vector<unsigned int> &dof_indices,
+                               const std::vector<types::global_dof_index> &dof_indices,
                                const unsigned int fe_index)
       {
         const FiniteElement<DH::dimension, DH::space_dimension> &fe = accessor.get_dof_handler ().get_fe ()[fe_index];
-        std::vector<unsigned int>::const_iterator next = dof_indices.begin ();
+        std::vector<types::global_dof_index>::const_iterator next = dof_indices.begin ();
 
         for (unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex)
           for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
@@ -1464,7 +1480,7 @@ namespace internal
       static
       void set_mg_dof_indices (const dealii::DoFAccessor<3, DH,lda> &,
                                const int,
-                               const std::vector<unsigned int> &,
+                               const std::vector<types::global_dof_index> &,
                                const unsigned int)
       {
         AssertThrow (false, ExcNotImplemented ()); //TODO[TH]: implement
@@ -1478,7 +1494,7 @@ namespace internal
 
 template <int dim, class DH, bool lda>
 inline
-unsigned int
+types::global_dof_index
 DoFAccessor<dim,DH,lda>::dof_index (const unsigned int i,
                                     const unsigned int fe_index) const
 {
@@ -1494,7 +1510,9 @@ DoFAccessor<dim,DH,lda>::dof_index (const unsigned int i,
 
 template<int structdim, class DH, bool lda>
 inline
-unsigned int DoFAccessor<structdim, DH,lda>::mg_dof_index (const int level, const unsigned int i) const
+types::global_dof_index
+DoFAccessor<structdim, DH,lda>::mg_dof_index (const int level,
+                                              const unsigned int i) const
 {
   return this->dof_handler->template get_dof_index<structdim> (level, this->present_index, 0, i);
 }
@@ -1504,7 +1522,7 @@ template <int dim, class DH, bool lda>
 inline
 void
 DoFAccessor<dim,DH,lda>::set_dof_index (const unsigned int i,
-                                        const unsigned int index,
+                                        const types::global_dof_index index,
                                         const unsigned int fe_index) const
 {
   // access the respective DoF
@@ -1571,7 +1589,7 @@ DoFAccessor<dim,DH,lda>::fe_index_is_active (const unsigned int fe_index) const
 
 template <int structdim, class DH, bool lda>
 inline
-unsigned int
+types::global_dof_index
 DoFAccessor<structdim, DH,lda>::vertex_dof_index (const unsigned int vertex,
                                                   const unsigned int i,
                                                   const unsigned int fe_index) const
@@ -1587,8 +1605,11 @@ DoFAccessor<structdim, DH,lda>::vertex_dof_index (const unsigned int vertex,
 
 template<int structdim, class DH, bool lda>
 inline
-unsigned
-DoFAccessor<structdim, DH,lda>::mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i, const unsigned int fe_index) const
+types::global_dof_index
+DoFAccessor<structdim, DH,lda>::mg_vertex_dof_index (const int level,
+                                                     const unsigned int vertex,
+                                                     const unsigned int i,
+                                                     const unsigned int fe_index) const
 {
   Assert (this->dof_handler != 0, ExcInvalidObject ());
   Assert (&this->dof_handler->get_fe () != 0, ExcInvalidObject ());
@@ -1603,7 +1624,7 @@ inline
 void
 DoFAccessor<structdim, DH,lda>::set_vertex_dof_index (const unsigned int vertex,
                                                       const unsigned int i,
-                                                      const unsigned int index,
+                                                      const types::global_dof_index index,
                                                       const unsigned int fe_index) const
 {
   dealii::internal::DoFAccessor::Implementation::set_vertex_dof_index
@@ -1618,7 +1639,11 @@ DoFAccessor<structdim, DH,lda>::set_vertex_dof_index (const unsigned int vertex,
 template<int structdim, class DH, bool lda>
 inline
 void
-DoFAccessor<structdim, DH,lda>::set_mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i, const unsigned int index, const unsigned int fe_index) const
+DoFAccessor<structdim, DH,lda>::set_mg_vertex_dof_index (const int level,
+                                                         const unsigned int vertex,
+                                                         const unsigned int i,
+                                                         const types::global_dof_index index,
+                                                         const unsigned int fe_index) const
 {
   Assert (this->dof_handler != 0, ExcInvalidObject ());
   Assert (&this->dof_handler->get_fe () != 0, ExcInvalidObject ());
@@ -1631,7 +1656,9 @@ DoFAccessor<structdim, DH,lda>::set_mg_vertex_dof_index (const int level, const
 template<int structdim, class DH, bool lda>
 inline
 void
-DoFAccessor<structdim, DH,lda>::set_mg_dof_index (const int level, const unsigned int i, const unsigned int index) const
+DoFAccessor<structdim, DH,lda>::set_mg_dof_index (const int level,
+                                                  const unsigned int i,
+                                                  const types::global_dof_index index) const
 {
   this->dof_handler->template set_dof_index<structdim> (level, this->present_index, 0, i, index);
 }
@@ -1683,12 +1710,12 @@ namespace internal
   {
     template <class DH, bool lda>
     void get_dof_indices (const dealii::DoFAccessor<1,DH,lda>   &accessor,
-                          std::vector<unsigned int> &dof_indices,
+                          std::vector<types::global_dof_index> &dof_indices,
                           const unsigned int         fe_index)
     {
       const unsigned int dofs_per_vertex = accessor.get_fe(fe_index).dofs_per_vertex,
                          dofs_per_line   = accessor.get_fe(fe_index).dofs_per_line;
-      std::vector<unsigned int>::iterator next = dof_indices.begin();
+      std::vector<types::global_dof_index>::iterator next = dof_indices.begin();
       for (unsigned int vertex=0; vertex<2; ++vertex)
         for (unsigned int d=0; d<dofs_per_vertex; ++d)
           *next++ = accessor.vertex_dof_index(vertex,d,fe_index);
@@ -1700,13 +1727,13 @@ namespace internal
 
     template <class DH, bool lda>
     void get_dof_indices (const dealii::DoFAccessor<2,DH,lda>   &accessor,
-                          std::vector<unsigned int> &dof_indices,
+                          std::vector<types::global_dof_index> &dof_indices,
                           const unsigned int         fe_index)
     {
       const unsigned int dofs_per_vertex = accessor.get_fe(fe_index).dofs_per_vertex,
                          dofs_per_line   = accessor.get_fe(fe_index).dofs_per_line,
                          dofs_per_quad   = accessor.get_fe(fe_index).dofs_per_quad;
-      std::vector<unsigned int>::iterator next = dof_indices.begin();
+      std::vector<types::global_dof_index>::iterator next = dof_indices.begin();
       for (unsigned int vertex=0; vertex<4; ++vertex)
         for (unsigned int d=0; d<dofs_per_vertex; ++d)
           *next++ = accessor.vertex_dof_index(vertex,d,fe_index);
@@ -1735,14 +1762,14 @@ namespace internal
 
     template <class DH, bool lda>
     void get_dof_indices (const dealii::DoFAccessor<3,DH,lda>   &accessor,
-                          std::vector<unsigned int> &dof_indices,
+                          std::vector<types::global_dof_index> &dof_indices,
                           const unsigned int         fe_index)
     {
       const unsigned int dofs_per_vertex = accessor.get_fe(fe_index).dofs_per_vertex,
                          dofs_per_line   = accessor.get_fe(fe_index).dofs_per_line,
                          dofs_per_quad   = accessor.get_fe(fe_index).dofs_per_quad,
                          dofs_per_hex    = accessor.get_fe(fe_index).dofs_per_hex;
-      std::vector<unsigned int>::iterator next = dof_indices.begin();
+      std::vector<types::global_dof_index>::iterator next = dof_indices.begin();
       for (unsigned int vertex=0; vertex<8; ++vertex)
         for (unsigned int d=0; d<dofs_per_vertex; ++d)
           *next++ = accessor.vertex_dof_index(vertex,d,fe_index);
@@ -1792,16 +1819,16 @@ namespace internal
     template<class DH, bool lda>
     void get_mg_dof_indices (const dealii::DoFAccessor<1, DH,lda> &accessor,
                              const int level,
-                             std::vector<unsigned int> &dof_indices,
+                             std::vector<types::global_dof_index> &dof_indices,
                              const unsigned int fe_index)
     {
       const DH &handler = accessor.get_dof_handler();
-      Assert(handler.n_dofs(level) != numbers::invalid_unsigned_int,
+      Assert(handler.n_dofs(level) != numbers::invalid_dof_index,
              ExcNotInitialized());
 
       const FiniteElement<DH::dimension, DH::space_dimension> &fe
         = handler.get_fe ()[fe_index];
-      std::vector<unsigned int>::iterator next = dof_indices.begin ();
+      std::vector<types::global_dof_index>::iterator next = dof_indices.begin ();
 
       for (unsigned int vertex = 0; vertex < GeometryInfo<1>::vertices_per_cell; ++vertex)
         for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
@@ -1818,15 +1845,15 @@ namespace internal
     template<class DH, bool lda>
     void get_mg_dof_indices (const dealii::DoFAccessor<2, DH,lda> &accessor,
                              const int level,
-                             std::vector<unsigned int> &dof_indices,
+                             std::vector<types::global_dof_index> &dof_indices,
                              const unsigned int fe_index)
     {
       const DH &handler = accessor.get_dof_handler();
-      Assert(handler.n_dofs(level) != numbers::invalid_unsigned_int,
+      Assert(handler.n_dofs(level) != numbers::invalid_dof_index,
              ExcNotInitialized());
 
       const FiniteElement<DH::dimension, DH::space_dimension> &fe = handler.get_fe ()[fe_index];
-      std::vector<unsigned int>::iterator next = dof_indices.begin ();
+      std::vector<types::global_dof_index>::iterator next = dof_indices.begin ();
 
       for (unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex)
         for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
@@ -1847,15 +1874,15 @@ namespace internal
     template<class DH, bool lda>
     void get_mg_dof_indices (const dealii::DoFAccessor<3, DH,lda> &accessor,
                              const int level,
-                             std::vector<unsigned int> &dof_indices,
+                             std::vector<types::global_dof_index> &dof_indices,
                              const unsigned int fe_index)
     {
       const DH &handler = accessor.get_dof_handler();
-      Assert(handler.n_dofs(level) != numbers::invalid_unsigned_int,
+      Assert(handler.n_dofs(level) != numbers::invalid_dof_index,
              ExcNotInitialized());
 
       const FiniteElement<DH::dimension, DH::space_dimension> &fe = handler.get_fe ()[fe_index];
-      std::vector<unsigned int>::iterator next = dof_indices.begin ();
+      std::vector<types::global_dof_index>::iterator next = dof_indices.begin ();
 
       for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex)
         for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
@@ -1883,7 +1910,7 @@ namespace internal
 template <int structdim, class DH, bool lda>
 inline
 void
-DoFAccessor<structdim,DH,lda>::get_dof_indices (std::vector<unsigned int> &dof_indices,
+DoFAccessor<structdim,DH,lda>::get_dof_indices (std::vector<types::global_dof_index> &dof_indices,
                                                 const unsigned int         fe_index) const
 {
   Assert (this->dof_handler != 0, ExcNotInitialized());
@@ -1946,7 +1973,7 @@ DoFAccessor<structdim,DH,lda>::get_dof_indices (std::vector<unsigned int> &dof_i
 template<int structdim, class DH, bool lda>
 inline
 void DoFAccessor<structdim, DH,lda>::get_mg_dof_indices (const int level,
-                                                         std::vector<unsigned int> &dof_indices,
+                                                         std::vector<types::global_dof_index> &dof_indices,
                                                          const unsigned int fe_index) const
 {
   Assert (this->dof_handler != 0, ExcInvalidObject ());
@@ -1998,7 +2025,7 @@ void DoFAccessor<structdim, DH,lda>::get_mg_dof_indices (const int level,
 template<int structdim, class DH, bool lda>
 inline
 void DoFAccessor<structdim, DH,lda>::set_mg_dof_indices (const int level,
-                                                         const std::vector<unsigned int> &dof_indices,
+                                                         const std::vector<types::global_dof_index> &dof_indices,
                                                          const unsigned int fe_index)
 {
   Assert (this->dof_handler != 0, ExcInvalidObject ());
@@ -2134,10 +2161,10 @@ DoFAccessor<structdim,DH,lda>::line (const unsigned int i) const
 
   // checking of 'i' happens in line_index(i)
   return typename dealii::internal::DoFHandler::Iterators<DH,lda>::line_iterator
-    (this->tria,
-     0,  // only sub-objects are allowed, which have no level
-     this->line_index(i),
-     this->dof_handler);
+         (this->tria,
+          0,  // only sub-objects are allowed, which have no level
+          this->line_index(i),
+          this->dof_handler);
 }
 
 
@@ -2169,10 +2196,10 @@ DoFAccessor<structdim,DH,lda>::quad (const unsigned int i) const
 
   // checking of 'i' happens in quad_index(i)
   return typename dealii::internal::DoFHandler::Iterators<DH,lda>::quad_iterator
-    (this->tria,
-     0,  // only sub-objects are allowed, which have no level
-     this->quad_index(i),
-     this->dof_handler);
+         (this->tria,
+          0,  // only sub-objects are allowed, which have no level
+          this->quad_index(i),
+          this->dof_handler);
 }
 
 
@@ -2264,7 +2291,7 @@ template <template <int, int> class DH, int spacedim, bool lda>
 inline
 void
 DoFAccessor<0,DH<1,spacedim>, lda>::get_dof_indices (
-  std::vector<unsigned int> &dof_indices,
+  std::vector<types::global_dof_index> &dof_indices,
   const unsigned int fe_index) const
 {
   for (unsigned int i=0; i<dof_indices.size(); ++i)
@@ -2280,7 +2307,7 @@ DoFAccessor<0,DH<1,spacedim>, lda>::get_dof_indices (
 
 template <template <int, int> class DH, int spacedim, bool lda>
 inline
-unsigned int
+types::global_dof_index
 DoFAccessor<0,DH<1,spacedim>, lda>::
 vertex_dof_index (const unsigned int vertex,
                   const unsigned int i,
@@ -2403,7 +2430,7 @@ namespace internal
                 ->cell_dof_indices_cache.size(),
                 ExcInternalError());
 
-        std::vector<unsigned int>::iterator next
+        std::vector<types::global_dof_index>::iterator next
           = (accessor.dof_handler->levels[accessor.present_level]
              ->cell_dof_indices_cache.begin() + accessor.present_index * dofs_per_cell);
 
@@ -2449,7 +2476,7 @@ namespace internal
                 ->cell_dof_indices_cache.size(),
                 ExcInternalError());
 
-        std::vector<unsigned int>::iterator next
+        std::vector<types::global_dof_index>::iterator next
           = (accessor.dof_handler->levels[accessor.present_level]
              ->cell_dof_indices_cache.begin() + accessor.present_index * dofs_per_cell);
 
@@ -2498,7 +2525,7 @@ namespace internal
                 ->cell_dof_indices_cache.size(),
                 ExcInternalError());
 
-        std::vector<unsigned int>::iterator next
+        std::vector<types::global_dof_index>::iterator next
           = (accessor.dof_handler->levels[accessor.present_level]
              ->cell_dof_indices_cache.begin() + accessor.present_index * dofs_per_cell);
 
@@ -2573,7 +2600,7 @@ namespace internal
       static
       void
       set_dof_indices (DoFCellAccessor<DoFHandler<1,spacedim>, lda> &accessor,
-                       const std::vector<unsigned int>          &local_dof_indices)
+                       const std::vector<types::global_dof_index>          &local_dof_indices)
       {
         Assert (accessor.has_children() == false,
                 ExcInternalError());
@@ -2605,7 +2632,7 @@ namespace internal
       static
       void
       set_dof_indices (DoFCellAccessor<DoFHandler<2,spacedim>, lda> &accessor,
-                       const std::vector<unsigned int>          &local_dof_indices)
+                       const std::vector<types::global_dof_index>          &local_dof_indices)
       {
         Assert (accessor.has_children() == false,
                 ExcInternalError());
@@ -2641,7 +2668,7 @@ namespace internal
       static
       void
       set_dof_indices (DoFCellAccessor<DoFHandler<3,spacedim>, lda> &accessor,
-                       const std::vector<unsigned int>          &local_dof_indices)
+                       const std::vector<types::global_dof_index>          &local_dof_indices)
       {
         Assert (accessor.has_children() == false,
                 ExcInternalError());
@@ -2715,7 +2742,7 @@ namespace internal
       static
       void
       set_dof_indices (const DoFCellAccessor<dealii::hp::DoFHandler<dim,spacedim>, lda> &,
-                       const std::vector<unsigned int> &)
+                       const std::vector<types::global_dof_index> &)
       {
         Assert (false, ExcNotImplemented());
       }
@@ -2734,21 +2761,15 @@ namespace internal
       static
       void
       get_dof_indices (const DoFCellAccessor<DoFHandler<dim,spacedim>, lda> &accessor,
-                       std::vector<unsigned int>                        &dof_indices)
+                       std::vector<types::global_dof_index>                        &dof_indices)
       {
         AssertDimension (dof_indices.size(), accessor.get_fe().dofs_per_cell);
 
-        // check as in documentation that
-        // cell is either active, or dofs
-        // are only in vertices
-        Assert (!accessor.has_children()
-                ||
-                (accessor.get_fe().dofs_per_cell ==
-                 accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
-
-        unsigned int *cache = &accessor.dof_handler->levels[accessor.level()]
-                              ->cell_dof_indices_cache[accessor.present_index * accessor.get_fe().dofs_per_cell];
+        Assert (!accessor.has_children(),
+                ExcMessage ("Cell must be active."));
+
+        types::global_dof_index *cache = &accessor.dof_handler->levels[accessor.level()]
+                                         ->cell_dof_indices_cache[accessor.present_index * accessor.get_fe().dofs_per_cell];
         for (unsigned int i=0; i<accessor.get_fe().dofs_per_cell; ++i, ++cache)
           dof_indices[i] = *cache;
       }
@@ -2764,7 +2785,7 @@ namespace internal
       static
       void
       get_dof_indices (const DoFCellAccessor<dealii::hp::DoFHandler<dim,spacedim>, lda> &accessor,
-                       std::vector<unsigned int>                            &dof_indices)
+                       std::vector<types::global_dof_index>                            &dof_indices)
       {
         // no caching for
         // hp::DoFHandler
@@ -2800,18 +2821,12 @@ namespace internal
         Assert (values.size() == accessor.get_dof_handler().n_dofs(),
                 typename BaseClass::ExcVectorDoesNotMatch());
 
-        // check as in documentation that
-        // cell is either active, or dofs
-        // are only in vertices
-        Assert (!accessor.has_children()
-                ||
-                (accessor.get_fe().dofs_per_cell ==
-                 accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
-
-        unsigned int *cache = &accessor.dof_handler->levels[accessor.level()]
-                              ->cell_dof_indices_cache[accessor.present_index *
-                                                       accessor.get_fe().dofs_per_cell];
+        Assert (!accessor.has_children(),
+                ExcMessage ("Cell must be active."));
+
+        types::global_dof_index *cache = &accessor.dof_handler->levels[accessor.level()]
+                                         ->cell_dof_indices_cache[accessor.present_index *
+                                                                  accessor.get_fe().dofs_per_cell];
         for ( ; local_values_begin != local_values_end; ++local_values_begin, ++cache)
           *local_values_begin = values(*cache);
       }
@@ -2840,7 +2855,7 @@ namespace internal
                 typename BaseClass::ExcVectorDoesNotMatch());
         const unsigned int dofs_per_cell = accessor.get_fe().dofs_per_cell;
 
-        std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+        std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
         get_dof_indices (accessor, local_dof_indices);
 
         for (unsigned int i=0; i<dofs_per_cell; ++i, ++local_values_begin)
@@ -2873,18 +2888,12 @@ namespace internal
         Assert (values.size() == accessor.get_dof_handler().n_dofs(),
                 typename BaseClass::ExcVectorDoesNotMatch());
 
-        // check as in documentation that
-        // cell is either active, or dofs
-        // are only in vertices
-        Assert (!accessor.has_children()
-                ||
-                (accessor.get_fe().dofs_per_cell ==
-                 accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
-
-        unsigned int *cache = &accessor.dof_handler->levels[accessor.level()]
-                              ->cell_dof_indices_cache[accessor.present_index *
-                                                       accessor.get_fe().dofs_per_cell];
+        Assert (!accessor.has_children(),
+                ExcMessage ("Cell must be active."));
+
+        types::global_dof_index *cache = &accessor.dof_handler->levels[accessor.level()]
+                                         ->cell_dof_indices_cache[accessor.present_index *
+                                                                  accessor.get_fe().dofs_per_cell];
         constraints.get_dof_values(values, *cache, local_values_begin,
                                    local_values_end);
       }
@@ -2913,7 +2922,7 @@ namespace internal
                 typename BaseClass::ExcVectorDoesNotMatch());
         const unsigned int dofs_per_cell = accessor.get_fe().dofs_per_cell;
 
-        std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+        std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
         get_dof_indices (accessor, local_dof_indices);
 
         constraints.get_dof_values (values, local_dof_indices.begin(),
@@ -2939,17 +2948,11 @@ namespace internal
         Assert (values.size() == accessor.get_dof_handler().n_dofs(),
                 typename BaseClass::ExcVectorDoesNotMatch());
 
-        // check as in documentation that
-        // cell is either active, or dofs
-        // are only in vertices
-        Assert (!accessor.has_children()
-                ||
-                (accessor.get_fe().dofs_per_cell ==
-                 accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
-
-        unsigned int *cache = &accessor.dof_handler->levels[accessor.level()]
-                              ->cell_dof_indices_cache[accessor.present_index * accessor.get_fe().dofs_per_cell];
+        Assert (!accessor.has_children(),
+                ExcMessage ("Cell must be active."));
+
+        types::global_dof_index *cache = &accessor.dof_handler->levels[accessor.level()]
+                                         ->cell_dof_indices_cache[accessor.present_index * accessor.get_fe().dofs_per_cell];
         for (unsigned int i=0; i<accessor.get_fe().dofs_per_cell; ++i, ++cache)
           values(*cache) = local_values(i);
       }
@@ -2967,7 +2970,7 @@ namespace internal
         // implemented
         const unsigned int dofs_per_cell = accessor.get_fe().dofs_per_cell;
 
-        std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+        std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
         get_dof_indices (accessor, local_dof_indices);
 
         for (unsigned int i=0; i<dofs_per_cell; ++i)
@@ -3073,19 +3076,13 @@ namespace internal
         Assert (accessor.dof_handler->n_dofs() == global_destination.size(),
                 typename BaseClass::ExcVectorDoesNotMatch());
 
-        // check as in documentation that
-        // cell is either active, or dofs
-        // are only in vertices
-        Assert (!accessor.has_children()
-                ||
-                (accessor.get_fe().dofs_per_cell ==
-                 accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+        Assert (!accessor.has_children(),
+                ExcMessage ("Cell must be active"));
 
         const unsigned int n_dofs = local_source_end - local_source_begin;
 
-        unsigned int *dofs = &accessor.dof_handler->levels[accessor.level()]
-                             ->cell_dof_indices_cache[accessor.present_index * n_dofs];
+        types::global_dof_index *dofs = &accessor.dof_handler->levels[accessor.level()]
+                                        ->cell_dof_indices_cache[accessor.present_index * n_dofs];
 
         // distribute cell vector
         global_destination.add(n_dofs, dofs, local_source_begin);
@@ -3116,7 +3113,7 @@ namespace internal
 //TODO[WB/MK]: This function could me made more efficient because it allocates memory, which could be avoided by passing in another argument as a scratch array. This should be fixed eventually
 
         // get indices of dofs
-        std::vector<unsigned int> dofs (n_dofs);
+        std::vector<types::global_dof_index> dofs (n_dofs);
         accessor.get_dof_indices (dofs);
 
         // distribute cell vector
@@ -3144,19 +3141,13 @@ namespace internal
         Assert (accessor.dof_handler->n_dofs() == global_destination.size(),
                 typename BaseClass::ExcVectorDoesNotMatch());
 
-        // check as in documentation that
-        // cell is either active, or dofs
-        // are only in vertices
-        Assert (!accessor.has_children()
-                ||
-                (accessor.get_fe().dofs_per_cell ==
-                 accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+        Assert (!accessor.has_children(),
+                ExcMessage ("Cell must be active."));
 
         const unsigned int n_dofs = local_source_end - local_source_begin;
 
-        unsigned int *dofs = &accessor.dof_handler->levels[accessor.level()]
-                             ->cell_dof_indices_cache[accessor.present_index * n_dofs];
+        types::global_dof_index *dofs = &accessor.dof_handler->levels[accessor.level()]
+                                        ->cell_dof_indices_cache[accessor.present_index * n_dofs];
 
         // distribute cell vector
         constraints.distribute_local_to_global (local_source_begin, local_source_end,
@@ -3189,7 +3180,7 @@ namespace internal
 //TODO[WB/MK]: This function could me made more efficient because it allocates memory, which could be avoided by passing in another argument as a scratch array. This should be fixed eventually
 
         // get indices of dofs
-        std::vector<unsigned int> dofs (n_dofs);
+        std::vector<types::global_dof_index> dofs (n_dofs);
         accessor.get_dof_indices (dofs);
 
         // distribute cell vector
@@ -3220,19 +3211,13 @@ namespace internal
         Assert (accessor.dof_handler->n_dofs() == global_destination.n(),
                 typename BaseClass::ExcMatrixDoesNotMatch());
 
-        // check as in documentation that
-        // cell is either active, or dofs
-        // are only in vertices
-        Assert (!accessor.has_children()
-                ||
-                (accessor.get_fe().dofs_per_cell ==
-                 accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+        Assert (!accessor.has_children(),
+                ExcMessage ("Cell must be active."));
 
         const unsigned int n_dofs = local_source.m();
 
-        unsigned int *dofs = &accessor.dof_handler->levels[accessor.level()]
-                             ->cell_dof_indices_cache[accessor.present_index * n_dofs];
+        types::global_dof_index *dofs = &accessor.dof_handler->levels[accessor.level()]
+                                        ->cell_dof_indices_cache[accessor.present_index * n_dofs];
 
         // distribute cell matrix
         for (unsigned int i=0; i<n_dofs; ++i)
@@ -3268,7 +3253,7 @@ namespace internal
 //TODO[WB/MK]: This function could me made more efficient because it allocates memory, which could be avoided by passing in another argument as a scratch array.
 
         // get indices of dofs
-        std::vector<unsigned int> dofs (n_dofs);
+        std::vector<types::global_dof_index> dofs (n_dofs);
         accessor.get_dof_indices (dofs);
 
         // distribute cell matrix
@@ -3305,18 +3290,12 @@ namespace internal
         Assert (accessor.dof_handler->n_dofs() == global_vector.size(),
                 typename BaseClass::ExcVectorDoesNotMatch());
 
-        // check as in documentation that
-        // cell is either active, or dofs
-        // are only in vertices
-        Assert (!accessor.has_children()
-                ||
-                (accessor.get_fe().dofs_per_cell ==
-                 accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+        Assert (!accessor.has_children(),
+                ExcMessage ("Cell must be active."));
 
         const unsigned int n_dofs = accessor.get_fe().dofs_per_cell;
-        unsigned int *dofs = &accessor.dof_handler->levels[accessor.level()]
-                             ->cell_dof_indices_cache[accessor.present_index *n_dofs];
+        types::global_dof_index *dofs = &accessor.dof_handler->levels[accessor.level()]
+                                        ->cell_dof_indices_cache[accessor.present_index *n_dofs];
 
         // distribute cell matrices
         for (unsigned int i=0; i<n_dofs; ++i)
@@ -3364,7 +3343,7 @@ namespace internal
 //to ConstraintMatrix or MeshWorker::Assembler
 
         // get indices of dofs
-        std::vector<unsigned int> dofs (n_dofs);
+        std::vector<types::global_dof_index> dofs (n_dofs);
         accessor.get_dof_indices (dofs);
 
         // distribute cell matrix and vector
@@ -3484,7 +3463,7 @@ namespace internal
            dealii::TriaAccessor<0, 1, DH::space_dimension>::interior_vertex)),
          cell.vertex_index(i),
          &cell.get_dof_handler());
-      return typename dealii::TriaIterator<dealii::DoFAccessor<DH::dimension-1,DH,lda> > (a);
+      return dealii::TriaIterator<dealii::DoFAccessor<0,DH,lda> > (a);
     }
 
 
@@ -3529,8 +3508,9 @@ DoFCellAccessor<DH,lda>::face (const unsigned int i) const
 template <class DH, bool lda>
 inline
 void
-DoFCellAccessor<DH,lda>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+DoFCellAccessor<DH,lda>::get_dof_indices (std::vector<types::global_dof_index> &dof_indices) const
 {
+  Assert (this->active(), ExcMessage ("get_dof_indices() only works on active cells."));
   Assert (this->is_artificial() == false,
           ExcMessage ("Can't ask for DoF indices on artificial cells."));
   AssertDimension (dof_indices.size(), this->get_fe().dofs_per_cell);
@@ -3541,14 +3521,14 @@ DoFCellAccessor<DH,lda>::get_dof_indices (std::vector<unsigned int> &dof_indices
 
 template<class DH, bool lda>
 inline
-void DoFCellAccessor<DH,lda>::get_mg_dof_indices (std::vector<unsigned int> &dof_indices) const
+void DoFCellAccessor<DH,lda>::get_mg_dof_indices (std::vector<types::global_dof_index> &dof_indices) const
 {
   DoFAccessor<dim, DH,lda>::get_mg_dof_indices (this->level (), dof_indices);
 }
 
 template<class DH, bool lda>
 inline
-void DoFCellAccessor<DH,lda>::set_mg_dof_indices (const std::vector<unsigned int> &dof_indices)
+void DoFCellAccessor<DH,lda>::set_mg_dof_indices (const std::vector<types::global_dof_index> &dof_indices)
 {
   DoFAccessor<dim, DH,lda>::set_mg_dof_indices (this->level (), dof_indices);
 }
@@ -3556,7 +3536,7 @@ void DoFCellAccessor<DH,lda>::set_mg_dof_indices (const std::vector<unsigned int
 
 template<class DH, bool lda>
 inline
-void DoFCellAccessor<DH,lda>::get_active_or_mg_dof_indices (std::vector<unsigned int> &dof_indices) const
+void DoFCellAccessor<DH,lda>::get_active_or_mg_dof_indices (std::vector<types::global_dof_index> &dof_indices) const
 {
   if (lda)
     get_mg_dof_indices (dof_indices);
index a9062e8bf9c36d9b1e2fa79ccc776df3352805fc..5ea64c0faec4d9c265d7fd98f430e3c97fd0a6b6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_faces_h
 #define __deal2__dof_faces_h
 
@@ -42,7 +47,7 @@ namespace internal
      * the hierarchical structure of cells, which are organized in levels. In 2D we store
      * information on degrees of freedom located on lines whereas in 3D we store information on
      * degrees of freedom located on quads and lines. In 1D we do nothing, as the faces of
-     * lines are vertices which are treated seperately.
+     * lines are vertices which are treated separately.
      *
      * Apart from the DoFObjects object containing the data to store (degree of freedom
      * indices) we do not store any data or provide any functionality. However, we do implement
@@ -72,7 +77,7 @@ namespace internal
 
     /**
      * Store the indices of degrees of freedom on faces in 1D. As these would be vertices, which
-     * are treted seperately, don't do anything.
+     * are treted separately, don't do anything.
      *
      * @author Tobias Leicht, 2006
      */
index a69f3d467aafb53a19aac5703b0c3732c2e482b4..9e990e154e8538055504cc79ffae30ce64bd28cf 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_handler_h
 #define __deal2__dof_handler_h
 
@@ -135,7 +140,7 @@ namespace internal
  * respective degree of freedom shall be assigned. This number may, for
  * example, be obtained by sorting the support points of the degrees of
  * freedom in downwind direction.  Then call the
- * <tt>renumber_dofs(vector<unsigned int>)</tt> function with the array, which
+ * <tt>renumber_dofs(vector<types::global_dof_index>)</tt> function with the array, which
  * converts old into new degree of freedom indices.
  *
  *
@@ -232,7 +237,7 @@ public:
    * certain value, but rather take
    * its symbolic name.
    */
-  static const unsigned int invalid_dof_index = numbers::invalid_unsigned_int;
+  static const types::global_dof_index invalid_dof_index = numbers::invalid_dof_index;
 
   /**
    * The default index of the
@@ -425,7 +430,7 @@ public:
    * case that only one processor
    * participates in the mesh.
    */
-  void renumber_dofs (const std::vector<unsigned int> &new_numbers);
+  void renumber_dofs (const std::vector<types::global_dof_index> &new_numbers);
 
   /**
    * The same function as above, but
@@ -433,7 +438,7 @@ public:
    * single level of a multigrid hierarchy.
    */
   void renumber_dofs (const unsigned int level,
-                      const std::vector<unsigned int> &new_numbers);
+                      const std::vector<types::global_dof_index> &new_numbers);
 
   /**
    * Return the maximum number of
@@ -511,8 +516,16 @@ public:
   cell_iterator        begin       (const unsigned int level = 0) const;
 
   /**
-   * Iterator to the first active
-   * cell on level @p level.
+   *  Iterator to the first active cell on level @p level. If the
+   *  given level does not contain any active cells (i.e., all cells
+   *  on this level are further refined, then this function returns
+   *  <code>end_active(level)</code> so that loops of the kind
+   *  @code
+   *    for (cell=dof_handler.begin_active(level); cell!=dof_handler.end_active(level); ++cell)
+   *      ...
+   *  @endcode
+   *  have zero iterations, as may be expected if there are no active
+   *  cells on this level.
    */
   active_cell_iterator begin_active(const unsigned int level = 0) const;
 
@@ -534,10 +547,8 @@ public:
   cell_iterator end (const unsigned int level) const;
 
   /**
-   * Return an active iterator
-   * which is the first iterator
-   * not on level. If @p level is
-   * the last level, then this
+   * Return an active iterator which is the first active iterator not
+   * on the given level. If @p level is the last level, then this
    * returns <tt>end()</tt>.
    */
   active_cell_iterator end_active (const unsigned int level) const;
@@ -603,7 +614,7 @@ public:
    * DoFs which are constrained by
    * hanging nodes, see @ref constraints.
    */
-  unsigned int n_dofs () const;
+  types::global_dof_index n_dofs () const;
 
   /**
    * The (global) number of multilevel
@@ -613,17 +624,17 @@ public:
    * If no level degrees of
    * freedom have been assigned
    * to this level, returns
-   * numbers::invalid_unsigned_int. Else
+   * numbers::invalid_dof_index. Else
    * returns the number of
    * degrees of freedom on this level.
    */
-  unsigned int n_dofs (const unsigned int level) const;
+  types::global_dof_index n_dofs (const unsigned int level) const;
 
   /**
    * Return the number of degrees of freedom
    * located on the boundary.
    */
-  unsigned int n_boundary_dofs () const;
+  types::global_dof_index n_boundary_dofs () const;
 
   /**
    * Return the number of degrees
@@ -638,7 +649,7 @@ public:
    * @p make_boundary_sparsity_pattern
    * function.
    */
-  unsigned int
+  types::global_dof_index
   n_boundary_dofs (const FunctionMap &boundary_indicators) const;
 
   /**
@@ -649,7 +660,7 @@ public:
    * indicators under
    * consideration.
    */
-  unsigned int
+  types::global_dof_index
   n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const;
 
   /**
@@ -779,7 +790,7 @@ public:
    * then the vector has a single
    * element equal to n_dofs().
    */
-  const std::vector<unsigned int> &
+  const std::vector<types::global_dof_index> &
   n_locally_owned_dofs_per_processor () const;
 
   /**
@@ -852,7 +863,7 @@ public:
    * @ingroup Exceptions
    */
   DeclException1 (ExcNewNumbersNotConsecutive,
-                  int,
+                  types::global_dof_index,
                   << "The given list of new dof indices is not consecutive: "
                   << "the index " << arg1 << " does not exist.");
   /**
@@ -891,7 +902,7 @@ protected:
    * degrees of freedom located at
    * vertices.
    */
-  std::vector<unsigned int>      vertex_dofs;
+  std::vector<types::global_dof_index>      vertex_dofs;
 
 
 
@@ -966,23 +977,93 @@ private:
    */
   DoFHandler &operator = (const DoFHandler &);
 
+  /**
+   * A data structure that is used to store the DoF indices associated with
+   * a particular vertex. Unlike cells, vertices live on several levels of
+   * a multigrid hierarchy; consequently, we need to store DoF indices for
+   * each vertex for each of the levels it lives on. This class does
+   * this.
+   */
   class MGVertexDoFs
   {
-  private:
-    unsigned int coarsest_level;
-    unsigned int finest_level;
-    unsigned int *indices;
-    unsigned int *indices_offset;
-
   public:
-    DeclException0 (ExcNoMemory);
+    /**
+     * Constructor.
+     */
     MGVertexDoFs ();
+
+    /**
+     * Destructor.
+     */
     ~MGVertexDoFs ();
+
+    /**
+     * A function that is called to allocate the necessary amount of memory
+     * to store the indices of the DoFs that live on this vertex for the
+     * given (inclusive) range of levels.
+     */
+    void init (const unsigned int coarsest_level,
+               const unsigned int finest_level,
+               const unsigned int dofs_per_vertex);
+
+    /**
+     * Return the coarsest level for which this structure
+     * stores data.
+     */
     unsigned int get_coarsest_level () const;
+
+    /**
+     * Return the finest level for which this structure
+     * stores data.
+     */
     unsigned int get_finest_level () const;
-    unsigned int get_index (const unsigned int level, const unsigned int dof_number) const;
-    void init (const unsigned int coarsest_level, const unsigned int finest_level, const unsigned int dofs_per_vertex);
-    void set_index (const unsigned int level, const unsigned int dof_number, const unsigned int index);
+
+    /**
+     * Return the index of the <code>dof_number</code>th degree of
+     * freedom for the given level stored for the current vertex.
+     */
+    types::global_dof_index
+    get_index (const unsigned int level,
+               const unsigned int dof_number) const;
+
+    /**
+     * Set the index of the <code>dof_number</code>th degree of
+     * freedom for the given level stored for the current vertex
+     * to <code>index</code>.
+     */
+    void set_index (const unsigned int level,
+                    const unsigned int dof_number,
+                    const types::global_dof_index index);
+
+    /**
+     * Exception.
+     */
+    DeclException0 (ExcNoMemory);
+
+  private:
+    /**
+     * Coarsest level for which this object stores DoF indices.
+     */
+    unsigned int coarsest_level;
+
+    /**
+     * Finest level for which this object stores DoF indices.
+     */
+    unsigned int finest_level;
+
+    /**
+     * A pointer to an array where we store the indices of the
+     * DoFs that live on the various levels this vertex exists
+     * on.
+     */
+    types::global_dof_index *indices;
+
+    /**
+     * This array stores, for each level starting with coarsest_level,
+     * the offset in the <code>indices</code> array where the DoF
+     * indices for each level are stored.
+     */
+    types::global_dof_index *indices_offset;
   };
 
   void clear_mg_space ();
@@ -995,10 +1076,10 @@ private:
   void reserve_space ();
 
   template <int structdim>
-  unsigned int get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const;
+  types::global_dof_index get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const;
 
   template<int structdim>
-  void set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index) const;
+  void set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index) const;
 
   /**
    * Space to store the DoF numbers
@@ -1044,13 +1125,13 @@ private:
 
 #ifndef DOXYGEN
 
-template <> unsigned int DoFHandler<1>::n_boundary_dofs () const;
-template <> unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const;
-template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &) const;
+template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs () const;
+template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const;
+template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &) const;
 
-template <> void DoFHandler<1>::renumber_dofs(unsigned int,const std::vector<unsigned int>  &new_numbers);
-template <> void DoFHandler<2>::renumber_dofs(unsigned int,const std::vector<unsigned int>  &new_numbers);
-template <> void DoFHandler<3>::renumber_dofs(unsigned int,const std::vector<unsigned int>  &new_numbers);
+template <> void DoFHandler<1>::renumber_dofs(unsigned int,const std::vector<types::global_dof_index>  &new_numbers);
+template <> void DoFHandler<2>::renumber_dofs(unsigned int,const std::vector<types::global_dof_index>  &new_numbers);
+template <> void DoFHandler<3>::renumber_dofs(unsigned int,const std::vector<types::global_dof_index>  &new_numbers);
 
 
 /* ----------------------- Inline functions ---------------------------------- */
@@ -1074,7 +1155,7 @@ DoFHandler<dim,spacedim>::has_active_dofs() const
 
 template <int dim, int spacedim>
 inline
-unsigned int
+types::global_dof_index
 DoFHandler<dim,spacedim>::n_dofs () const
 {
   return number_cache.n_global_dofs;
@@ -1082,7 +1163,7 @@ DoFHandler<dim,spacedim>::n_dofs () const
 
 template<int dim, int spacedim>
 inline
-unsigned int DoFHandler<dim, spacedim>::n_dofs (const unsigned int level) const
+types::global_dof_index DoFHandler<dim, spacedim>::n_dofs (const unsigned int level) const
 {
   Assert(has_level_dofs(), ExcMessage("n_dofs(level) can only be called after distribute_mg_dofs()"));
   Assert (level < mg_number_cache.size (), ExcInvalidLevel (level));
@@ -1114,7 +1195,7 @@ DoFHandler<dim, spacedim>::locally_owned_mg_dofs(const unsigned int level) const
 }
 
 template <int dim, int spacedim>
-const std::vector<unsigned int> &
+const std::vector<types::global_dof_index> &
 DoFHandler<dim, spacedim>::n_locally_owned_dofs_per_processor() const
 {
   return number_cache.n_locally_owned_dofs_per_processor;
@@ -1231,7 +1312,7 @@ void DoFHandler<dim,spacedim>::load (Archive &ar,
 
 template<int dim, int spacedim>
 inline
-unsigned int DoFHandler<dim, spacedim>::MGVertexDoFs::get_index (
+types::global_dof_index DoFHandler<dim, spacedim>::MGVertexDoFs::get_index (
   const unsigned int level,
   const unsigned int dof_number) const
 {
@@ -1245,7 +1326,7 @@ inline
 void DoFHandler<dim, spacedim>::MGVertexDoFs::set_index (
   const unsigned int level,
   const unsigned int dof_number,
-  const unsigned int index)
+  const types::global_dof_index index)
 {
   Assert ((level >= coarsest_level) && (level <= finest_level), ExcInvalidLevel (level));
   indices[indices_offset[level - coarsest_level] + dof_number] = index;
index fe40bf264c70debe7e5fc0e0994e72f8814f53eb..42eecf8afa2ea9c73299017ccbe98e34b326b301 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_handler_policy_h
 #define __deal2__dof_handler_policy_h
 
@@ -81,7 +86,7 @@ namespace internal
          */
         virtual
         NumberCache
-        renumber_dofs (const std::vector<unsigned int>  &new_numbers,
+        renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
                        dealii::DoFHandler<dim,spacedim> &dof_handler) const = 0;
       };
 
@@ -118,7 +123,7 @@ namespace internal
          */
         virtual
         NumberCache
-        renumber_dofs (const std::vector<unsigned int>  &new_numbers,
+        renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers,
                        dealii::DoFHandler<dim,spacedim> &dof_handler) const;
       };
 
@@ -156,7 +161,7 @@ namespace internal
          */
         virtual
         NumberCache
-        renumber_dofs (const std::vector<unsigned int>  &new_numbers,
+        renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers,
                        dealii::DoFHandler<dim,spacedim> &dof_handler) const;
       };
     }
index 554ead6c85c132d783e6f0e7b2a0c4ff3719a5fb..c87890d2f08466257b5cc4fe204e054fcc8f94d7 100644 (file)
@@ -1,14 +1,19 @@
-//----------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_iterators_h
 #define __deal2__dof_iterators_h
 
index dbd19dc965aa8c75744d3fe33784af258c6bfd3b..a153fa1c7bf002f3a47c31f8fe942d23909b3359 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_levels_h
 #define __deal2__dof_levels_h
 
@@ -77,7 +82,7 @@ namespace internal
        * times
        * selected_fe.dofs_per_cell.
        */
-      std::vector<unsigned int> cell_dof_indices_cache;
+      std::vector<types::global_dof_index> cell_dof_indices_cache;
 
       /**
        * The object containing dof-indices
index 2d0f9d1c8da3f42cb9798372f56b7e51b27285f8..57c6ba5686bc69663b1a782d2504bba02f507306 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_objects_h
 #define __deal2__dof_objects_h
 
@@ -63,7 +68,7 @@ namespace internal
        * Store the global indices of
        * the degrees of freedom.
        */
-      std::vector<unsigned int> dofs;
+      std::vector<types::global_dof_index> dofs;
 
     public:
       /**
@@ -99,7 +104,7 @@ namespace internal
                      const unsigned int       obj_index,
                      const unsigned int       fe_index,
                      const unsigned int       local_index,
-                     const unsigned int       global_index);
+                     const types::global_dof_index       global_index);
 
       /**
        * Return the global index of
@@ -127,7 +132,7 @@ namespace internal
        * and non-hp classes.
        */
       template <int dh_dim, int spacedim>
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::DoFHandler<dh_dim,spacedim> &dof_handler,
                      const unsigned int       obj_index,
                      const unsigned int       fe_index,
@@ -144,7 +149,7 @@ namespace internal
       template <int dh_dim, int spacedim>
       unsigned int
       n_active_fe_indices (const dealii::DoFHandler<dh_dim,spacedim> &dof_handler,
-                           const unsigned int       index) const;
+                           const types::global_dof_index       index) const;
 
       /**
        * Similar to the function
@@ -155,7 +160,7 @@ namespace internal
       template <int dh_dim, int spacedim>
       bool
       fe_index_is_active (const dealii::DoFHandler<dh_dim,spacedim> &dof_handler,
-                          const unsigned int       index,
+                          const types::global_dof_index       index,
                           const unsigned int       fe_index) const;
 
       /**
@@ -192,7 +197,7 @@ namespace internal
     inline
     unsigned int
     DoFObjects<dim>::n_active_fe_indices (const dealii::DoFHandler<dh_dim,spacedim> &,
-                                          const unsigned) const
+                                          const types::global_dof_index) const
     {
       return 1;
     }
@@ -204,7 +209,7 @@ namespace internal
     inline
     bool
     DoFObjects<dim>::fe_index_is_active (const dealii::DoFHandler<dh_dim,spacedim> &,
-                                         const unsigned int,
+                                         const types::global_dof_index,
                                          const unsigned int fe_index) const
     {
       Assert (fe_index == 0,
@@ -218,7 +223,7 @@ namespace internal
     template <int dim>
     template <int dh_dim, int spacedim>
     inline
-    unsigned int
+    types::global_dof_index
     DoFObjects<dim>::
     get_dof_index (const dealii::DoFHandler<dh_dim,spacedim> &dof_handler,
                    const unsigned int       obj_index,
index fce9f3fb95f7304140c8b63b0fde860b81b5baf4..c52ddaafd96cd1a879611273b83a2bf7da8d87ec 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_renumbering_h
 #define __deal2__dof_renumbering_h
 
@@ -167,7 +172,7 @@ DEAL_II_NAMESPACE_OPEN
  * The component_wise() function allows not only to honor enumeration based on
  * vector components, but also allows to group together vector components into
  * "blocks" using a defaulted argument to the various DoFRenumber::component_wise()
- * functinos (see @ref GlossComponent vs @ref GlossBlock for a description of
+ * functions (see @ref GlossComponent vs @ref GlossBlock for a description of
  * the difference). The blocks designated through this argument may, but do not
  * have to be, equal to the blocks that the finite element reports. For example,
  * a typical Stokes element would be
@@ -445,8 +450,8 @@ namespace DoFRenumbering
     /**
      * Return true if c1 less c2.
      */
-    bool operator () (const std::pair<Point<dim>,unsigned int> &c1,
-                      const std::pair<Point<dim>,unsigned int> &c2) const
+    bool operator () (const std::pair<Point<dim>,types::global_dof_index> &c1,
+                      const std::pair<Point<dim>,types::global_dof_index> &c2) const
     {
       const Point<dim> diff = c2.first-c1.first;
       return (diff*dir > 0 || (diff*dir==0 && c1.second<c2.second));
@@ -521,7 +526,7 @@ namespace DoFRenumbering
      */
     template <class DH>
     void
-    compute_Cuthill_McKee (std::vector<unsigned int> &new_dof_indices,
+    compute_Cuthill_McKee (std::vector<types::global_dof_index> &new_dof_indices,
                            const DH &,
                            const bool reversed_numbering = false,
                            const bool use_constraints    = false);
@@ -566,7 +571,7 @@ namespace DoFRenumbering
      */
     template <class DH>
     void
-    compute_king_ordering (std::vector<unsigned int> &new_dof_indices,
+    compute_king_ordering (std::vector<types::global_dof_index> &new_dof_indices,
                            const DH &,
                            const bool reversed_numbering = false,
                            const bool use_constraints    = false);
@@ -612,7 +617,7 @@ namespace DoFRenumbering
      */
     template <class DH>
     void
-    compute_minimum_degree (std::vector<unsigned int> &new_dof_indices,
+    compute_minimum_degree (std::vector<types::global_dof_index> &new_dof_indices,
                             const DH &,
                             const bool reversed_numbering = false,
                             const bool use_constraints    = false);
@@ -641,7 +646,7 @@ namespace DoFRenumbering
   Cuthill_McKee (DH                              &dof_handler,
                  const bool                       reversed_numbering = false,
                  const bool                       use_constraints    = false,
-                 const std::vector<unsigned int> &starting_indices   = std::vector<unsigned int>());
+                 const std::vector<types::global_dof_index> &starting_indices   = std::vector<types::global_dof_index>());
 
   /**
    * Computes the renumbering
@@ -654,11 +659,11 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_Cuthill_McKee (std::vector<unsigned int> &new_dof_indices,
+  compute_Cuthill_McKee (std::vector<types::global_dof_index> &new_dof_indices,
                          const DH &,
                          const bool reversed_numbering = false,
                          const bool use_constraints    = false,
-                         const std::vector<unsigned int> &starting_indices   = std::vector<unsigned int>());
+                         const std::vector<types::global_dof_index> &starting_indices   = std::vector<types::global_dof_index>());
 
   /**
    * Renumber the degrees of
@@ -688,7 +693,7 @@ namespace DoFRenumbering
   Cuthill_McKee (DH &dof_handler,
                  const unsigned int          level,
                  const bool                  reversed_numbering = false,
-                 const std::vector<unsigned int> &starting_indices   = std::vector<unsigned int> ());
+                 const std::vector<types::global_dof_index> &starting_indices   = std::vector<types::global_dof_index> ());
 
   /**
    * @name Component-wise numberings
@@ -817,11 +822,12 @@ namespace DoFRenumbering
    * the renumbering vector.
    */
   template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
-  unsigned int
-  compute_component_wise (std::vector<unsigned int> &new_dof_indices,
+  types::global_dof_index
+  compute_component_wise (std::vector<types::global_dof_index> &new_dof_indices,
                           const ITERATOR &start,
                           const ENDITERATOR &end,
-                          const std::vector<unsigned int> &target_component);
+                          const std::vector<unsigned int> &target_component,
+                          bool is_level_operation);
 
   /**
    * @}
@@ -919,8 +925,8 @@ namespace DoFRenumbering
    * the renumbering vector.
    */
   template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
-  unsigned int
-  compute_block_wise (std::vector<unsigned int> &new_dof_indices,
+  types::global_dof_index
+  compute_block_wise (std::vector<types::global_dof_index> &new_dof_indices,
                       const ITERATOR &start,
                       const ENDITERATOR &end);
 
@@ -972,8 +978,8 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_cell_wise (std::vector<unsigned int> &renumbering,
-                     std::vector<unsigned int> &inverse_renumbering,
+  compute_cell_wise (std::vector<types::global_dof_index> &renumbering,
+                     std::vector<types::global_dof_index> &inverse_renumbering,
                      const DH &dof_handler,
                      const std::vector<typename DH::active_cell_iterator> &cell_order);
 
@@ -999,8 +1005,8 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_cell_wise (std::vector<unsigned int> &renumbering,
-                     std::vector<unsigned int> &inverse_renumbering,
+  compute_cell_wise (std::vector<types::global_dof_index> &renumbering,
+                     std::vector<types::global_dof_index> &inverse_renumbering,
                      const DH   &dof_handler,
                      const unsigned int         level,
                      const std::vector<typename DH::level_cell_iterator> &cell_order);
@@ -1138,8 +1144,8 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_downstream (std::vector<unsigned int> &new_dof_indices,
-                      std::vector<unsigned int> &reverse,
+  compute_downstream (std::vector<types::global_dof_index> &new_dof_indices,
+                      std::vector<types::global_dof_index> &reverse,
                       const DH                  &dof_handler,
                       const Point<DH::space_dimension>          &direction,
                       const bool                 dof_wise_renumbering);
@@ -1155,8 +1161,8 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_downstream (std::vector<unsigned int> &new_dof_indices,
-                      std::vector<unsigned int> &reverse,
+  compute_downstream (std::vector<types::global_dof_index> &new_dof_indices,
+                      std::vector<types::global_dof_index> &reverse,
                       const DH &dof_handler,
                       const unsigned int         level,
                       const Point<DH::space_dimension>          &direction,
@@ -1205,7 +1211,7 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_clockwise_dg (std::vector<unsigned int> &new_dof_indices,
+  compute_clockwise_dg (std::vector<types::global_dof_index> &new_dof_indices,
                         const DH                  &dof_handler,
                         const Point<DH::space_dimension>          &center,
                         const bool                 counter);
@@ -1274,7 +1280,7 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_sort_selected_dofs_back (std::vector<unsigned int> &new_dof_indices,
+  compute_sort_selected_dofs_back (std::vector<types::global_dof_index> &new_dof_indices,
                                    const DH                  &dof_handler,
                                    const std::vector<bool>   &selected_dofs);
 
@@ -1295,7 +1301,7 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_sort_selected_dofs_back (std::vector<unsigned int> &new_dof_indices,
+  compute_sort_selected_dofs_back (std::vector<types::global_dof_index> &new_dof_indices,
                                    const DH                  &dof_handler,
                                    const std::vector<bool>   &selected_dofs,
                                    const unsigned int         level);
@@ -1318,7 +1324,7 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_random (std::vector<unsigned int> &new_dof_indices,
+  compute_random (std::vector<types::global_dof_index> &new_dof_indices,
                   const DH &dof_handler);
 
   /**
@@ -1380,7 +1386,7 @@ namespace DoFRenumbering
    */
   template <class DH>
   void
-  compute_subdomain_wise (std::vector<unsigned int> &new_dof_indices,
+  compute_subdomain_wise (std::vector<types::global_dof_index> &new_dof_indices,
                           const DH                  &dof_handler);
 
   /**
index dc30e7863a47378cbec2fa22eb3f2b828c037e97..b7e1d21a7c915351458a908203d977cab8d9d413 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_tools_h
 #define __deal2__dof_tools_h
 
@@ -738,7 +743,7 @@ namespace DoFTools
   template <class DH, class SparsityPattern>
   void
   make_boundary_sparsity_pattern (const DH                        &dof,
-                                  const std::vector<unsigned int> &dof_to_boundary_mapping,
+                                  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                   SparsityPattern                 &sparsity_pattern);
 
   /**
@@ -775,7 +780,7 @@ namespace DoFTools
   void
   make_boundary_sparsity_pattern (const DH &dof,
                                   const typename FunctionMap<DH::space_dimension>::type &boundary_indicators,
-                                  const std::vector<unsigned int> &dof_to_boundary_mapping,
+                                  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                   SparsityPattern    &sparsity);
 
   /**
@@ -1384,7 +1389,7 @@ namespace DoFTools
 
   /**
    * Do the same thing as the corresponding
-   * extract_dofs() functino for one level
+   * extract_dofs() function for one level
    * of a multi-grid DoF numbering.
    */
   template <class DH>
@@ -1396,7 +1401,7 @@ namespace DoFTools
 
   /**
    * Do the same thing as the corresponding
-   * extract_dofs() functino for one level
+   * extract_dofs() function for one level
    * of a multi-grid DoF numbering.
    */
   template <class DH>
@@ -1915,7 +1920,7 @@ namespace DoFTools
                          const DH &dof_handler,
                          const unsigned int level,
                          const std::vector<bool> &selected_dofs = std::vector<bool>(),
-                         unsigned int offset = 0);
+                         types::global_dof_index offset = 0);
 
   /**
    * Create an incidence matrix that
@@ -2253,7 +2258,7 @@ namespace DoFTools
   template <class DH>
   void
   count_dofs_per_component (const DH      &dof_handler,
-                            std::vector<unsigned int> &dofs_per_component,
+                            std::vector<types::global_dof_index> &dofs_per_component,
                             const bool vector_valued_once = false,
                             std::vector<unsigned int>  target_component
                             = std::vector<unsigned int>());
@@ -2292,7 +2297,7 @@ namespace DoFTools
   template <class DH>
   void
   count_dofs_per_block (const DH &dof,
-                        std::vector<unsigned int> &dofs_per_block,
+                        std::vector<types::global_dof_index> &dofs_per_block,
                         const std::vector<unsigned int>  &target_block
                         = std::vector<unsigned int>());
 
@@ -2307,7 +2312,7 @@ namespace DoFTools
   template <int dim, int spacedim>
   void
   count_dofs_per_component (const DoFHandler<dim,spacedim>     &dof_handler,
-                            std::vector<unsigned int> &dofs_per_component,
+                            std::vector<types::global_dof_index> &dofs_per_component,
                             std::vector<unsigned int>  target_component) DEAL_II_DEPRECATED;
 
   /**
@@ -2564,7 +2569,7 @@ namespace DoFTools
                                              const DoFHandler<dim,spacedim>              &fine_grid,
                                              const unsigned int                  fine_component,
                                              const InterGridMap<DoFHandler<dim,spacedim> > &coarse_to_fine_grid_map,
-                                             std::vector<std::map<unsigned int, float> > &transfer_representation);
+                                             std::vector<std::map<types::global_dof_index, float> > &transfer_representation);
 
   /**
    * Create a mapping from degree
@@ -2596,7 +2601,7 @@ namespace DoFTools
   template <class DH>
   void
   map_dof_to_boundary_indices (const DH                   &dof_handler,
-                               std::vector<unsigned int>  &mapping);
+                               std::vector<types::global_dof_index>  &mapping);
 
   /**
    * Same as the previous function,
@@ -2615,7 +2620,7 @@ namespace DoFTools
   void
   map_dof_to_boundary_indices (const DH                      &dof_handler,
                                const std::set<types::boundary_id> &boundary_indicators,
-                               std::vector<unsigned int>     &mapping);
+                               std::vector<types::global_dof_index>     &mapping);
 
   /**
    * Return a list of support
@@ -2693,7 +2698,7 @@ namespace DoFTools
   void
   map_dofs_to_support_points (const Mapping<dim,spacedim>       &mapping,
                               const DoFHandler<dim,spacedim>    &dof_handler,
-                              std::map<unsigned int, Point<spacedim> >     &support_points);
+                              std::map<types::global_dof_index, Point<spacedim> >     &support_points);
 
   /**
    * Same as the previous function but for the hp case.
@@ -2702,7 +2707,7 @@ namespace DoFTools
   void
   map_dofs_to_support_points (const dealii::hp::MappingCollection<dim,spacedim>   &mapping,
                               const hp::DoFHandler<dim,spacedim>    &dof_handler,
-                              std::map<unsigned int, Point<spacedim> > &support_points);
+                              std::map<types::global_dof_index, Point<spacedim> > &support_points);
 
 
   /**
@@ -2738,7 +2743,7 @@ namespace DoFTools
   void
   map_support_points_to_dofs (const Mapping<DH::dimension, DH::space_dimension> &mapping,
                               const DH                                          &dof_handler,
-                              std::map<Point<DH::space_dimension>, unsigned int, Comp> &point_to_index_map);
+                              std::map<Point<DH::space_dimension>, types::global_dof_index, Comp> &point_to_index_map);
 
   /**
    * Map a coupling table from the
@@ -3069,7 +3074,7 @@ namespace DoFTools
   map_support_points_to_dofs (
     const Mapping<DH::dimension,DH::space_dimension>         &mapping,
     const DH                                                 &dof_handler,
-    std::map<Point<DH::space_dimension>, unsigned int, Comp> &point_to_index_map)
+    std::map<Point<DH::space_dimension>, types::global_dof_index, Comp> &point_to_index_map)
   {
     // let the checking of arguments be
     // done by the function first
@@ -3080,7 +3085,7 @@ namespace DoFTools
     // previous function into the
     // output arg
     point_to_index_map.clear ();
-    for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+    for (types::global_dof_index i=0; i<dof_handler.n_dofs(); ++i)
       point_to_index_map[support_points[i]] = i;
   }
 }
index 9be53de26fadbed1a88ae2ec1bc4a78432d01ddd..f5f8d7fcabce28fe9ac65ffbdf77fe2bd67b0285 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__function_map_h
 #define __deal2__function_map_h
 
index d9ba3850823234da246a31aff8d94104345e40df..223030d453eea6615305192b9ee4074cfcd39f27 100644 (file)
@@ -1,14 +1,19 @@
-//----------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__number_cache_h
 #define __deal2__number_cache_h
 
@@ -55,7 +60,7 @@ namespace internal
        * processors that may
        * participate on this mesh.
        */
-      unsigned int n_global_dofs;
+      types::global_dof_index n_global_dofs;
 
       /**
        * Number of dofs owned by
@@ -64,7 +69,7 @@ namespace internal
        * computation, then this
        * equals n_global_dofs.
        */
-      unsigned int n_locally_owned_dofs;
+      types::global_dof_index n_locally_owned_dofs;
 
       /**
        * An index set denoting the
@@ -86,7 +91,7 @@ namespace internal
        * element equal to
        * n_global_dofs.
        */
-      std::vector<unsigned int> n_locally_owned_dofs_per_processor;
+      std::vector<types::global_dof_index> n_locally_owned_dofs_per_processor;
 
       /**
        * The dofs owned by each of
index e9616258d6e65e6dc02414346fcc6492339bc15b..6a5da60d2890a27fcc1039447027069560b02730 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_block_mask_h
 #define __deal2__fe_block_mask_h
 
index 9512abe54fb9d3f27c6829583724a0e002067020..0661aa2c63794beae4605e836bab3c17134c3879 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_component_mask_h
 #define __deal2__fe_component_mask_h
 
index fbf458b9fe2a2bb2800e012544c6e5cf126f7fd7..8d52d8c9430f9e71f34c2f8b440089696beecfd8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_h
 #define __deal2__fe_h
 
@@ -1060,7 +1065,7 @@ public:
    * Given a base element number, return the first block of a BlockVector it
    * would generate.
    */
-  unsigned int first_block_of_base (const unsigned int b) const;
+  types::global_dof_index first_block_of_base (const unsigned int b) const;
 
   /**
    * For each vector component, return which base element implements this
@@ -1088,7 +1093,7 @@ public:
   /**
    * The vector block and the index inside the block for this shape function.
    */
-  std::pair<unsigned int,unsigned int>
+  std::pair<unsigned int,types::global_dof_index>
   system_to_block_index (const unsigned int component) const;
 
   /**
@@ -1986,7 +1991,7 @@ inline
 unsigned int
 FiniteElement<dim,spacedim>::element_multiplicity (const unsigned int index) const
 {
-  return base_to_block_indices.block_size(index);
+  return static_cast<unsigned int>(base_to_block_indices.block_size(index));
 }
 
 
@@ -2063,7 +2068,7 @@ FiniteElement<dim,spacedim>::face_system_to_base_index (const unsigned int index
 
 template <int dim, int spacedim>
 inline
-unsigned int
+types::global_dof_index
 FiniteElement<dim,spacedim>::first_block_of_base (const unsigned int index) const
 {
   return base_to_block_indices.block_start(index);
@@ -2096,7 +2101,7 @@ FiniteElement<dim,spacedim>::block_to_base_index (const unsigned int index) cons
 
 template <int dim, int spacedim>
 inline
-std::pair<unsigned int,unsigned int>
+std::pair<unsigned int,types::global_dof_index>
 FiniteElement<dim,spacedim>::system_to_block_index (const unsigned int index) const
 {
   Assert (index < this->dofs_per_cell,
@@ -2104,7 +2109,7 @@ FiniteElement<dim,spacedim>::system_to_block_index (const unsigned int index) co
   // The block is computed simply as
   // first block of this base plus
   // the index within the base blocks
-  return std::pair<unsigned int, unsigned int>(
+  return std::pair<unsigned int, types::global_dof_index>(
            first_block_of_base(system_to_base_table[index].first.first)
            + system_to_base_table[index].first.second,
            system_to_base_table[index].second);
index 53409be33c0c2211a9ebf8df0a888980e7ca94a1..1a50681b304493b41f15534b2c531bb8f380f205 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_abf_h
 #define __deal2__fe_abf_h
 
index ddd8e1565d4ed2874d6a9b0ef497e6b15e8aff12..f7e0de1021eb3e81f392a7ded73d40d797304bbe 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_base_h
 #define __deal2__fe_base_h
 
index 41c35743f3f6a8defc16c4dc26a455258f13bca6..c3e1d675b5425e51e7e6889b6dc1d8a804eb5db5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_bdm_h
 #define __deal2__fe_bdm_h
 
index c85d98153f605c9ba70687489ad141c71a6a0d20..061669414872478676eadc7bac349510287a97a3 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_dg_vector_h
 #define __deal2__fe_dg_vector_h
 
index 3ad5f4d89ac08a9742757ed2d52b4453f7491d89..8639be4cdbae13db444e67544cdcbf958f4defa0 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/fe_dg_vector.h>
 #include <deal.II/fe/fe_tools.h>
index 7b3bcdbbc1b8f8e2272df5d77271c3b159c6b911..7ea266a45eac46623fd4c30db5efb23a68deb0fa 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_dgp_h
 #define __deal2__fe_dgp_h
 
index 53d833400647ddd5763875171cbf862e27ae77f0..f6a585c3343a396edaae7edaa06d5340e509c01f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_dgp_monomial_h
 #define __deal2__fe_dgp_monomial_h
 
index 87a68a53e8cb86ef330450e7ba62fc5b03f9c1d9..46c5e740e5c6bd3c771b0c02284a25a37a03a351 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_dgp_nonparametric_h
 #define __deal2__fe_dgp_nonparametric_h
 
index f1109184c8caf26609204516e044130bf4714568..a07cf4f32d9b43823d8bdc9ed1db08b6619330b6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_dgq_h
 #define __deal2__fe_dgq_h
 
index 4fdddd2e07973760f7d5c05703d4f507346b9d30..a091042adb7f7747f367d951ecec237756d8b567 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_face_h
 #define __deal2__fe_face_h
 
index a66df95cfa9bd1caabcdb2284b63e76ede969cac..4a8fe4824b900cf98a62b030f435a1aeaa145fa4 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_nedelec_h
 #define __deal2__fe_nedelec_h
 
index 9ed2d3ca9f568215fe6c7488ae2fd80a172107a0..785b443bf50d01d95e4e549e95ea6130b4f26d29 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_nothing_h
 #define __deal2__fe_nothing_h
 
index 1ff09925136fc075ea241c4ca0786f3ab054122c..0cee69105cf895337f72c8f8a433a90b8bfbe3da 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_poly_h
 #define __deal2__fe_poly_h
 
index f5ba25953ec8cd36e38f8cfe28a1be00add2b063..bfcc19d3acb74793da4d22c01b232b9549e22901 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/qprojector.h>
 #include <deal.II/base/polynomial_space.h>
index 10ccec681bc237e16bef4c10df78b4eff9bac0e5..b4e57deca08ef3c44f03eae1a0831fc2440f9a5a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_poly_face_h
 #define __deal2__fe_poly_face_h
 
index 513213aeed0be8ff035a3403825a5aa21e22928a..39651c017005e086f248228dced633713b7f20df 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/qprojector.h>
 #include <deal.II/base/polynomial_space.h>
index d39b40736717b60ebe67161cd39018471b30af47..6d32646bda3c4675b045d9bca4c05f1f34066eb0 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_poly_tensor_h
 #define __deal2__fe_poly_tensor_h
 
index 294daad45995b5b593f6fb3978415af49af71f6e..74ba683ec7f12f65783ad0fb9502c6071a2f350f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_q_h
 #define __deal2__fe_q_h
 
index e3fe259c17bf4b36950ab408dae64956bf4c555f..6f17bd38a4dfadf800549ffdd5c7c8a175aa0a87 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_q_base_h
 #define __deal2__fe_q_base_h
 
index d01c6b22c8f7c77d41acc8bcdc473fa48f39b70b..6f0f339e01fc1d9a6fb7eecc666c831fdda63bf0 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id: fe_q.h 29043 2013-03-26 19:51:19Z bangerth $
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012, 2013 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__fe_q_dg0_h
 #define __deal2__fe_q_dg0_h
index e53f5dab32585fca5396b42575fbc44434d093c0..bed960dcc24bd2b0d308527f7db9d541b2f39f05 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_q_hierarchical_h
 #define __deal2__fe_q_hierarchical_h
 
index 7f4c5cc620889333c9c48e4c49d253d469d8bf4c..965aa7ca3098c29d0f186cdcbbe11c4e1f816261 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_q_iso_q1_h
 #define __deal2__fe_q_iso_q1_h
 
index 3303b6b7bf785a24f8aca3e8e8d1ed9ebc309b3d..0831bf5c2c3f723aebf2bf5ba79ed277687ac578 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_raviart_thomas_h
 #define __deal2__fe_raviart_thomas_h
 
index 650dbc5a43599b726f8a45385115af4939052c98..96a0d2dfbd80c2ad86d849a83b1ed751e273307d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_system_h
 #define __deal2__fe_system_h
 
index fe54359e3dcf433fe76251dc189637ca2d8fabba..0722155e82e676afb864ab8112e2cc806edbcdea 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_tools_H
 #define __deal2__fe_tools_H
 
@@ -160,8 +165,8 @@ namespace FETools
   template<int dim, int spacedim>
   void compute_block_renumbering (
     const FiniteElement<dim,spacedim>  &fe,
-    std::vector<unsigned int> &renumbering,
-    std::vector<unsigned int> &block_data,
+    std::vector<types::global_dof_index> &renumbering,
+    std::vector<types::global_dof_index> &block_data,
     bool return_start_indices = true);
 
   /**
@@ -259,7 +264,7 @@ namespace FETools
    * For all possible (isotropic and anisotropic) refinement cases compute the
    * embedding matrices from a coarse cell to the child cells. Each column of
    * the resulting matrices contains the representation of a coarse grid basis
-   * functon by the fine grid basis; the matrices are split such that there is
+   * function by the fine grid basis; the matrices are split such that there is
    * one matrix for every child.
    *
    * This function computes the coarse grid function in a sufficiently large
index b604931fdbe32167d251ad4d3ed42dd4709c289d..922f1679604bf8be35f405fe014c82121998d44e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_update_flags_h
 #define __deal2__fe_update_flags_h
 
index 4758c761c02cae3bed651235c69ac5294bbbff23..1b0164b6564afc4dc4b7bf2288c0c51f11fd817f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_values_h
 #define __deal2__fe_values_h
 
@@ -166,7 +171,7 @@ namespace FEValuesViews
      * gradient is a
      * <code>Tensor@<1,dim@></code>.
      */
-    typedef Tensor<1,spacedim> gradient_type;
+    typedef dealii::Tensor<1,spacedim> gradient_type;
 
     /**
      * A typedef for the type of second
@@ -176,7 +181,7 @@ namespace FEValuesViews
      * Hessian is a
      * <code>Tensor@<2,dim@></code>.
      */
-    typedef Tensor<2,spacedim> hessian_type;
+    typedef dealii::Tensor<2,spacedim> hessian_type;
 
     /**
      * A structure where for each shape
@@ -453,7 +458,7 @@ namespace FEValuesViews
      * of <code>dim</code> components, the
      * value type is a Tensor<1,spacedim>.
      */
-    typedef Tensor<1,spacedim>          value_type;
+    typedef dealii::Tensor<1,spacedim>          value_type;
 
     /**
      * A typedef for the type of gradients
@@ -463,7 +468,7 @@ namespace FEValuesViews
      * finite element, the gradient is a
      * <code>Tensor@<2,spacedim@></code>.
      */
-    typedef Tensor<2,spacedim>          gradient_type;
+    typedef dealii::Tensor<2,spacedim>          gradient_type;
 
     /**
      * A typedef for the type of
@@ -512,7 +517,7 @@ namespace FEValuesViews
      * finite element, the Hessian is a
      * <code>Tensor@<3,dim@></code>.
      */
-    typedef Tensor<3,spacedim>          hessian_type;
+    typedef dealii::Tensor<3,spacedim>          hessian_type;
 
     /**
      * A structure where for each shape
@@ -985,7 +990,7 @@ namespace FEValuesViews
      * definition of the
      * divergence.
      */
-    typedef Tensor<1, spacedim> divergence_type;
+    typedef dealii::Tensor<1, spacedim> divergence_type;
 
     /**
      * A structure where for each shape
@@ -1198,6 +1203,270 @@ namespace FEValuesViews
      */
     std::vector<ShapeFunctionData> shape_function_data;
   };
+
+
+  template <int rank, int dim, int spacedim = dim>
+  class Tensor;
+
+  /**
+   * A class representing a view to a set of
+   * <code>dim*dim</code> components forming a
+   * second-order tensor from a
+   * vector-valued finite
+   * element. Views are discussed in the
+   * @ref vector_valued module.
+   *
+   * This class allows to query the
+   * value and divergence of
+   * (components of) shape functions
+   * and solutions representing
+   * tensors. The
+   * divergence of a tensor
+   * $T_{ij}, 0\le i,j<\text{dim}$ is
+   * defined as
+   * $d_i = \sum_j \frac{\partial T_{ji}}{\partial x_j},
+   * 0\le i<\text{dim}$.
+   *
+   * You get an object of this type if you
+   * apply a
+   * FEValuesExtractors::Tensor to
+   * an FEValues, FEFaceValues or
+   * FESubfaceValues object.
+   *
+   * @ingroup feaccess vector_valued
+   *
+   * @author Denis Davydov, 2013
+   */
+  template <int dim, int spacedim>
+  class Tensor<2,dim,spacedim>
+  {
+  public:
+
+    /**
+     * Data type for what you get when you apply an extractor
+     * of this kind to a vector-valued finite element.
+     */
+    typedef dealii::Tensor<2, spacedim> value_type;
+
+    /**
+     * Data type for taking the divergence of a tensor: a vector.
+     */
+    typedef dealii::Tensor<1, spacedim> divergence_type;
+
+    /**
+     * A structure where for each shape
+     * function we pre-compute a bunch of
+     * data that will make later accesses
+     * much cheaper.
+     */
+    struct ShapeFunctionData
+    {
+      /**
+       * For each pair (shape
+       * function,component within
+       * vector), store whether the
+       * selected vector component may be
+       * nonzero. For primitive shape
+       * functions we know for sure
+       * whether a certain scalar
+       * component of a given shape
+       * function is nonzero, whereas for
+       * non-primitive shape functions
+       * this may not be entirely clear
+       * (e.g. for RT elements it depends
+       * on the shape of a cell).
+       */
+      bool is_nonzero_shape_function_component[value_type::n_independent_components];
+
+      /**
+       * For each pair (shape function,
+       * component within vector), store
+       * the row index within the
+       * shape_values, shape_gradients,
+       * and shape_hessians tables (the
+       * column index is the quadrature
+       * point index). If the shape
+       * function is primitive, then we
+       * can get this information from
+       * the shape_function_to_row_table
+       * of the FEValues object;
+       * otherwise, we have to work a bit
+       * harder to compute this
+       * information.
+       */
+      unsigned int row_index[value_type::n_independent_components];
+
+      /**
+       * For each shape function say the
+       * following: if only a single
+       * entry in
+       * is_nonzero_shape_function_component
+       * for this shape function is
+       * nonzero, then store the
+       * corresponding value of row_index
+       * and
+       * single_nonzero_component_index
+       * represents the index between 0
+       * and (dim^2) for which it is
+       * attained. If multiple components
+       * are nonzero, then store -1. If
+       * no components are nonzero then
+       * store -2.
+       */
+      int single_nonzero_component;
+      unsigned int single_nonzero_component_index;
+    };
+
+    /**
+     * Default constructor. Creates an
+     * invalid object.
+     */
+    Tensor();
+
+
+    /**
+     * Constructor for an object that
+     * represents <code>(dim*dim)</code>
+     * components of a
+     * FEValuesBase object (or of one of
+     * the classes derived from
+     * FEValuesBase), representing the unique
+     * components comprising a second-order
+     * tensor valued variable.
+     *
+     * The second argument denotes the
+     * index of the first component of the
+     * selected symmetric second order tensor.
+     */
+    Tensor(const FEValuesBase<dim, spacedim> &fe_values_base,
+           const unsigned int first_tensor_component);
+
+
+    /**
+     * Copy operator. This is not a
+     * lightweight object so we don't allow
+     * copying and generate an exception if
+     * this function is called.
+     */
+    Tensor &operator=(const Tensor<2, dim, spacedim> &);
+
+    /**
+     * Return the value of the vector
+     * components selected by this view,
+     * for the shape function and
+     * quadrature point selected by the
+     * arguments. Here, since the view
+     * represents a vector-valued part of
+     * the FEValues object with
+     * <code>(dim*dim)</code> components
+     * (the unique components of a second-order tensor),
+     * the return type is a tensor of rank 2.
+     *
+     * @param shape_function Number
+     * of the shape function to be
+     * evaluated. Note that this
+     * number runs from zero to
+     * dofs_per_cell, even in the
+     * case of an FEFaceValues or
+     * FESubfaceValues object.
+     *
+     * @param q_point Number of
+     * the quadrature point at which
+     * function is to be evaluated
+     */
+    value_type
+    value (const unsigned int shape_function,
+           const unsigned int q_point) const;
+
+    /**
+     * Return the vector divergence of
+     * the vector components selected by
+     * this view, for the shape function
+     * and quadrature point selected by the
+     * arguments.
+     *
+     * See the general discussion
+     * of this class for a
+     * definition of the
+     * divergence.
+     *
+     * @note The meaning of the arguments
+     * is as documented for the value()
+     * function.
+     */
+    divergence_type
+    divergence (const unsigned int shape_function,
+                const unsigned int q_point) const;
+
+    /**
+     * Return the values of the selected
+     * vector components of the finite
+     * element function characterized by
+     * <tt>fe_function</tt> at the
+     * quadrature points of the cell, face
+     * or subface selected the last time
+     * the <tt>reinit</tt> function of the
+     * FEValues object was called.
+     *
+     * This function is the equivalent of
+     * the
+     * FEValuesBase::get_function_values
+     * function but it only works on the
+     * selected vector components.
+     */
+    template <class InputVector>
+    void get_function_values (const InputVector &fe_function,
+                              std::vector<value_type> &values) const;
+
+
+    /**
+     * Return the divergence of the selected
+     * vector components of the finite
+     * element function characterized by
+     * <tt>fe_function</tt> at the
+     * quadrature points of the cell, face
+     * or subface selected the last time
+     * the <tt>reinit</tt> function of the
+     * FEValues object was called.
+     *
+     * There is no equivalent function such
+     * as
+     * FEValuesBase::get_function_divergences
+     * in the FEValues classes but the
+     * information can be obtained from
+     * FEValuesBase::get_function_gradients,
+     * of course.
+     *
+     * See the general discussion
+     * of this class for a
+     * definition of the
+     * divergence.
+     */
+    template <class InputVector>
+    void get_function_divergences (const InputVector &fe_function,
+                                   std::vector<divergence_type> &divergences) const;
+
+  private:
+    /**
+     * A reference to the FEValuesBase object
+     * we operate on.
+     */
+    const FEValuesBase<dim, spacedim> &fe_values;
+
+    /**
+     * The first component of the vector
+     * this view represents of the
+     * FEValuesBase object.
+     */
+    const unsigned int first_tensor_component;
+
+    /**
+     * Store the data about shape
+     * functions.
+     */
+    std::vector<ShapeFunctionData> shape_function_data;
+  };
+
 }
 
 
@@ -1229,6 +1498,8 @@ namespace internal
       std::vector<dealii::FEValuesViews::Vector<dim,spacedim> > vectors;
       std::vector<dealii::FEValuesViews::SymmetricTensor<2,dim,spacedim> >
       symmetric_second_order_tensors;
+      std::vector<dealii::FEValuesViews::Tensor<2,dim,spacedim> >
+      second_order_tensors;
 
       /**
        * Constructor.
@@ -2033,7 +2304,7 @@ public:
    */
   template <class InputVector, typename number>
   void get_function_values (const InputVector &fe_function,
-                            const VectorSlice<const std::vector<unsigned int> > &indices,
+                            const VectorSlice<const std::vector<types::global_dof_index> > &indices,
                             std::vector<number> &values) const;
 
   /**
@@ -2076,7 +2347,7 @@ public:
    */
   template <class InputVector, typename number>
   void get_function_values (const InputVector &fe_function,
-                            const VectorSlice<const std::vector<unsigned int> > &indices,
+                            const VectorSlice<const std::vector<types::global_dof_index> > &indices,
                             std::vector<Vector<number> > &values) const;
 
 
@@ -2140,7 +2411,7 @@ public:
    */
   template <class InputVector>
   void get_function_values (const InputVector &fe_function,
-                            const VectorSlice<const std::vector<unsigned int> > &indices,
+                            const VectorSlice<const std::vector<types::global_dof_index> > &indices,
                             VectorSlice<std::vector<std::vector<double> > > values,
                             const bool quadrature_points_fastest) const;
 
@@ -2264,7 +2535,7 @@ public:
    */
   template <class InputVector>
   void get_function_gradients (const InputVector &fe_function,
-                               const VectorSlice<const std::vector<unsigned int> > &indices,
+                               const VectorSlice<const std::vector<types::global_dof_index> > &indices,
                                std::vector<Tensor<1,spacedim> > &gradients) const;
 
   /**
@@ -2275,7 +2546,7 @@ public:
    */
   template <class InputVector>
   void get_function_gradients (const InputVector &fe_function,
-                               const VectorSlice<const std::vector<unsigned int> > &indices,
+                               const VectorSlice<const std::vector<types::global_dof_index> > &indices,
                                VectorSlice<std::vector<std::vector<Tensor<1,spacedim> > > > gradients,
                                bool quadrature_points_fastest = false) const;
 
@@ -2301,7 +2572,7 @@ public:
    */
   template <class InputVector>
   void get_function_grads (const InputVector &fe_function,
-                           const VectorSlice<const std::vector<unsigned int> > &indices,
+                           const VectorSlice<const std::vector<types::global_dof_index> > &indices,
                            std::vector<Tensor<1,spacedim> > &gradients) const DEAL_II_DEPRECATED;
 
   /**
@@ -2310,7 +2581,7 @@ public:
    */
   template <class InputVector>
   void get_function_grads (const InputVector &fe_function,
-                           const VectorSlice<const std::vector<unsigned int> > &indices,
+                           const VectorSlice<const std::vector<types::global_dof_index> > &indices,
                            std::vector<std::vector<Tensor<1,spacedim> > > &gradients,
                            bool quadrature_points_fastest = false) const DEAL_II_DEPRECATED;
 
@@ -2441,7 +2712,7 @@ public:
   template <class InputVector>
   void get_function_hessians (
     const InputVector &fe_function,
-    const VectorSlice<const std::vector<unsigned int> > &indices,
+    const VectorSlice<const std::vector<types::global_dof_index> > &indices,
     std::vector<Tensor<2,spacedim> > &hessians) const;
 
   /**
@@ -2454,7 +2725,7 @@ public:
   template <class InputVector>
   void get_function_hessians (
     const InputVector &fe_function,
-    const VectorSlice<const std::vector<unsigned int> > &indices,
+    const VectorSlice<const std::vector<types::global_dof_index> > &indices,
     VectorSlice<std::vector<std::vector<Tensor<2,spacedim> > > > hessians,
     bool quadrature_points_fastest = false) const;
 
@@ -2606,7 +2877,7 @@ public:
   template <class InputVector, typename number>
   void get_function_laplacians (
     const InputVector &fe_function,
-    const VectorSlice<const std::vector<unsigned int> > &indices,
+    const VectorSlice<const std::vector<types::global_dof_index> > &indices,
     std::vector<number> &laplacians) const;
 
   /**
@@ -2619,7 +2890,7 @@ public:
   template <class InputVector, typename number>
   void get_function_laplacians (
     const InputVector &fe_function,
-    const VectorSlice<const std::vector<unsigned int> > &indices,
+    const VectorSlice<const std::vector<types::global_dof_index> > &indices,
     std::vector<Vector<number> > &laplacians) const;
 
   /**
@@ -2632,7 +2903,7 @@ public:
   template <class InputVector, typename number>
   void get_function_laplacians (
     const InputVector &fe_function,
-    const VectorSlice<const std::vector<unsigned int> > &indices,
+    const VectorSlice<const std::vector<types::global_dof_index> > &indices,
     std::vector<std::vector<number> > &laplacians,
     bool quadrature_points_fastest = false) const;
   //@}
@@ -2832,6 +3103,21 @@ public:
   const FEValuesViews::SymmetricTensor<2,dim,spacedim> &
   operator[] (const FEValuesExtractors::SymmetricTensor<2> &tensor) const;
 
+
+  /**
+   * Create a view of the current FEValues
+   * object that represents a set of
+   * <code>(dim*dim)</code> scalar components
+   * (i.e. a 2nd order tensor)
+   * of the vector-valued
+   * finite element. The concept of views
+   * is explained in the documentation of
+   * the namespace FEValuesViews and in particular
+   * in the @ref vector_valued module.
+   */
+  const FEValuesViews::Tensor<2,dim,spacedim> &
+  operator[] (const FEValuesExtractors::Tensor<2> &tensor) const;
+
   //@}
 
   /// @name Access to the raw data
@@ -3134,6 +3420,7 @@ private:
   template <int, int> friend class FEValuesViews::Scalar;
   template <int, int> friend class FEValuesViews::Vector;
   template <int, int, int> friend class FEValuesViews::SymmetricTensor;
+  template <int, int, int> friend class FEValuesViews::Tensor;
 };
 
 
@@ -4098,7 +4385,7 @@ namespace FEValuesViews
     inline
     dealii::SymmetricTensor<2,1>
     symmetrize_single_row (const unsigned int n,
-                           const Tensor<1,1> &t)
+                           const dealii::Tensor<1,1> &t)
     {
       Assert (n < 1, ExcIndexRange (n, 0, 1));
       (void)n; // removes -Wunused-parameter warning in optimized mode
@@ -4111,7 +4398,7 @@ namespace FEValuesViews
     inline
     dealii::SymmetricTensor<2,2>
     symmetrize_single_row (const unsigned int n,
-                           const Tensor<1,2> &t)
+                           const dealii::Tensor<1,2> &t)
     {
       switch (n)
         {
@@ -4137,7 +4424,7 @@ namespace FEValuesViews
     inline
     dealii::SymmetricTensor<2,3>
     symmetrize_single_row (const unsigned int n,
-                           const Tensor<1,3> &t)
+                           const dealii::Tensor<1,3> &t)
     {
       switch (n)
         {
@@ -4318,7 +4605,7 @@ namespace FEValuesViews
         // b_jj := \dfrac{\partial phi_{ii,jj}}{\partial x_jj}.
         // again, all other entries of 'b' are
         // zero
-        const Tensor<1, spacedim> phi_grad = fe_values.shape_gradients[snc][q_point];
+        const dealii::Tensor<1, spacedim> phi_grad = fe_values.shape_gradients[snc][q_point];
 
         divergence_type return_value;
         return_value[ii] = phi_grad[jj];
@@ -4337,6 +4624,115 @@ namespace FEValuesViews
       }
   }
 
+  template <int dim, int spacedim>
+  inline
+  typename Tensor<2, dim, spacedim>::value_type
+  Tensor<2, dim, spacedim>::value (const unsigned int shape_function,
+                                   const unsigned int q_point) const
+  {
+    typedef FEValuesBase<dim,spacedim> FVB;
+    Assert (shape_function < fe_values.fe->dofs_per_cell,
+            ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
+    Assert (fe_values.update_flags & update_values,
+            typename FVB::ExcAccessToUninitializedField());
+
+    // similar to the vector case where we
+    // have more then one index and we need
+    // to convert between unrolled and
+    // component indexing for tensors
+    const int snc
+      = shape_function_data[shape_function].single_nonzero_component;
+
+    if (snc == -2)
+      {
+        // shape function is zero for the
+        // selected components
+        return value_type();
+
+      }
+    else if (snc != -1)
+      {
+        value_type return_value;
+        const unsigned int comp =
+          shape_function_data[shape_function].single_nonzero_component_index;
+        const TableIndices<2> indices = dealii::Tensor<2,spacedim>::unrolled_to_component_indices(comp);
+        return_value[indices] = fe_values.shape_values(snc,q_point);
+        return return_value;
+      }
+    else
+      {
+        value_type return_value;
+        for (unsigned int d = 0; d < dim*dim; ++d)
+          if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
+            {
+              const TableIndices<2> indices = dealii::Tensor<2,spacedim>::unrolled_to_component_indices(d);
+              return_value[indices]
+                = fe_values.shape_values(shape_function_data[shape_function].row_index[d],q_point);
+            }
+        return return_value;
+      }
+  }
+
+
+  template <int dim, int spacedim>
+  inline
+  typename Tensor<2, dim, spacedim>::divergence_type
+  Tensor<2, dim, spacedim>::divergence(const unsigned int shape_function,
+                                       const unsigned int q_point) const
+  {
+    typedef FEValuesBase<dim,spacedim> FVB;
+    Assert (shape_function < fe_values.fe->dofs_per_cell,
+            ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell));
+    Assert (fe_values.update_flags & update_gradients,
+            typename FVB::ExcAccessToUninitializedField());
+
+    const int snc = shape_function_data[shape_function].single_nonzero_component;
+
+    if (snc == -2)
+      {
+        // shape function is zero for the
+        // selected components
+        return divergence_type();
+      }
+    else if (snc != -1)
+      {
+        // we have a single non-zero component
+        // when the tensor is
+        // represented in unrolled form.
+        //
+        // the divergence of a second-order tensor
+        // is a first order tensor.
+        //
+        // assume the second-order tensor is
+        // A with components A_{ij}.
+        // divergence as:
+        // b_j := \dfrac{\partial phi_{ij}}{\partial x_i}.
+        //
+        // Now, we know the nonzero component
+        // in unrolled form: it is indicated
+        // by 'snc'. we can figure out which
+        // tensor components belong to this:
+        const unsigned int comp =
+          shape_function_data[shape_function].single_nonzero_component_index;
+        const TableIndices<2> indices = dealii::Tensor<2,spacedim>::unrolled_to_component_indices(comp);
+        const unsigned int ii = indices[0];
+        const unsigned int jj = indices[1];
+
+        const dealii::Tensor<1, spacedim> phi_grad = fe_values.shape_gradients[snc][q_point];
+
+        divergence_type return_value;
+        return_value[jj] = phi_grad[ii];
+
+        return return_value;
+
+      }
+    else
+      {
+        Assert (false, ExcNotImplemented());
+        divergence_type return_value;
+        return return_value;
+      }
+  }
 }
 
 
@@ -4388,6 +4784,21 @@ operator[] (const FEValuesExtractors::SymmetricTensor<2> &tensor) const
   return fe_values_views_cache.symmetric_second_order_tensors[tensor.first_tensor_component];
 }
 
+template <int dim, int spacedim>
+inline
+const FEValuesViews::Tensor<2,dim,spacedim> &
+FEValuesBase<dim,spacedim>::
+operator[] (const FEValuesExtractors::Tensor<2> &tensor) const
+{
+  Assert (tensor.first_tensor_component <
+          fe_values_views_cache.second_order_tensors.size(),
+          ExcIndexRange (tensor.first_tensor_component,
+                         0, fe_values_views_cache.second_order_tensors.size()));
+
+  return fe_values_views_cache.second_order_tensors[tensor.first_tensor_component];
+}
+
+
 
 
 template <int dim, int spacedim>
@@ -4783,7 +5194,7 @@ inline
 void
 FEValuesBase<dim,spacedim>::get_function_grads (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<Tensor<1,spacedim> > &values) const
 {
   get_function_gradients(fe_function, indices, values);
@@ -4810,7 +5221,7 @@ inline
 void
 FEValuesBase<dim,spacedim>::get_function_grads (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<std::vector<Tensor<1,spacedim> > > &values,
   bool q_points_fastest) const
 {
index 5d85836b08635eab48258ebe43fe5b185b7451d6..882399aad17b055cba0c9c5ca64f99b056de5be7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_values_extractors_h
 #define __deal2__fe_values_extractors_h
 
@@ -200,6 +205,61 @@ namespace FEValuesExtractors
      */
     SymmetricTensor (const unsigned int first_tensor_component);
   };
+
+
+  /**
+   * Extractor for a (possible non-)symmetric tensor of a
+   * rank specified by the template
+   * argument. For a second order
+   * tensor, this represents a collection of
+   * <code>(dim*dim)</code>
+   * components of a vector-valued
+   * element. The value of <code>dim</code>
+   * is defined by the FEValues object the
+   * extractor is applied to. The result of
+   * applying an object of this type to an
+   * FEValues, FEFaceValues or
+   * FESubfaceValues object is of type
+   * FEValuesViews::Tensor.
+   *
+   * The concept of
+   * extractors is defined in the
+   * documentation of the namespace
+   * FEValuesExtractors and in the @ref
+   * vector_valued module.
+   *
+   * @ingroup feaccess vector_valued
+   *
+   * @author Denis Davydov, 2013
+   */
+  template <int rank>
+  struct Tensor
+  {
+    /**
+     * The first component of the tensor
+     * view.
+     */
+    unsigned int first_tensor_component;
+
+    /**
+     * Default constructor. Initialize the
+     * object with an invalid component. This leads to
+     * an object that can not be used, but it allows
+     * objects of this kind to be put into arrays that
+     * require a default constructor upon resizing the
+     * array, and then later assigning a suitable
+     * object to each element of the array.
+     */
+    Tensor ();
+
+    /**
+     * Constructor. Take the first
+     * component of the selected tensor
+     * inside the FEValues object as
+     * argument.
+     */
+    Tensor (const unsigned int first_tensor_component);
+  };
 }
 
 
@@ -251,6 +311,22 @@ namespace FEValuesExtractors
     :
     first_tensor_component (first_tensor_component)
   {}
+
+
+  template <int rank>
+  inline
+  Tensor<rank>::Tensor ()
+    :
+    first_tensor_component(numbers::invalid_unsigned_int)
+  {}
+
+
+  template <int rank>
+  inline
+  Tensor<rank>::Tensor (const unsigned int first_tensor_component)
+    :
+    first_tensor_component (first_tensor_component)
+  {}
 }
 
 
index 74906f3107f4fed836119b33e204404ec340c05a..f93a0cdf05650f392a7ff106881d7b7a06be4713 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mapping_h
 #define __deal2__mapping_h
 
index a56e3c24d55bd024c56aaa52e085d399123655bd..85f900bf28023d8804255ec866eca9c5031cf9e2 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mapping_c1_h
 #define __deal2__mapping_c1_h
 
index a08d2caa524da6199489908aa80f348a7ee3eeeb..c7be0546c72363c344d0a153be0400d3c89fed8e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mapping_cartesian_h
 #define __deal2__mapping_cartesian_h
 
index 3e1ae954448725345990ec6a7edcdfe0c0f2df95..484963727b0c16cd8ee65da5836b5d8e7237d942 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mapping_q_h
 #define __deal2__mapping_q_h
 
index 68b691875a545404221e10c75154bffff83c0cec..6cd251c64a8268c85bd6ae1bd1e3a55208979e43 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mapping_q1_h
 #define __deal2__mapping_q1_h
 
index 2630565c0b3b6011292d2fdb625c79d5832cbf1b..852ce715acc178b67b56ea8422008fd6546e20d2 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mapping_q1_eulerian_h
 #define __deal2__mapping_q1_eulerian_h
 
index 5976439541770fb3042035afa704b878d409c70c..4d4ba9cc9cfdcc0ea58d0a83562922b964f56555 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mapping_q_eulerian_h
 #define __deal2__mapping_q_eulerian_h
diff --git a/deal.II/include/deal.II/grid/cell_id.h b/deal.II/include/deal.II/grid/cell_id.h
new file mode 100644 (file)
index 0000000..588a7f0
--- /dev/null
@@ -0,0 +1,134 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1998 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+#ifndef __deal2__cell_id_h
+#define __deal2__cell_id_h
+
+#include <deal.II/base/config.h>
+#include <deal.II/base/exceptions.h>
+
+#include <vector>
+
+
+DEAL_II_NAMESPACE_OPEN
+
+
+/**
+ * A class to represent a unique ID for a cell in a Triangulation.
+ * This class stores the index of the coarse cell together with the
+ * information on how to reach the cell from that coarse cell (which
+ * child index to take on each level). The internal representation
+ * is not exposed on purpose.
+ *
+ * TODO: does it make sense to implement a more efficient representation
+ * (internally and/or as a string)? If yes, something like a 64bit int
+ * as in p4est would be a good option.
+ */
+class CellId
+{
+public:
+  /**
+   * construct CellId with a given coarse_cell_index and list of child indices
+   */
+  explicit CellId(unsigned int coarse_cell_id_, std::vector<unsigned char> id_)
+    : coarse_cell_id(coarse_cell_id_), id(id_)
+  {}
+
+  /**
+   * construct an empty CellId.
+   */
+  CellId()
+    : coarse_cell_id(-1)
+  {}
+
+  /**
+   * compare two CellIds
+   */
+  bool operator== (const CellId &other) const;
+
+  /**
+   * compare two CellIds
+   */
+  bool operator!= (const CellId &other) const;
+
+
+  friend std::istream &operator>> (std::istream &is, CellId &cid);
+  friend std::ostream &operator<< (std::ostream &os, const CellId &cid);
+private:
+  unsigned int coarse_cell_id;
+  std::vector<unsigned char> id;
+};
+
+/**
+ * output CellId into a stream
+ */
+inline std::ostream &operator<< (std::ostream &os, const CellId &cid)
+{
+  os << cid.coarse_cell_id << '_' << cid.id.size() << ':';
+  for (unsigned int i=0; i<cid.id.size(); ++i)
+    os << static_cast<int>(cid.id[i]);
+  return os;
+}
+
+/**
+ * read CellId from a stream
+ */
+inline std::istream &operator>> (std::istream &is, CellId &cid)
+{
+  unsigned int cellid;
+  is >> cellid;
+  if (is.eof())
+    return is;
+
+  cid.coarse_cell_id = cellid;
+  char dummy;
+  is >> dummy;
+  Assert(dummy=='_', ExcMessage("invalid CellId"));
+  unsigned int idsize;
+  is >> idsize;
+  is >> dummy;
+  Assert(dummy==':', ExcMessage("invalid CellId"));
+
+  char value;
+  cid.id.clear();
+  for (unsigned int i=0; i<idsize; ++i)
+    {
+      is >> value;
+      cid.id.push_back(value-'0');
+    }
+  return is;
+}
+
+inline bool
+CellId::operator== (const CellId &other) const
+{
+  if (this->coarse_cell_id != other.coarse_cell_id)
+    return false;
+  return id == other.id;
+}
+
+/**
+ *
+ */
+inline bool
+CellId::operator!= (const CellId &other) const
+{
+  return !(*this == other);
+}
+
+DEAL_II_NAMESPACE_CLOSE
+
+#endif
index 2117169cb5e68fb2e8fcb44112c920f822887809..c6a4c56f840b3795dcebae32092a8dcde3ba59e8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__filtered_iterator_h
 #define __deal2__filtered_iterator_h
 
@@ -22,17 +27,16 @@ DEAL_II_NAMESPACE_OPEN
 
 /**
  * In this namespace a number of classes is declared that may be used
- * as filters in the FilteredIterator class. The filters either
- * check for binary information (for example, the IteratorFilters::Active filter
- * class checks whether the object pointed to is active), or for
- * valued information by comparison with prescribed values (for
- * example, the LevelEqualTo filter class checks whether the
- * level of the object pointed to by the iterator under consideration
- * is equal to a value that was given to the filter upon construction.
+ * as filters in the FilteredIterator class. The filters either check
+ * for binary information (for example, the IteratorFilters::Active
+ * filter class checks whether the object pointed to is active), or
+ * for valued information by comparison with prescribed values (for
+ * example, the LevelEqualTo filter class checks whether the level of
+ * the object pointed to by the iterator under consideration is equal
+ * to a value that was given to the filter upon construction.
  *
  * For examples of use of these classes as well as requirements on
- * filters see the general description of the FilteredIterator
- * class.
+ * filters see the general description of the FilteredIterator class.
  *
  * @ingroup Iterators
  * @author Wolfgang Bangerth, 2002
@@ -40,10 +44,8 @@ DEAL_II_NAMESPACE_OPEN
 namespace IteratorFilters
 {
   /**
-   * Filter that evaluates to true if
-   * either the iterator points to an
-   * active object or an iterator
-   * past the end.
+   * Filter that evaluates to true if either the iterator points to an
+   * active object or an iterator past the end.
    *
    * @ingroup Iterators
    */
@@ -51,21 +53,17 @@ namespace IteratorFilters
   {
   public:
     /**
-     * Evaluate the iterator and
-     * return true if the object is
-     * active or past the end.
+     * Evaluate the iterator and return true if the object is active
+     * or past the end.
      */
     template <class Iterator>
     bool operator () (const Iterator &i) const;
   };
 
   /**
-   * Filter that evaluates to true if
-   * either the iterator points to an
-   * object for which the user flag
-   * is set or an iterator past the
-   * end. See @ref GlossUserFlags
-  * for information about user flags.
+   * Filter that evaluates to true if either the iterator points to an
+   * object for which the user flag is set or an iterator past the
+   * end. See @ref GlossUserFlags for information about user flags.
    *
    * @ingroup Iterators
    */
@@ -73,10 +71,8 @@ namespace IteratorFilters
   {
   public:
     /**
-     * Evaluate the iterator and
-     * return true if the object
-     * has a set user flag or past
-     * the end.
+     * Evaluate the iterator and return true if the object has a set
+     * user flag or past the end.
      */
     template <class Iterator>
     bool operator () (const Iterator &i) const;
@@ -84,12 +80,9 @@ namespace IteratorFilters
 
 
   /**
-   * Filter that evaluates to true if
-   * either the iterator points to an
-   * object for which the user flag
-   * is not set or an iterator past
-   * the end. Inverse filter to the
-   * previous class.
+   * Filter that evaluates to true if either the iterator points to an
+   * object for which the user flag is not set or an iterator past the
+   * end. Inverse filter to the previous class.
    *
    * @ingroup Iterators
    */
@@ -97,10 +90,8 @@ namespace IteratorFilters
   {
   public:
     /**
-     * Evaluate the iterator and
-     * return true if the object
-     * has an unset user flag or
-     * past the end.
+     * Evaluate the iterator and return true if the object has an
+     * unset user flag or past the end.
      */
     template <class Iterator>
     bool operator () (const Iterator &i) const;
@@ -108,12 +99,9 @@ namespace IteratorFilters
 
 
   /**
-   * Filter for iterators that
-   * evaluates to true if either the
-   * iterator is past the end or the
-   * level of the object pointed to
-   * is equal to a value given to the
-   * constructor.
+   * Filter for iterators that evaluates to true if either the
+   * iterator is past the end or the level of the object pointed to is
+   * equal to a value given to the constructor.
    *
    * @ingroup Iterators
    */
@@ -121,27 +109,22 @@ namespace IteratorFilters
   {
   public:
     /**
-     * Constructor. Store the level
-     * which iterators shall have
-     * to be evaluated to true.
+     * Constructor. Store the level which iterators shall have to be
+     * evaluated to true.
      */
     LevelEqualTo (const unsigned int level);
 
     /**
-     * Evaluation operator. Returns
-     * true if either the level of
-     * the object pointed to is
-     * equal to the stored value or
-     * the iterator is past the
-     * end.
+     * Evaluation operator. Returns true if either the level of the
+     * object pointed to is equal to the stored value or the iterator
+     * is past the end.
      */
     template <class Iterator>
     bool operator () (const Iterator &i) const;
 
   protected:
     /**
-     * Stored value to compare the
-     * level with.
+     * Stored value to compare the level with.
      */
     const unsigned int level;
   };
@@ -149,15 +132,10 @@ namespace IteratorFilters
 
 
   /**
-   * Filter for iterators that
-   * evaluates to true if either the
-   * iterator is past the end or the
-   * subdomain id of the object
-   * pointed to is equal to a value
-   * given to the constructor,
-   * assuming that the iterator
-   * allows querying for a subdomain
-   * id).
+   * Filter for iterators that evaluates to true if either the
+   * iterator is past the end or the subdomain id of the object
+   * pointed to is equal to a value given to the constructor, assuming
+   * that the iterator allows querying for a subdomain id).
    *
    * @ingroup Iterators
    */
@@ -165,28 +143,22 @@ namespace IteratorFilters
   {
   public:
     /**
-     * Constructor. Store the
-     * subdomain which iterators
-     * shall have to be evaluated
-     * to true.
+     * Constructor. Store the subdomain which iterators shall have to
+     * be evaluated to true.
      */
     SubdomainEqualTo (const types::subdomain_id subdomain_id);
 
     /**
-     * Evaluation operator. Returns
-     * true if either the subdomain
-     * of the object pointed to is
-     * equal to the stored value or
-     * the iterator is past the
-     * end.
+     * Evaluation operator. Returns true if either the subdomain of
+     * the object pointed to is equal to the stored value or the
+     * iterator is past the end.
      */
     template <class Iterator>
     bool operator () (const Iterator &i) const;
 
   protected:
     /**
-     * Stored value to compare the
-     * subdomain with.
+     * Stored value to compare the subdomain with.
      */
     const types::subdomain_id subdomain_id;
   };
@@ -194,14 +166,12 @@ namespace IteratorFilters
 
 
   /**
-   * Filter for iterators that evaluates to
-   * true if a cell is owned by the current
-   * processor, i.e., if it is a
-   * @ref GlossLocallyOwnedCell "locally owned cell".
+   * Filter for iterators that evaluates to true if a cell is owned by
+   * the current processor, i.e., if it is a @ref
+   * GlossLocallyOwnedCell "locally owned cell".
    *
-   * This class is used in step-32, in
-   * connection with the methods of the @ref
-   * distributed module.
+   * This class is used in step-32, in connection with the methods of
+   * the @ref distributed module.
    *
    * @ingroup Iterators
    */
@@ -209,8 +179,26 @@ namespace IteratorFilters
   {
   public:
     /**
-     * Evaluation operator. Returns true if
-     * the cell is locally owned.
+     * Evaluation operator. Returns true if the cell is locally owned.
+     */
+    template <class Iterator>
+    bool operator () (const Iterator &i) const;
+  };
+
+
+
+  /**
+   * Filter for iterators that evaluates to true if th level subdomain
+   * id of a cell is equal to the current processor id.
+   *
+   * @ingroup Iterators
+   */
+  class LocallyOwnedLevelCell
+  {
+  public:
+    /**
+     * Evaluation operator. Returns true if the level subdomain id of
+     * the cell is equal to the current processor id.
      */
     template <class Iterator>
     bool operator () (const Iterator &i) const;
@@ -808,7 +796,11 @@ inline
 FilteredIterator<BaseIterator>::
 FilteredIterator (const FilteredIterator &fi)
   :
-  BaseIterator (static_cast<BaseIterator>(fi)),
+// this construction looks strange, but without going through the
+// address of fi, GCC would not cast fi to the base class of type
+// BaseIterator but tries to go through constructing a new
+// BaseIterator with an Accessor.
+  BaseIterator (*(BaseIterator *)(&fi)),
   predicate (fi.predicate->clone ())
 {}
 
@@ -1142,6 +1134,17 @@ namespace IteratorFilters
   {
     return (i->is_locally_owned());
   }
+
+
+// ---------------- IteratorFilters::LocallyOwnedLevelCell ---------
+
+  template <class Iterator>
+  inline
+  bool
+  LocallyOwnedLevelCell::operator () (const Iterator &i) const
+  {
+    return (i->is_locally_owned_on_level());
+  }
 }
 
 
index 96ab4a635a130b24ac8293a1f82186227f37b590..39676698608ff92918e5df574b2d09817f0cf79f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__grid_generator_h
 #define __deal2__grid_generator_h
 
@@ -51,6 +56,11 @@ template <typename number> class SparseMatrix;
 class GridGenerator
 {
 public:
+  /**
+   * Declare type for number of cell.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Initialize the given triangulation with a hypercube (line in 1D, square
    * in 2D, etc) consisting of exactly one cell. The hypercube volume is the
@@ -261,7 +271,7 @@ public:
   static
   void
   subdivided_parallelepiped (Triangulation<dim>  &tria,
-                             const unsigned int   n_subdivisions,
+                             const size_type     n_subdivisions,
                              const Point<dim>   (&corners) [dim],
                              const bool           colorize = false);
 
@@ -277,7 +287,7 @@ public:
   static
   void
   subdivided_parallelepiped (Triangulation<dim>  &tria,
-                             const unsigned int ( n_subdivisions) [dim],
+                             const size_type    ( n_subdivisions) [dim],
                              const Point<dim>   (&corners) [dim],
                              const bool           colorize = false);
 
@@ -485,7 +495,7 @@ public:
                            const Point<dim>     &center,
                            const double        inner_radius,
                            const double        outer_radius,
-                           const unsigned int  n_cells = 0,
+                           const size_type     n_cells = 0,
                            bool colorize = false);
 
   /**
@@ -514,7 +524,7 @@ public:
                                 const Point<dim>     &center,
                                 const double        inner_radius,
                                 const double        outer_radius,
-                                const unsigned int  n_cells = 0,
+                                const size_type     n_cells = 0,
                                 const bool colorize = false);
 
 
@@ -543,7 +553,7 @@ public:
                                    const Point<dim>     &center,
                                    const double        inner_radius,
                                    const double        outer_radius,
-                                   const unsigned int  n_cells = 0,
+                                   const size_type     n_cells = 0,
                                    const bool colorize = false);
 
   /**
@@ -563,8 +573,8 @@ public:
                               const double        length,
                               const double        inner_radius,
                               const double        outer_radius,
-                              const unsigned int  n_radial_cells = 0,
-                              const unsigned int  n_axial_cells = 0);
+                              const size_type     n_radial_cells = 0,
+                              const size_type     n_axial_cells = 0);
 
 
 
@@ -602,7 +612,7 @@ public:
    * @arg @p L: extension in @p z-direction (only used in 3d)
    * @arg @p repetitions: number of subdivisions
    *      along the @p z-direction
-   * @arg @p colorize: wether to assign different
+   * @arg @p colorize: whether to assign different
    *     boundary indicators to different faces.
    *    The colors are given in lexicographic
    *    ordering for the flat faces (0 to 3 in 2d,
@@ -616,7 +626,7 @@ public:
                                                 const double inner_radius = .25,
                                                 const double outer_radius = .5,
                                                 const double L = .5,
-                                                const unsigned int repetition = 1,
+                                                const size_type repetition = 1,
                                                 const bool colorize = false);
 
   /**
@@ -630,7 +640,7 @@ public:
    * @param r           The radius of the cylinder bend together as loop.
    */
   static void moebius (Triangulation<3,3>  &tria,
-                       const unsigned int   n_cells,
+                       const size_type      n_cells,
                        const unsigned int   n_rotations,
                        const double         R,
                        const double         r);
@@ -682,8 +692,8 @@ public:
    */
   static
   void
-  extrude_triangulation(const Triangulation<2, 2> & input,
-                        const unsigned int n_slices,
+  extrude_triangulation(const Triangulation<2, 2> &input,
+                        const size_type n_slices,
                         const double height,
                         Triangulation<3,3> &result);
 
@@ -704,7 +714,7 @@ public:
   template <int dim>
   static
   void laplace_transformation (Triangulation<dim> &tria,
-                               const std::map<unsigned int,Point<dim> > &new_points) DEAL_II_DEPRECATED;
+                               const std::map<size_type,Point<dim> > &new_points) DEAL_II_DEPRECATED;
 
   /**
    * Exception
@@ -782,7 +792,7 @@ private:
   static
   void
   laplace_solve (const SparseMatrix<double>          &S,
-                 const std::map<unsigned int,double> &m,
+                 const std::map<size_type,double> &m,
                  Vector<double>                      &u);
 };
 
index 8a23c03805a95e4606c64429653e90e5a5189d05..5d4997ec3877519bc1e39c66f6c06ed5d26b39e7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__grid_in_h
 #define __deal2__grid_in_h
 
index 01d778f595e844d4fce6875ab5fb0707d1b8b0d1..22359a950aaa16ca61c21bb6ae263176aff73603 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__grid_out_h
 #define __deal2__grid_out_h
 
@@ -623,13 +628,15 @@ namespace GridOutFlags
     /**
      * Background style.
      */
-    enum Background{
-       /// Use transparent value of SVG
-        transparent,
-       /// Use white background
-        white,
-       /// Use a gradient from white (top) to steelblue (bottom), and add date and time plus a deal.II logo. Automatically draws a margin.
-        dealii};
+    enum Background
+    {
+      /// Use transparent value of SVG
+      transparent,
+      /// Use white background
+      white,
+      /// Use a gradient from white (top) to steelblue (bottom), and add date and time plus a deal.II logo. Automatically draws a margin.
+      dealii
+    };
 
     Background background;
 
@@ -646,18 +653,20 @@ namespace GridOutFlags
     /**
      * Cell coloring.
      */
-    enum Coloring{ 
-        /// No cell coloring
-        none, 
-        /// Convert the material id into the cell color (default)
-        material_id, 
-        /// Convert the level number into the cell color
-        level_number, 
-        /// Convert the subdomain id into the cell color
-        subdomain_id, 
-        /// Convert the level subdomain id into the cell color
-        level_subdomain_id}; 
+    enum Coloring
+    {
+      /// No cell coloring
+      none,
+      /// Convert the material id into the cell color (default)
+      material_id,
+      /// Convert the level number into the cell color
+      level_number,
+      /// Convert the subdomain id into the cell color
+      subdomain_id,
+      /// Convert the level subdomain id into the cell color
+      level_subdomain_id
+    };
+
     Coloring coloring;
 
     /// Interpret the level number of the cells as altitude over the x-y-plane (useful in the perpspective view).
@@ -665,7 +674,7 @@ namespace GridOutFlags
 
     /**
      * Cell labeling (fixed order).
-     * 
+     *
      * The following booleans determine which properties of the cell
      * shall be displayed as text in the middle of each cell.
      */
@@ -1046,15 +1055,15 @@ public:
 
   /**
    * Write the triangulation in the SVG format.
-   * 
-   * SVG (Scalable Vector Graphics) is 
-   * an XML-based vector image format 
-   * developed and maintained by the 
-   * World Wide Web Consortium (W3C). 
-   * This function conforms to the 
-   * latest specification SVG 1.1, 
+   *
+   * SVG (Scalable Vector Graphics) is
+   * an XML-based vector image format
+   * developed and maintained by the
+   * World Wide Web Consortium (W3C).
+   * This function conforms to the
+   * latest specification SVG 1.1,
    * released on August 16, 2011.
-   * 
+   *
    * The cells of the triangulation are written as polygons with
    * additional lines at the boundary of the triangulation. A coloring
    * of the cells is further possible in order to visualize a certain
@@ -1062,10 +1071,10 @@ public:
    * colorbar can be drawn to encode the chosen coloring.  Moreover, a
    * cell label can be added, showing level index, etc.
    *
-   * @note Yet only implemented for 
+   * @note Yet only implemented for
    * two-dimensional grids in two
    * space dimensions.
-   * 
+   *
    */
   template <int dim, int spacedim>
   void write_svg (const Triangulation<dim,spacedim> &tria,
@@ -1091,7 +1100,7 @@ public:
    */
   template <int dim>
   void write_mathgl (const Triangulation<dim> &tria,
-                    std::ostream             &out) const;
+                     std::ostream             &out) const;
 
   /**
    * Write grid to @p out according to the given data format. This
@@ -1503,19 +1512,19 @@ private:
 
 
   /**
-   * This function projects a three-dimensional point (Point<3> point) 
-   * onto a two-dimensional image plane, specified by the position of 
-   * the camera viewing system (Point<3> camera_position), camera 
-   * direction (Point<3> camera_position), camera horizontal (Point<3> 
-   * camera_horizontal, necessary for the correct alignment of the 
+   * This function projects a three-dimensional point (Point<3> point)
+   * onto a two-dimensional image plane, specified by the position of
+   * the camera viewing system (Point<3> camera_position), camera
+   * direction (Point<3> camera_position), camera horizontal (Point<3>
+   * camera_horizontal, necessary for the correct alignment of the
    * later images), and the focus of the camera (float camera_focus).
    *
    * For SVG output of grids.
    */
-  static Point<2> svg_project_point(Point<3> point, 
-                                    Point<3> camera_position, 
-                                    Point<3> camera_direction, 
-                                    Point<3> camera_horizontal, 
+  static Point<2> svg_project_point(Point<3> point,
+                                    Point<3> camera_position,
+                                    Point<3> camera_direction,
+                                    Point<3> camera_horizontal,
                                     float camera_focus);
 
   /**
index c5f9d6ec0b86dfa422a940afdaf0156677f9b765..50564a586ba3395723e30ecde190e4283a848dea 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__grid_refinement_h
 #define __deal2__grid_refinement_h
 
index 4e03878b2656fd83574f671b6849b37566924b33..652a59ce98103184025debba465a4267ea6bdecd 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__grid_reordering_h
 #define __deal2__grid_reordering_h
 
index d9f8497c5f374a16d3b78c247eef42670b26839c..004167263b36aa77cf29b82b13c836239b9a2b11 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__grid_reordering_internal_h
 #define __deal2__grid_reordering_internal_h
 
index 37a59770e926ccca120b3176f10a23fff6121af9..1df740cff6064c19b3e378eb6dd820466074ccf0 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__grid_tools_H
 #define __deal2__grid_tools_H
 
index 04bf97c9177bd55278f7515d92ab992a3cba77a1..21c3beebae77a7210e2895859173f4db34a515d2 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__intergrid_map_h
 #define __deal2__intergrid_map_h
 
index 23044ecce4480bdebfe70d013fcfe90185e16c24..6ef45dca02307662a1666480eb577d4c3560b3f5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__magic_numbers_h
 #define __deal2__magic_numbers_h
 
index 64dd0f12056f76600cbae18e9978409ad33b2bca..9a53ce887ffd385e720a82f2a0628a9bf97bb01c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__persistent_tria_h
 #define __deal2__persistent_tria_h
 
index ce1fa0c4a81c117b52b3b5dbd18e8e15d3a61908..adb735e58add8405b3d93bfe92d12f71db2e3f94 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_h
 #define __deal2__tria_h
 
@@ -1470,7 +1475,7 @@ public:
    *  RefinementListener.
    *
    * @note The use of this class has been
-   * superceded by the signals mechanism.
+   * superseded by the signals mechanism.
    * See the general documentation of the
    * Triangulation class for more information.
    *
@@ -1485,7 +1490,7 @@ public:
      * class also has virtual functions.
      *
      * @note The use of this class has been
-     * superceded by the signals mechanism.
+     * superseded by the signals mechanism.
      * See the general documentation of the
      * Triangulation class for more information.
      *
@@ -1501,7 +1506,7 @@ public:
      * registered with the triangulation.
      *
      * @note The use of this class has been
-     * superceded by the signals mechanism.
+     * superseded by the signals mechanism.
      * See the general documentation of the
      * Triangulation class for more information.
      *
@@ -1519,7 +1524,7 @@ public:
      * registered with the triangulation.
      *
      * @note The use of this class has been
-     * superceded by the signals mechanism.
+     * superseded by the signals mechanism.
      * See the general documentation of the
      * Triangulation class for more information.
      *
@@ -1544,7 +1549,7 @@ public:
      * derived classes.
      *
      * @note The use of this class has been
-     * superceded by the signals mechanism.
+     * superseded by the signals mechanism.
      * See the general documentation of the
      * Triangulation class for more information.
      *
@@ -1567,7 +1572,7 @@ public:
      * implemented in derived classes.
      *
      * @note The use of this class has been
-     * superceded by the signals mechanism.
+     * superseded by the signals mechanism.
      * See the general documentation of the
      * Triangulation class for more information.
      *
@@ -2106,7 +2111,7 @@ public:
    * section on signals in the general
    * documentation of this class.
    */
-  void refine_global (const unsigned int times);
+  void refine_global (const unsigned int times = 1);
 
   /**
    * Execute both refinement and
@@ -2236,7 +2241,7 @@ public:
    *  the Triangulation is refined.
    *
    * @note The use of this function has been
-   * superceded by the signals mechanism.
+   * superseded by the signals mechanism.
    * See the general documentation of the
    * Triangulation class for more information.
    *
@@ -2254,7 +2259,7 @@ public:
    *  Triangulation.
    *
    * @note The use of this function has been
-   * superceded by the signals mechanism.
+   * superseded by the signals mechanism.
    * See the general documentation of the
    * Triangulation class for more information.
    *
@@ -2640,8 +2645,16 @@ public:
   cell_iterator        begin       (const unsigned int level = 0) const;
 
   /**
-   *  Iterator to the first active
-   *  cell on level @p level.
+   *  Iterator to the first active cell on level @p level. If the
+   *  given level does not contain any active cells (i.e., all cells
+   *  on this level are further refined, then this function returns
+   *  <code>end_active(level)</code> so that loops of the kind
+   *  @code
+   *    for (cell=tria.begin_active(level); cell!=tria.end_active(level); ++cell)
+   *      ...
+   *  @endcode
+   *  have zero iterations, as may be expected if there are no active
+   *  cells on this level.
    */
   active_cell_iterator begin_active(const unsigned int level = 0) const;
 
@@ -2662,10 +2675,9 @@ public:
   cell_iterator        end (const unsigned int level) const;
 
   /**
-   * Return an active iterator which is the
-   * first iterator not on level. If @p level
-   * is the last level, then this returns
-   * <tt>end()</tt>.
+   * Return an active iterator which is the first active iterator not
+   * on the given level. If @p level is the last level, then this
+   * returns <tt>end()</tt>.
    */
   active_cell_iterator end_active (const unsigned int level) const;
 
@@ -2676,23 +2688,11 @@ public:
    */
   cell_iterator        last () const;
 
-  /**
-   *  Return an iterator pointing to the
-   *  last used cell on level @p level.
-   */
-  cell_iterator        last (const unsigned int level) const;
-
   /**
    *  Return an iterator pointing to the
    *  last active cell.
    */
   active_cell_iterator last_active () const;
-
-  /**
-   *  Return an iterator pointing to the
-   *  last active cell on level @p level.
-   */
-  active_cell_iterator last_active (const unsigned int level) const;
   /*@}*/
 
   /*---------------------------------------*/
@@ -3234,7 +3234,7 @@ public:
    */
   DeclException0 (ExcTriangulationNotEmpty);
   /**
-   * Trying to re-read a grid, an error occured.
+   * Trying to re-read a grid, an error occurred.
    *
    * @ingroup Exceptions
    */
@@ -3554,7 +3554,7 @@ private:
    *  this contains nothing, in 2D it contains data
    *  concerning lines and in 3D quads and lines.  All of
    *  these have no level and are therefore treated
-   *  seperately.
+   *  separately.
    */
   dealii::internal::Triangulation::TriaFaces<dim> *faces;
 
@@ -3826,7 +3826,7 @@ Triangulation<dim,spacedim>::load (Archive &ar,
 
   // as discussed in the documentation, do
   // not store the signals as well as
-  // boundary and manifold descrption
+  // boundary and manifold description
   // but everything else
   ar &smooth_grid;
   ar &levels;
index 32db0f30fb8b6d98c26dae4059265ceafd75d98d..6705f5ded335ad91b1b8df54d8998bfd9d0b74ad 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_accessor_h
 #define __deal2__tria_accessor_h
 
@@ -19,6 +24,7 @@
 #include <deal.II/base/point.h>
 #include <deal.II/grid/tria_iterator_base.h>
 #include <deal.II/grid/tria_iterator_selector.h>
+#include <deal.II/grid/cell_id.h>
 
 
 namespace std
@@ -318,7 +324,7 @@ protected:
   TriaAccessorBase (const Triangulation<dim,spacedim> *parent =  0,
                     const int                 level  = -1,
                     const int                 index  = -1,
-                    const AccessorData       *       =  0);
+                    const AccessorData             * =  0);
 
   /**
    *  Copy constructor. Creates an
@@ -345,6 +351,14 @@ protected:
    */
   TriaAccessorBase &operator = (const TriaAccessorBase &);
 
+  /**
+   * Ordering of accessors. If #structure_dimension is less than
+   * #dimension, we simply compare the index of such an object. If
+   * #structure_dimension equals #dimension, we compare the level()
+   * first, and the index() only if levels are equal.
+   */
+  bool operator < (const TriaAccessorBase &other) const;
+
 protected:
   /**
    *  Copy operator. This is normally
@@ -2833,6 +2847,14 @@ public:
    * See the @ref GlossSubdomainId
    * "glossary" for more
    * information.
+   *
+   * @note The subdomain of a cell is a property only defined
+   * for active cells, i.e., cells that are not further
+   * refined. Consequently, you can only call this function if
+   * the cell it refers to has no children. For multigrid
+   * methods in parallel, it is also important to know which
+   * processor owns non-active cells, and for this you can call
+   * level_subdomain_id().
    */
   types::subdomain_id subdomain_id () const;
 
@@ -2847,6 +2869,14 @@ public:
    * use a
    * parallel::distributed::Triangulation
    * object.
+   *
+   * @note The subdomain of a cell is a property only defined
+   * for active cells, i.e., cells that are not further
+   * refined. Consequently, you can only call this function if
+   * the cell it refers to has no children. For multigrid
+   * methods in parallel, it is also important to know which
+   * processor owns non-active cells, and for this you can call
+   * level_subdomain_id().
    */
   void set_subdomain_id (const types::subdomain_id new_subdomain_id) const;
 
@@ -2862,10 +2892,13 @@ public:
 
 
   /**
-   * Set the subdomain id of this
-   * cell and all its children (and
-   * grand-children, and so on) to
-   * the given value.
+   * Set the subdomain id of this cell (if it is active) or all its terminal
+   * children (and grand-children, and so on, as long as they have no children
+   * of their own) to the given value. Since the subdomain id is a concept
+   * that is only defined for cells that are active (i.e., have no children
+   * of their own), this function only sets the subdomain ids for all
+   * children and grand children of this cell that are actually active,
+   * skipping intermediate child cells.
    *
    * See the @ref GlossSubdomainId
    * "glossary" for more
@@ -2873,7 +2906,8 @@ public:
    * should not be called if you
    * use a
    * parallel::distributed::Triangulation
-   * object.
+   * object since there the subdomain id is implicitly defined by which
+   * processor you're on.
    */
   void recursively_set_subdomain_id (const types::subdomain_id new_subdomain_id) const;
   /**
@@ -2900,7 +2934,8 @@ public:
 
   /**
    *  Return an iterator to the
-   *  parent.
+   *  parent. Throws an exception if this cell has no parent, i.e. has
+   *  level 0.
    */
   TriaIterator<CellAccessor<dim,spacedim> >
   parent () const;
@@ -2926,6 +2961,16 @@ public:
    */
   bool active () const;
 
+  /**
+   * Ordering of accessors. This function implements a total ordering
+   * of cells even on a parallel::distributed::Triangulation. This
+   * function first compares level_subdomain_id(). If these are equal,
+   * and both cells are active, it compares subdomain_id(). If this is
+   * inconclusive, TriaAccessorBase::operator < () is called.
+   */
+  bool operator < (const CellAccessor<dim, spacedim> &other) const;
+
+
   /**
    * Return whether this cell is owned by the current processor
    * or is owned by another processor. The function always returns
@@ -2940,9 +2985,21 @@ public:
    *
    * @post The returned value is equal to <code>!is_ghost() &&
    * !is_artificial()</code>.
-   **/
+   *
+   * @note Whether a cell is a ghost cell, artificial, or is
+   * locally owned or is a property that only pertains to cells
+   * that are active. Consequently,
+   * you can only call this function if the cell it refers to has
+   * no children.
+   */
   bool is_locally_owned () const;
 
+  /**
+   * Return true if either the Triangulation is not distributed or if
+   * level_subdomain_id() is equal to the id of the current processor.
+   */
+  bool is_locally_owned_on_level () const;
+
   /**
    * Return whether this cell
    * exists in the global mesh but
@@ -2969,6 +3026,12 @@ public:
    * @post The returned value is equal to
    * <code>!is_locally_owned() &&
    * !is_artificial()</code>.
+   *
+   * @note Whether a cell is a ghost cell, artificial, or is
+   * locally owned or is a property that only pertains to cells
+   * that are active. Consequently,
+   * you can only call this function if the cell it refers to has
+   * no children.
    */
   bool is_ghost () const;
 
@@ -3007,6 +3070,12 @@ public:
    * @post The returned value is equal to
    * <code>!is_ghost() &&
    * !is_artificial()</code>.
+   *
+   * @note Whether a cell is a ghost cell, artificial, or is
+   * locally owned or is a property that only pertains to cells
+   * that are active. Consequently,
+   * you can only call this function if the cell it refers to has
+   * no children.
    */
   bool is_artificial () const;
 
@@ -3051,6 +3120,15 @@ public:
   void set_neighbor (const unsigned int i,
                      const TriaIterator<CellAccessor<dim, spacedim> > &pointer) const;
 
+  /**
+   * Return a unique ID for the current cell. This ID is constructed from the
+   * path in the hierarchy from the coarse father cell and works correctly
+   * in parallel computations.
+   *
+   * Note: This operation takes O(log(level)) time.
+   */
+  CellId id() const;
+
   /**
    * @}
    */
@@ -3231,6 +3309,39 @@ CellAccessor (const TriaAccessor<structdim2,dim2,spacedim2> &)
                       "the conversion is not valid in the current context."));
 }
 
+template <int dim, int spacedim>
+CellId
+CellAccessor<dim,spacedim>::id() const
+{
+  std::vector<unsigned char> id(this->level(), -1);
+  unsigned int coarse_index;
+
+  CellAccessor<dim,spacedim> ptr = *this;
+  while (ptr.level()>0)
+    {
+      // find the 'v'st child of our parent we are
+      unsigned char v=-1;
+      for (unsigned int c=0; c<ptr.parent()->n_children(); ++c)
+        {
+          if (ptr.parent()->child_index(c)==ptr.index())
+            {
+              v = c;
+              break;
+            }
+        }
+
+      Assert(v != (unsigned char)-1, ExcInternalError());
+      id[ptr.level()-1] = v;
+
+      ptr.copy_from( *(ptr.parent()));
+    }
+
+  Assert(ptr.level()==0, ExcInternalError());
+  coarse_index = ptr.index();
+
+  return CellId(coarse_index, id);
+}
+
 
 #ifndef DOXYGEN
 
index be5a6c8fb10abaa50eb10e4b946beb3df2137667..6e153eb07523334d41f57308cb6821e1b7214520 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_accessor_templates_h
 #define __deal2__tria_accessor_templates_h
 
@@ -136,6 +141,22 @@ TriaAccessorBase<structdim,dim,spacedim>::operator != (const TriaAccessorBase<st
 
 
 
+template <int structdim, int dim, int spacedim>
+inline
+bool
+TriaAccessorBase<structdim,dim,spacedim>::operator < (const TriaAccessorBase<structdim,dim,spacedim> &other) const
+{
+  Assert (tria == other.tria, TriaAccessorExceptions::ExcCantCompareIterators());
+
+  if (present_level != other.present_level)
+    return (present_level < other.present_level);
+
+  return (present_index < other.present_index);
+
+}
+
+
+
 template <int structdim, int dim, int spacedim>
 inline
 int
@@ -2989,11 +3010,11 @@ inline
 bool
 CellAccessor<dim,spacedim>::is_locally_owned () const
 {
+  Assert (this->active(), ExcMessage("is_locally_owned() only works on active cells!"));
 #ifndef DEAL_II_WITH_P4EST
   return true;
 #else
-  const types::subdomain_id subdomain = this->subdomain_id();
-  if (subdomain == numbers::artificial_subdomain_id)
+  if (is_artificial())
     return false;
 
   const parallel::distributed::Triangulation<dim,spacedim> *pdt
@@ -3002,7 +3023,26 @@ CellAccessor<dim,spacedim>::is_locally_owned () const
   if (pdt == 0)
     return true;
   else
-    return (subdomain == pdt->locally_owned_subdomain());
+    return (this->subdomain_id() == pdt->locally_owned_subdomain());
+#endif
+}
+
+
+template <int dim, int spacedim>
+inline
+bool
+CellAccessor<dim,spacedim>::is_locally_owned_on_level () const
+{
+#ifndef DEAL_II_WITH_P4EST
+  return true;
+#else
+  const parallel::distributed::Triangulation<dim,spacedim> *pdt
+    = dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim> *>(this->tria);
+
+  if (pdt == 0)
+    return true;
+  else
+    return (this->level_subdomain_id() == pdt->locally_owned_subdomain());
 #endif
 }
 
@@ -3012,11 +3052,11 @@ inline
 bool
 CellAccessor<dim,spacedim>::is_ghost () const
 {
+  Assert (this->active(), ExcMessage("is_ghost() only works on active cells!"));
 #ifndef DEAL_II_WITH_P4EST
   return false;
 #else
-  const types::subdomain_id subdomain = this->subdomain_id();
-  if (subdomain == numbers::artificial_subdomain_id)
+  if (is_artificial() || this->has_children())
     return false;
 
   const parallel::distributed::Triangulation<dim,spacedim> *pdt
@@ -3025,7 +3065,7 @@ CellAccessor<dim,spacedim>::is_ghost () const
   if (pdt == 0)
     return false;
   else
-    return (subdomain != pdt->locally_owned_subdomain());
+    return (this->subdomain_id() != pdt->locally_owned_subdomain());
 #endif
 }
 
@@ -3036,10 +3076,11 @@ inline
 bool
 CellAccessor<dim,spacedim>::is_artificial () const
 {
+  Assert (this->active(), ExcMessage("is_artificial() only works on active cells!"));
 #ifndef DEAL_II_WITH_P4EST
   return false;
 #else
-  return (this->subdomain_id() == numbers::artificial_subdomain_id);
+  return this->subdomain_id() == numbers::artificial_subdomain_id;
 #endif
 }
 
@@ -3060,6 +3101,26 @@ CellAccessor<dim,spacedim>::neighbor_face_no (const unsigned int neighbor) const
     return neighbor_of_coarser_neighbor(neighbor).first;
 }
 
+
+template <int dim, int spacedim>
+inline
+bool
+CellAccessor<dim,spacedim>::operator < (const CellAccessor<dim,spacedim> &other) const
+{
+  Assert (this->tria == other.tria, TriaAccessorExceptions::ExcCantCompareIterators());
+
+  if (level_subdomain_id() != other.level_subdomain_id())
+    return (level_subdomain_id() < other.level_subdomain_id());
+
+  if (active() && other.active() &&
+      (subdomain_id() != other.subdomain_id()))
+    return (subdomain_id() < other.subdomain_id());
+
+  return TriaAccessorBase<dim,dim,spacedim>::operator < (other);
+}
+
+
+
 DEAL_II_NAMESPACE_CLOSE
 
 #endif
index bf893b821405ea9446081518ae25dde0c3826422..ba830652009fd7ca89fa0cb4ff92d06d50448ad7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_boundary_h
 #define __deal2__tria_boundary_h
 
index b482962bf104b50455dfa5421b3162ede9e828e9..2f683b964ed3ac41c39c16db5429d05fc9ee9e06 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_boundary_lib_h
 #define __deal2__tria_boundary_lib_h
 
index 0ca056b63cc215dfff2478df827381c5e4dff4d6..4a790c4d2181808f8c23a6348ec88765cd000acc 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_faces_h
 #define __deal2__tria_faces_h
 
index dc75dd12420371c92612ef9bfdda1dcbf2219d37..07321efd840c080dfaa646c23d5713d0bcc9f375 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_iterator_h
 #define __deal2__tria_iterator_h
 
@@ -264,7 +269,7 @@ public:
    *   = accessor;
    * @endcode
    */
-  TriaRawIterator (const Accessor &a);
+  explicit TriaRawIterator (const Accessor &a);
 
   /**
    * Constructor. Assumes that the
@@ -273,7 +278,7 @@ public:
    * one.
    */
   template <typename OtherAccessor>
-  TriaRawIterator (const OtherAccessor &a);
+  explicit TriaRawIterator (const OtherAccessor &a);
 
   /**
    *  Proper constructor, initialized
@@ -436,21 +441,36 @@ public:
   bool operator != (const TriaRawIterator &) const;
 
   /**
-   * Offer a weak ordering of iterators,
-   * which is needed to make @p maps with
-   * iterators being keys. An iterator
-   * pointing to an element @p a is
-   * less than another iterator pointing
-   * to an element @p b if
-   * level(a)<level(b) or
-   * (level(a)==level(b) and index(a)<index(b)).
+   * Ordering relation for iterators.
+   *
+   * This relation attempts a total ordering of cells. For lower
+   * dimensional objects on distributed meshes, we only attempt a
+   * partial ordering.
+   *
+   * The relation is defined as follows:
+   *
+   * For objects of <tt>Accessor::structure_dimension <
+   * Accessor::dimension</tt>, we simply compare the index of such an
+   * object. This consitutes an ordering of the elements of same
+   * dimension on a mesh on a single process. For a distributed mesh,
+   * the result of the ordering relation between faces across
+   * processes is not defined, but most likely irrelevant.
    *
-   * Comparing iterators of which one or
-   * both are invalid is an error. The
-   * past-the-end iterator is always
-   * ordered last. Two past-the-end
-   * iterators rank the same, thus false
-   * is returned in that case.
+   * For cells, there is a total ordering even in a
+   * distributed::parallel::Triangulation. The ordering is lexicographic
+   * according to the following hierarchy (in the sense, that the next
+   * test is only applied if the previous was inconclusive):
+   *
+   * <ol>
+   * <li> The past-the-end iterator is always ordered last. Two
+   * past-the-end iterators rank the same, thus false is returned in
+   * that case.</li>
+   *
+   * <li> The level subdomain id</li>
+   * <li> If both cells are active, the subdomain id.</li>
+   * <li> The level of the cell.</li>
+   * <li> The index of a cell inside the level.</li>
+   * </ol>
    */
   bool operator < (const TriaRawIterator &) const;
 
@@ -670,6 +690,13 @@ public:
                 const int                 index,
                 const typename Accessor::AccessorData *local_data = 0);
 
+  /**
+   * Construct from an accessor of type OtherAccessor that is convertible
+   * to the type Accessor.
+   */
+  template <typename OtherAccessor>
+  explicit TriaIterator (const OtherAccessor &a);
+
   /**
    * This is a conversion operator
    * (constructor) which takes another
@@ -1155,39 +1182,21 @@ TriaRawIterator<Accessor>::state () const
 template <typename Accessor>
 inline
 bool
-TriaRawIterator<Accessor>::operator < (const TriaRawIterator &i) const
+TriaRawIterator<Accessor>::operator < (const TriaRawIterator<Accessor> &other) const
 {
-  Assert (Accessor::structure_dimension!=Accessor::dimension ||
-          state() != IteratorState::invalid,
-          ExcDereferenceInvalidCell(accessor));
-  Assert (Accessor::structure_dimension==Accessor::dimension ||
-          state() != IteratorState::invalid,
-          ExcDereferenceInvalidObject(accessor));
+  Assert (state() != IteratorState::invalid, ExcDereferenceInvalidObject(accessor));
+  Assert (other.state() != IteratorState::invalid, ExcDereferenceInvalidObject(other.accessor));
 
-  Assert (Accessor::structure_dimension!=Accessor::dimension ||
-          i.state() != IteratorState::invalid,
-          ExcDereferenceInvalidCell(i.accessor));
-  Assert (Accessor::structure_dimension==Accessor::dimension ||
-          i.state() != IteratorState::invalid,
-          ExcDereferenceInvalidObject(i.accessor));
-
-  Assert (&accessor.get_triangulation() == &i.accessor.get_triangulation(),
+  Assert (&accessor.get_triangulation() == &other.accessor.get_triangulation(),
           ExcInvalidComparison());
 
-  if (Accessor::structure_dimension==Accessor::dimension)
-    return ((((accessor.level() < i.accessor.level()) ||
-              ((accessor.level() == i.accessor.level()) &&
-               (accessor.index() < i.accessor.index()))        ) &&
-             (state()==IteratorState::valid)                     &&
-             (i.state()==IteratorState::valid)                 ) ||
-            ((state()==IteratorState::valid) &&
-             (i.state()==IteratorState::past_the_end)));
-  else
-    return ((((accessor.index() < i.accessor.index())          ) &&
-             (state()==IteratorState::valid)                     &&
-             (i.state()==IteratorState::valid)                 ) ||
-            ((state()==IteratorState::valid) &&
-             (i.state()==IteratorState::past_the_end)));
+  // Deal with iterators past end
+  if (state()==IteratorState::past_the_end)
+    return false;
+  if (other.state()==IteratorState::past_the_end)
+    return true;
+
+  return ((**this) < (*other));
 }
 
 
@@ -1281,7 +1290,24 @@ TriaIterator<Accessor>::TriaIterator (const TriaRawIterator<OtherAccessor> &i)
 #endif
 }
 
-
+template <typename Accessor>
+template <typename OtherAccessor>
+TriaIterator<Accessor>::TriaIterator (const OtherAccessor &a)
+  :
+  TriaRawIterator<Accessor> (a)
+{
+#ifdef DEBUG
+  // do this like this, because:
+  // if we write
+  // "Assert (IteratorState::past_the_end || used)"
+  // used() is called anyway, even if
+  // state==IteratorState::past_the_end, and will then
+  // throw the exception!
+  if (this->state() != IteratorState::past_the_end)
+    Assert (this->accessor.used(),
+            ExcAssignmentOfUnusedObject());
+#endif
+}
 
 template <typename Accessor>
 template <typename OtherAccessor>
index 2abfb1cf6d3ede5430d9c1f4dc1152dcc7bb118a..7ac87c26df95194490a0b7212fe00c8de192a47a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_iterator_templates_h
 #define __deal2__tria_iterator_templates_h
 
index 4db7062c8b30564d4f06a2f05712e679f67161bb..ed95f82ec77331b3faf4088df9b15843aeccfe13 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_iterator_base_h
 #define __deal2__tria_iterator_base_h
 
index 21e45ecd114dbca111e67b015fe0fad0066d06a2..901641004dc5f3a072e0c6a12453adee0005c912 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_iterator_selector_h
 #define __deal2__tria_iterator_selector_h
 
index da4669901a2776d77f5e2da10a18fc1624e0fda6..1bdc99ab65f6cdd0a67534686d4765b8f9a57f83 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_levels_h
 #define __deal2__tria_levels_h
 
index a7c45ad371f4762d0e9ec17157543f0dc44d5b1c..a3e9a8045d1ce68fd2e497e6833c07d0303ffe06 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_object_h
 #define __deal2__tria_object_h
 
index 6c58fa78f6be0a756fa9f9146b483468fd46d04a..22965b0918e0d74f778ae38dca5090da926b6f84 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tria_objects_h
 #define __deal2__tria_objects_h
 
index 4896d69b1e246002966154108c8e23bb24bbd847..bc7129518d46dbf820b065f1af615fb97324af6d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__hp_dof_faces_h
 #define __deal2__hp_dof_faces_h
 
@@ -43,7 +48,7 @@ namespace internal
      * independent of the hierarchical structure of cells, which are organized in levels. In 2D
      * we store information on degrees of freedom located on lines whereas in 3D we store
      * information on drefrees of freedom located on quads and lines. In 1D we do nothing, as
-     * the faces of lines are vertices which are treated seperately.
+     * the faces of lines are vertices which are treated separately.
      *
      * Apart from the internal::hp::DoFObjects object containing the data to store
      * (degree of freedom indices) and all the access-functionality to this data, we do not
@@ -81,7 +86,7 @@ namespace internal
 
     /**
      * Store the indices of degrees of freedom on faces in 1D. As these would be vertices, which
-     * are treted seperately, don't do anything.
+     * are treted separately, don't do anything.
      *
      * @ingroup hp
      * @author Tobias Leicht, 2006
index e9c7928db90fc105441689c1e4de536c61f4d70d..1baba2752622f46166f2334f8adb1bdd3d4a7059 100644 (file)
@@ -1,14 +1,19 @@
-//----------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__hp_dof_handler_h
 #define __deal2__hp_dof_handler_h
 
@@ -136,7 +141,7 @@ namespace hp
      * certain value, but rather take
      * its symbolic name.
      */
-    static const unsigned int invalid_dof_index = numbers::invalid_unsigned_int;
+    static const types::global_dof_index invalid_dof_index = numbers::invalid_dof_index;
 
     /**
      * The default index of the
@@ -254,7 +259,7 @@ namespace hp
      * number of the degree of
      * freedom referenced.
      */
-    void renumber_dofs (const std::vector<unsigned int> &new_numbers);
+    void renumber_dofs (const std::vector<types::global_dof_index> &new_numbers);
 
     /**
      * Return the maximum number of
@@ -310,9 +315,17 @@ namespace hp
     cell_iterator        begin       (const unsigned int level = 0) const;
 
     /**
-    * Iterator to the first active
-    * cell on level @p level.
-    */
+     *  Iterator to the first active cell on level @p level. If the
+     *  given level does not contain any active cells (i.e., all cells
+     *  on this level are further refined, then this function returns
+     *  <code>end_active(level)</code> so that loops of the kind
+     *  @code
+     *    for (cell=dof_handler.begin_active(level); cell!=dof_handler.end_active(level); ++cell)
+     *      ...
+     *  @endcode
+     *  have zero iterations, as may be expected if there are no active
+     *  cells on this level.
+     */
     active_cell_iterator begin_active(const unsigned int level = 0) const;
 
     /**
@@ -334,12 +347,10 @@ namespace hp
     cell_iterator        end (const unsigned int level) const;
 
     /**
-    * Return an active iterator
-    * which is the first iterator
-    * not on level. If @p level is
-    * the last level, then this
-    * returns <tt>end()</tt>.
-    */
+     * Return an active iterator which is the first active iterator not
+     * on the given level. If @p level is the last level, then this
+     * returns <tt>end()</tt>.
+     */
     active_cell_iterator end_active (const unsigned int level) const;
 
     /*@}*/
@@ -378,7 +389,7 @@ namespace hp
      * DoFs which are constrained by
      * hanging nodes, see @ref constraints.
      */
-    unsigned int n_dofs () const;
+    types::global_dof_index n_dofs () const;
 
     /**
     * The number of multilevel
@@ -389,13 +400,13 @@ namespace hp
     * numbers::invalid_unsigned
     * int independent of its argument.
     */
-    unsigned int n_dofs(const unsigned int level) const;
+    types::global_dof_index n_dofs(const unsigned int level) const;
 
     /**
      * Return the number of degrees of freedom
      * located on the boundary.
      */
-    unsigned int n_boundary_dofs () const;
+    types::global_dof_index n_boundary_dofs () const;
 
     /**
      * Return the number of degrees
@@ -410,7 +421,7 @@ namespace hp
      * @p make_boundary_sparsity_pattern
      * function.
      */
-    unsigned int
+    types::global_dof_index
     n_boundary_dofs (const FunctionMap &boundary_indicators) const;
 
     /**
@@ -421,7 +432,7 @@ namespace hp
      * indicators under
      * consideration.
      */
-    unsigned int
+    types::global_dof_index
     n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const;
 
     /**
@@ -454,7 +465,7 @@ namespace hp
      * cells are also not necessarily
      * included.
      */
-    unsigned int n_locally_owned_dofs() const;
+    types::global_dof_index n_locally_owned_dofs() const;
 
     /**
      * Return an IndexSet describing
@@ -512,7 +523,7 @@ namespace hp
      * then the vector has a single
      * element equal to n_dofs().
      */
-    const std::vector<unsigned int> &
+    const std::vector<types::global_dof_index> &
     n_locally_owned_dofs_per_processor () const;
 
     /**
@@ -577,7 +588,7 @@ namespace hp
      * Exception
      */
     DeclException1 (ExcNewNumbersNotConsecutive,
-                    int,
+                    types::global_dof_index,
                     << "The given list of new dof indices is not consecutive: "
                     << "the index " << arg1 << " does not exist.");
     /**
@@ -662,8 +673,8 @@ namespace hp
     public:
       MGVertexDoFs ();
       ~MGVertexDoFs ();
-      unsigned int get_index (const unsigned int level, const unsigned int dof_number) const;
-      void set_index (const unsigned int level, const unsigned int dof_number, const unsigned int index);
+      types::global_dof_index get_index (const unsigned int level, const unsigned int dof_number) const;
+      void set_index (const unsigned int level, const unsigned int dof_number, const types::global_dof_index index);
     };
 
     /**
@@ -672,10 +683,10 @@ namespace hp
     void clear_space ();
 
     template<int structdim>
-    unsigned int get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const;
+    types::global_dof_index get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const;
 
     template<int structdim>
-    void set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index) const;
+    void set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index) const;
 
     /**
      *  Create default tables for
@@ -716,7 +727,7 @@ namespace hp
      * distribute_dofs().
      */
     void
-    compute_vertex_dof_identities (std::vector<unsigned int> &new_dof_indices) const;
+    compute_vertex_dof_identities (std::vector<types::global_dof_index> &new_dof_indices) const;
 
     /**
      * Compute identities between
@@ -725,7 +736,7 @@ namespace hp
      * distribute_dofs().
      */
     void
-    compute_line_dof_identities (std::vector<unsigned int> &new_dof_indices) const;
+    compute_line_dof_identities (std::vector<types::global_dof_index> &new_dof_indices) const;
 
     /**
      * Compute identities between
@@ -734,7 +745,7 @@ namespace hp
      * distribute_dofs().
      */
     void
-    compute_quad_dof_identities (std::vector<unsigned int> &new_dof_indices) const;
+    compute_quad_dof_identities (std::vector<types::global_dof_index> &new_dof_indices) const;
 
     /**
      * Renumber the objects with
@@ -761,16 +772,16 @@ namespace hp
      * co-located on the same
      * entity.
      */
-    void renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+    void renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                                  dealii::internal::int2type<0>);
 
-    void renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+    void renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                                  dealii::internal::int2type<1>);
 
-    void renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+    void renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                                  dealii::internal::int2type<2>);
 
-    void renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+    void renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                                  dealii::internal::int2type<3>);
 
     /**
@@ -826,7 +837,7 @@ namespace hp
      * actual data format used to
      * the present class.
      */
-    std::vector<unsigned int>      vertex_dofs;
+    std::vector<types::global_dof_index>      vertex_dofs;
 
     /**
      * For each vertex in the
@@ -849,7 +860,7 @@ namespace hp
      * actual data format used to
      * the present class.
      */
-    std::vector<unsigned int>      vertex_dofs_offsets;
+    std::vector<types::global_dof_index>      vertex_dofs_offsets;
 
     std::vector<MGVertexDoFs> mg_vertex_dofs;
 
@@ -903,7 +914,7 @@ namespace hp
 
   template <int dim, int spacedim>
   inline
-  unsigned int
+  types::global_dof_index
   DoFHandler<dim,spacedim>::n_dofs () const
   {
     return number_cache.n_global_dofs;
@@ -912,15 +923,15 @@ namespace hp
 
   template <int dim, int spacedim>
   inline
-  unsigned int
+  types::global_dof_index
   DoFHandler<dim,spacedim>::n_dofs (const unsigned int) const
   {
-    return numbers::invalid_unsigned_int;
+    return numbers::invalid_dof_index;
   }
 
 
   template <int dim, int spacedim>
-  unsigned int
+  types::global_dof_index
   DoFHandler<dim, spacedim>::n_locally_owned_dofs() const
   {
     return number_cache.n_locally_owned_dofs;
@@ -936,7 +947,7 @@ namespace hp
 
 
   template <int dim, int spacedim>
-  const std::vector<unsigned int> &
+  const std::vector<types::global_dof_index> &
   DoFHandler<dim, spacedim>::n_locally_owned_dofs_per_processor() const
   {
     return number_cache.n_locally_owned_dofs_per_processor;
@@ -988,7 +999,7 @@ namespace hp
 
   template<int dim, int spacedim>
   inline
-  unsigned int DoFHandler<dim, spacedim>::MGVertexDoFs::get_index (const unsigned int,
+  types::global_dof_index DoFHandler<dim, spacedim>::MGVertexDoFs::get_index (const unsigned int,
       const unsigned int) const
   {
     Assert (false, ExcNotImplemented ());
@@ -999,7 +1010,7 @@ namespace hp
   inline
   void DoFHandler<dim, spacedim>::MGVertexDoFs::set_index (const unsigned int,
                                                            const unsigned int,
-                                                           const unsigned int)
+                                                           types::global_dof_index)
   {
     Assert (false, ExcNotImplemented ());
   }
@@ -1012,5 +1023,3 @@ namespace hp
 DEAL_II_NAMESPACE_CLOSE
 
 #endif
-
-
index f310c7dce78299b1d26e44c44abcad32a7c7ca32..9bc69d2143b3415d73e743230bd7d60ee05bdf38 100644 (file)
@@ -1,14 +1,19 @@
-//----------------------------  hp_dof_levels.h  ------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  hp_dof_levels.h  ------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__hp_dof_levels_h
 #define __deal2__hp_dof_levels_h
 
index e67564239883e74fc4cc0d690cacd1e16a097261..54aee6dc7045d7cb13a1670adfe2cc90792e9313 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__hp_dof_objects_h
 #define __deal2__hp_dof_objects_h
 
@@ -101,7 +106,7 @@ namespace internal
        * the degrees of freedom of each
        * hex in the @p hex_dofs array.
        */
-      std::vector<unsigned int> dof_offsets;
+      std::vector<types::global_dof_index> dof_offsets;
 
       /**
        * Store the global indices of
@@ -109,7 +114,7 @@ namespace internal
        * DoFLevel() for detailed
        * information.
        */
-      std::vector<unsigned int> dofs;
+      std::vector<types::global_dof_index > dofs;
 
       /**
        * Set the global index of
@@ -142,7 +147,7 @@ namespace internal
                      const unsigned int               obj_index,
                      const unsigned int               fe_index,
                      const unsigned int               local_index,
-                     const unsigned int               global_index,
+                     const types::global_dof_index    global_index,
                      const unsigned int               obj_level);
 
       /**
@@ -169,7 +174,7 @@ namespace internal
        * information.
        */
       template <int dimm, int spacedim>
-      unsigned int
+      types::global_dof_index
       get_dof_index (const dealii::hp::DoFHandler<dimm,spacedim> &dof_handler,
                      const unsigned int               obj_index,
                      const unsigned int               fe_index,
@@ -210,7 +215,7 @@ namespace internal
        * on this object.
        */
       template <int dimm, int spacedim>
-      unsigned int
+      types::global_dof_index
       nth_active_fe_index (const dealii::hp::DoFHandler<dimm,spacedim> &dof_handler,
                            const unsigned int               obj_level,
                            const unsigned int               obj_index,
@@ -243,7 +248,7 @@ namespace internal
     template <int dim>
     template <int dimm, int spacedim>
     inline
-    unsigned int
+    types::global_dof_index
     DoFObjects<dim>::
     get_dof_index (const dealii::hp::DoFHandler<dimm,spacedim> &dof_handler,
                    const unsigned int                obj_index,
@@ -272,7 +277,7 @@ namespace internal
       // make sure we are on an
       // object for which DoFs have
       // been allocated at all
-      Assert (dof_offsets[obj_index] != numbers::invalid_unsigned_int,
+      Assert (dof_offsets[obj_index] != numbers::invalid_dof_index,
               ExcMessage ("You are trying to access degree of freedom "
                           "information for an object on which no such "
                           "information is available"));
@@ -304,17 +309,18 @@ namespace internal
           // an exception if we can't
           // find a set for this
           // particular fe_index
-          const unsigned int starting_offset = dof_offsets[obj_index];
-          const unsigned int *pointer        = &dofs[starting_offset];
+          const types::global_dof_index starting_offset = dof_offsets[obj_index];
+          const types::global_dof_index *pointer        = &dofs[starting_offset];
           while (true)
             {
-              Assert (*pointer != numbers::invalid_unsigned_int,
+              Assert (*pointer != numbers::invalid_dof_index,
                       ExcInternalError());
               if (*pointer == fe_index)
                 return *(pointer + 1 + local_index);
               else
-                pointer += dof_handler.get_fe()[*pointer]
-                           .template n_dofs_per_object<dim>() + 1;
+                pointer += static_cast<types::global_dof_index>(
+                             dof_handler.get_fe()[*pointer]
+                             .template n_dofs_per_object<dim>() + 1);
             }
         }
     }
@@ -330,7 +336,7 @@ namespace internal
                    const unsigned int                obj_index,
                    const unsigned int                fe_index,
                    const unsigned int                local_index,
-                   const unsigned int                global_index,
+                   const types::global_dof_index     global_index,
                    const unsigned int                obj_level)
     {
       Assert ((fe_index != dealii::hp::DoFHandler<dimm,spacedim>::default_fe_index),
@@ -354,7 +360,7 @@ namespace internal
       // make sure we are on an
       // object for which DoFs have
       // been allocated at all
-      Assert (dof_offsets[obj_index] != numbers::invalid_unsigned_int,
+      Assert (dof_offsets[obj_index] != numbers::invalid_dof_index,
               ExcMessage ("You are trying to access degree of freedom "
                           "information for an object on which no such "
                           "information is available"));
@@ -386,11 +392,11 @@ namespace internal
           // an exception if we can't
           // find a set for this
           // particular fe_index
-          const unsigned int starting_offset = dof_offsets[obj_index];
-          unsigned int      *pointer         = &dofs[starting_offset];
+          const types::global_dof_index starting_offset = dof_offsets[obj_index];
+          types::global_dof_index      *pointer         = &dofs[starting_offset];
           while (true)
             {
-              Assert (*pointer != numbers::invalid_unsigned_int,
+              Assert (*pointer != numbers::invalid_dof_index,
                       ExcInternalError());
               if (*pointer == fe_index)
                 {
@@ -426,7 +432,7 @@ namespace internal
       // make sure we are on an
       // object for which DoFs have
       // been allocated at all
-      if (dof_offsets[obj_index] == numbers::invalid_unsigned_int)
+      if (dof_offsets[obj_index] == numbers::invalid_dof_index)
         return 0;
 
       // if we are on a cell, then the
@@ -450,11 +456,11 @@ namespace internal
           // find a set for this
           // particular fe_index
           const unsigned int starting_offset = dof_offsets[obj_index];
-          const unsigned int *pointer        = &dofs[starting_offset];
+          const types::global_dof_index *pointer        = &dofs[starting_offset];
           unsigned int counter = 0;
           while (true)
             {
-              if (*pointer == numbers::invalid_unsigned_int)
+              if (*pointer == numbers::invalid_dof_index)
                 // end of list reached
                 return counter;
               else
@@ -472,7 +478,7 @@ namespace internal
     template <int dim>
     template <int dimm, int spacedim>
     inline
-    unsigned int
+    types::global_dof_index
     DoFObjects<dim>::
     nth_active_fe_index (const dealii::hp::DoFHandler<dimm,spacedim> &dof_handler,
                          const unsigned int                obj_level,
@@ -491,7 +497,7 @@ namespace internal
       // make sure we are on an
       // object for which DoFs have
       // been allocated at all
-      Assert (dof_offsets[obj_index] != numbers::invalid_unsigned_int,
+      Assert (dof_offsets[obj_index] != numbers::invalid_dof_index,
               ExcMessage ("You are trying to access degree of freedom "
                           "information for an object on which no such "
                           "information is available"));
@@ -525,11 +531,11 @@ namespace internal
           // find a set for this
           // particular fe_index
           const unsigned int starting_offset = dof_offsets[obj_index];
-          const unsigned int *pointer        = &dofs[starting_offset];
+          const types::global_dof_index *pointer = &dofs[starting_offset];
           unsigned int counter = 0;
           while (true)
             {
-              Assert (*pointer != numbers::invalid_unsigned_int,
+              Assert (*pointer != numbers::invalid_dof_index,
                       ExcInternalError());
 
               const unsigned int fe_index = *pointer;
@@ -565,7 +571,7 @@ namespace internal
               ExcMessage ("No finite element collection is associated with "
                           "this DoFHandler"));
       Assert (obj_index < dof_offsets.size(),
-              ExcIndexRange (obj_index, 0, dof_offsets.size()));
+              ExcIndexRange (obj_index, 0, static_cast<unsigned int>(dof_offsets.size())));
       Assert ((fe_index != dealii::hp::DoFHandler<dimm,spacedim>::default_fe_index),
               ExcMessage ("You need to specify a FE index when working "
                           "with hp DoFHandlers"));
@@ -575,7 +581,7 @@ namespace internal
       // make sure we are on an
       // object for which DoFs have
       // been allocated at all
-      Assert (dof_offsets[obj_index] != numbers::invalid_unsigned_int,
+      Assert (dof_offsets[obj_index] != numbers::invalid_dof_index,
               ExcMessage ("You are trying to access degree of freedom "
                           "information for an object on which no such "
                           "information is available"));
@@ -606,18 +612,19 @@ namespace internal
           // an exception if we can't
           // find a set for this
           // particular fe_index
-          const unsigned int starting_offset = dof_offsets[obj_index];
-          const unsigned int *pointer        = &dofs[starting_offset];
+          const types::global_dof_index starting_offset = dof_offsets[obj_index];
+          const types::global_dof_index *pointer = &dofs[starting_offset];
           while (true)
             {
-              if (*pointer == numbers::invalid_unsigned_int)
+              if (*pointer == numbers::invalid_dof_index)
                 // end of list reached
                 return false;
               else if (*pointer == fe_index)
                 return true;
               else
-                pointer += dof_handler.get_fe()[*pointer]
-                           .template n_dofs_per_object<dim>() + 1;
+                pointer += static_cast<types::global_dof_index>(
+                             dof_handler.get_fe()[*pointer]
+                             .template n_dofs_per_object<dim>()+1);
             }
         }
     }
index ddafe78b1346fec6acb8fc19d2b942636759daa1..def9cc371ef107237e0b7daab0a7a137ca186905 100644 (file)
@@ -1,14 +1,19 @@
-//----------------------------  fe_collection.h  ---------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  fe_collection.h  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_collection_h
 #define __deal2__fe_collection_h
 
index 4e634cfd03b47d66890e4ce87b89fc16d762064a..fd02273faa2bd55c2dd2a510c3cd5a2993da8118 100644 (file)
@@ -1,14 +1,19 @@
-//----------------------------  hp_fe_values.h  ---------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  hp_fe_values.h  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__hp_fe_values_h
 #define __deal2__hp_fe_values_h
 
index 3e5b925727563b39298744a42f49a182d1256522..512a6872b49d143bf7da262ff8e1bccd63ff88d6 100644 (file)
@@ -1,14 +1,19 @@
-//------------------------  mapping_collection.h  --------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//------------------------  mapping_collection.h  --------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mapping_collection_h
 #define __deal2__mapping_collection_h
 
index 23f6b4df7cf58fd77ac896a854c9b8af8bbeca86..2b556ddb26cc0d9df77700a17698fa06eb2fd738 100644 (file)
@@ -1,14 +1,19 @@
-//----------------------------  q_collection.h  ----------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  q_collection.h  ----------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__q_collection_h
 #define __deal2__q_collection_h
 
index 3587c7ebb8718619588e23734a58bdc0466af883..8a1676220aeca0b73b38b16d45e88c4fd29553b0 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__integrators_advection_h
 #define __deal2__integrators_advection_h
 
index de6b17d6686c1ed368d54c804ffdecd26d7429ed..b78c4777f02a389baf8dec5cc5dd71eaff56455d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__integrators_divergence_h
 #define __deal2__integrators_divergence_h
 
index 33a7ba417827da6d588eb3072312597355de6d3d..d772cf695cc84853ab2bef8aba7b6cf6136e8ba1 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__integrators_elasticity_h
 #define __deal2__integrators_elasticity_h
 
@@ -95,12 +100,12 @@ namespace LocalIntegrators
           const double dx = factor * fe.JxW(k);
           for (unsigned int i=0; i<n_dofs; ++i)
             for (unsigned int d1=0; d1<dim; ++d1)
-             for (unsigned int d2=0; d2<dim; ++d2)
-               {
-                 result(i) += dx * .25 *
-                   (input[d1][k][d2] + input[d2][k][d1]) *
-                   (fe.shape_grad_component(i,k,d1)[d2] + fe.shape_grad_component(i,k,d2)[d1]);
-               }
+              for (unsigned int d2=0; d2<dim; ++d2)
+                {
+                  result(i) += dx * .25 *
+                               (input[d1][k][d2] + input[d2][k][d1]) *
+                               (fe.shape_grad_component(i,k,d1)[d2] + fe.shape_grad_component(i,k,d2)[d1]);
+                }
         }
     }
 
@@ -191,24 +196,24 @@ namespace LocalIntegrators
               {
                 const double u= input[d1][k];
                 const double v= fe.shape_value_component(i,k,d1);
-               const double g= data[d1][k];
-               result(i) += dx + 2.*penalty * (u-g) * v;
-               
-               for (unsigned int d2=0; d2<dim; ++d2)
-                 {
-                   // v . nabla u n
-                   result(i) -= .5*dx* v * Dinput[d1][k][d2] * n(d2);
-                   // v . (nabla u)^T n
-                   result(i) -= .5*dx* v * Dinput[d2][k][d1] * n(d2);
-                   // u  nabla v n
-                   result(i) -= .5*dx * (u-g) * fe.shape_grad_component(i,k,d1)[d2] * n(d2);
-                   // u  (nabla v)^T n
-                   result(i) -= .5*dx * (u-g) * fe.shape_grad_component(i,k,d2)[d1] * n(d2);
-                 }
-             }
-       }
+                const double g= data[d1][k];
+                result(i) += dx + 2.*penalty * (u-g) * v;
+
+                for (unsigned int d2=0; d2<dim; ++d2)
+                  {
+                    // v . nabla u n
+                    result(i) -= .5*dx* v * Dinput[d1][k][d2] * n(d2);
+                    // v . (nabla u)^T n
+                    result(i) -= .5*dx* v * Dinput[d2][k][d1] * n(d2);
+                    // u  nabla v n
+                    result(i) -= .5*dx * (u-g) * fe.shape_grad_component(i,k,d1)[d2] * n(d2);
+                    // u  (nabla v)^T n
+                    result(i) -= .5*dx * (u-g) * fe.shape_grad_component(i,k,d2)[d1] * n(d2);
+                  }
+              }
+        }
     }
-    
+
     /**
      * The interior penalty flux
      * for symmetric gradients.
@@ -308,7 +313,7 @@ namespace LocalIntegrators
       double ext_factor = -1.)
     {
       const unsigned int n1 = fe1.dofs_per_cell;
-      
+
       AssertDimension(fe1.get_fe().n_components(), dim);
       AssertDimension(fe2.get_fe().n_components(), dim);
       AssertVectorVectorDimension(input1, dim, fe1.n_quadrature_points);
@@ -325,7 +330,7 @@ namespace LocalIntegrators
         {
           const double dx = fe1.JxW(k);
           const Point<dim> &n = fe1.normal_vector(k);
-         
+
           for (unsigned int i=0; i<n1; ++i)
             for (unsigned int d1=0; d1<dim; ++d1)
               {
@@ -333,27 +338,27 @@ namespace LocalIntegrators
                 const double v2 = fe2.shape_value_component(i,k,d1);
                 const double u1 = input1[d1][k];
                 const double u2 = input2[d1][k];
-               
+
                 result1(i) += dx * penalty * u1*v1;
-               result1(i) -= dx * penalty * u2*v1;
-               result2(i) -= dx * penalty * u1*v2;
+                result1(i) -= dx * penalty * u2*v1;
+                result2(i) -= dx * penalty * u1*v2;
                 result2(i) += dx * penalty * u2*v2;
-               
-               for (unsigned int d2=0; d2<dim; ++d2)
-                 {
-                   // v . nabla u n
-                   result1(i) -= .25*dx* (nu1*Dinput1[d1][k][d2]+nu2*Dinput1[d1][k][d2]) * n(d2) * v1;
-                   result2(i) += .25*dx* (nu1*Dinput1[d1][k][d2]+nu2*Dinput1[d1][k][d2]) * n(d2) * v1;
-                   // v . (nabla u)^T n
-                   result1(i) -= .25*dx* (nu1*Dinput1[d2][k][d1]+nu2*Dinput1[d2][k][d1]) * n(d2) * v1;
-                   result2(i) += .25*dx* (nu1*Dinput1[d2][k][d1]+nu2*Dinput1[d2][k][d1]) * n(d2) * v1;
-                   // u  nabla v n
-                   result1(i) -= .25*dx* nu1*fe1.shape_grad_component(i,k,d1)[d2] * n(d2) * (u1-u2);
-                   result2(i) -= .25*dx* nu2*fe2.shape_grad_component(i,k,d1)[d2] * n(d2) * (u1-u2);
-                   // u  (nabla v)^T n
-                   result1(i) -= .25*dx* nu1*fe1.shape_grad_component(i,k,d2)[d1] * n(d2) * (u1-u2);
-                   result2(i) -= .25*dx* nu2*fe2.shape_grad_component(i,k,d2)[d1] * n(d2) * (u1-u2);
-                 }
+
+                for (unsigned int d2=0; d2<dim; ++d2)
+                  {
+                    // v . nabla u n
+                    result1(i) -= .25*dx* (nu1*Dinput1[d1][k][d2]+nu2*Dinput1[d1][k][d2]) * n(d2) * v1;
+                    result2(i) += .25*dx* (nu1*Dinput1[d1][k][d2]+nu2*Dinput1[d1][k][d2]) * n(d2) * v1;
+                    // v . (nabla u)^T n
+                    result1(i) -= .25*dx* (nu1*Dinput1[d2][k][d1]+nu2*Dinput1[d2][k][d1]) * n(d2) * v1;
+                    result2(i) += .25*dx* (nu1*Dinput1[d2][k][d1]+nu2*Dinput1[d2][k][d1]) * n(d2) * v1;
+                    // u  nabla v n
+                    result1(i) -= .25*dx* nu1*fe1.shape_grad_component(i,k,d1)[d2] * n(d2) * (u1-u2);
+                    result2(i) -= .25*dx* nu2*fe2.shape_grad_component(i,k,d1)[d2] * n(d2) * (u1-u2);
+                    // u  (nabla v)^T n
+                    result1(i) -= .25*dx* nu1*fe1.shape_grad_component(i,k,d2)[d1] * n(d2) * (u1-u2);
+                    result2(i) -= .25*dx* nu2*fe2.shape_grad_component(i,k,d2)[d1] * n(d2) * (u1-u2);
+                  }
               }
         }
     }
index b9e54d79d8d06b1435b82ff4c9ce9bfc142c299b..2313997c040956b002c6b9ba15f36ab648e35719 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__integrators_l2_h
 #define __deal2__integrators_l2_h
 
index 55ffdb0739e3879cb1275b82352979b764dc7d3f..c20eb4beba3f10483f71851f94addd5c873a7817 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__integrators_laplace_h
 #define __deal2__integrators_laplace_h
 
index 22cbef8a6a14bedb2fca6c73b3bafb9ef6b2705c..d3f9a49b6ad07a2d9cd4297f9d5407bafda5d60b 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__integrators_local_integrators_h
 #define __deal2__integrators_local_integrators_h
 
index 578625438a32868eab616064c3086f4a1217181e..d2b43c282bfe4afe8c5f53f3511c75b38b1a77f7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__integrators_maxwell_h
 #define __deal2__integrators_maxwell_h
 
index 7c727ccb52495ac30c78b863280ca6c5f9af5a34..ca2e2e96eae06f43651b7246483e52682bd7f900 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__integrators_patches_h
 #define __deal2__integrators_patches_h
 
index 2c25c8f3c2eb1498c41be7723d40ef7a482b1f05..9c3e1b2c8324da5b1439d2d7ad9ffd3311ce437f 100644 (file)
@@ -1,16 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Authors: Bärbel Janssen, University of Heidelberg,
-//    Agnieszka Miedler, TU Berlin, 2010
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__arpack_solver_h
 #define __deal2__arpack_solver_h
 
@@ -77,6 +80,12 @@ extern "C" void dneupd_(int *rvec, char *howmany, int *select, double *d,
 class ArpackSolver : public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
+
   /**
    * An enum that lists the possible
    * choices for which eigenvalues to
@@ -373,7 +382,7 @@ void ArpackSolver::solve (
               tmp.reinit(src);
 
 
-              for (unsigned int i=0; i<src.size(); ++i)
+              for (size_type i=0; i<src.size(); ++i)
                 src(i) = *(workd+ipntr[0]-1+i);
 
               // multiplication with mass matrix M
@@ -381,7 +390,7 @@ void ArpackSolver::solve (
               // solving linear system
               inverse.vmult(dst,tmp);
 
-              for (unsigned int i=0; i<dst.size(); ++i)
+              for (size_type i=0; i<dst.size(); ++i)
                 *(workd+ipntr[1]-1+i) = dst(i);
             }
             break;
@@ -395,7 +404,7 @@ void ArpackSolver::solve (
               tmp.reinit(src);
               tmp2.reinit(src);
 
-              for (unsigned int i=0; i<src.size(); ++i)
+              for (size_type i=0; i<src.size(); ++i)
                 {
                   src(i) = *(workd+ipntr[2]-1+i);
                   tmp(i) = *(workd+ipntr[0]-1+i);
@@ -403,7 +412,7 @@ void ArpackSolver::solve (
               // solving linear system
               inverse.vmult(dst,src);
 
-              for (unsigned int i=0; i<dst.size(); ++i)
+              for (size_type i=0; i<dst.size(); ++i)
                 *(workd+ipntr[1]-1+i) = dst(i);
             }
             break;
@@ -415,13 +424,13 @@ void ArpackSolver::solve (
               src.reinit(eigenvectors[0]);
               dst.reinit(src);
 
-              for (unsigned int i=0; i<src.size(); ++i)
+              for (size_type i=0; i<src.size(); ++i)
                 src(i) = *(workd+ipntr[0]-1+i);
 
               // Multiplication with mass matrix M
               mass_matrix.vmult(dst, src);
 
-              for (unsigned int i=0; i<dst.size(); ++i)
+              for (size_type i=0; i<dst.size(); ++i)
                 *(workd+ipntr[1]-1+i) = dst(i);
 
             }
@@ -488,7 +497,7 @@ void ArpackSolver::solve (
           Assert (false, ExcArpackInfodneupd(info));
         }
 
-      for (unsigned int i=0; i<eigenvectors.size(); ++i)
+      for (size_type i=0; i<eigenvectors.size(); ++i)
         for (unsigned int j=0; j<n; ++j)
           eigenvectors[i](j) = v[i*n+j];
 
@@ -497,9 +506,9 @@ void ArpackSolver::solve (
       AssertDimension (eigenvalues.size(), eigenvalues_real.size());
       AssertDimension (eigenvalues.size(), eigenvalues_im.size());
 
-      for (unsigned int i=0; i<eigenvalues.size(); ++i)
-       eigenvalues[i] = std::complex<double> (eigenvalues_real[i],
-                                              eigenvalues_im[i]);
+      for (size_type i=0; i<eigenvalues.size(); ++i)
+        eigenvalues[i] = std::complex<double> (eigenvalues_real[i],
+                                               eigenvalues_im[i]);
     }
 }
 
index 19c836bb6c35f10a46e6d6e4401709728611bdc2..7b37682ea04029fee9016056d37b688dc88bed81 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_indices_h
 #define __deal2__block_indices_h
 
@@ -17,6 +22,7 @@
 #include <deal.II/base/subscriptor.h>
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/logstream.h>
+#include <cstddef>
 #include <vector>
 
 DEAL_II_NAMESPACE_OPEN
@@ -49,6 +55,10 @@ DEAL_II_NAMESPACE_OPEN
 class BlockIndices : public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
 
   /**
    * Default
@@ -64,13 +74,13 @@ public:
    * number of blocks will be the
    * size of the vector
    */
-  BlockIndices (const std::vector<unsigned int> &n);
+  BlockIndices (const std::vector<size_type> &n);
 
   /**
    * Specialized constructor for a
    * structure with blocks of equal size.
    */
-  explicit BlockIndices(const unsigned int n_blocks, const unsigned int block_size = 0);
+  explicit BlockIndices(const unsigned int n_blocks, const size_type block_size = 0);
 
   /**
    * Reinitialize the number of
@@ -78,7 +88,7 @@ public:
    * the same number of elements.
    */
   void reinit (const unsigned int n_blocks,
-               const unsigned int n_elements_per_block);
+               const size_type n_elements_per_block);
 
   /**
    * Reinitialize the number of
@@ -89,14 +99,14 @@ public:
    * of block @p i is set to
    * <tt>n[i]</tt>.
    */
-  void reinit (const std::vector<unsigned int> &n);
+  void reinit (const std::vector<size_type> &n);
 
   /**
    * Add another block of given
    * size to the end of the block
    * structure.
    */
-  void push_back(const unsigned int size);
+  void push_back(const size_type size);
 
   /**
    * @name Size information
@@ -115,12 +125,12 @@ public:
    * of the vector space of the
    * block vector.
    */
-  unsigned int total_size () const;
+  size_type total_size () const;
 
   /**
    * The size of the @p ith block.
    */
-  unsigned int block_size (const unsigned int i) const;
+  size_type block_size (const unsigned int i) const;
 
   //@}
 
@@ -147,20 +157,20 @@ public:
    * the block, the second the
    * index within it.
    */
-  std::pair<unsigned int,unsigned int>
-  global_to_local (const unsigned int i) const;
+  std::pair<unsigned int,size_type>
+  global_to_local (const size_type i) const;
 
   /**
    * Return the global index of
    * @p index in block @p block.
    */
-  unsigned int local_to_global (const unsigned int block,
-                                const unsigned int index) const;
+  size_type local_to_global (const unsigned int block,
+                             const size_type index) const;
 
   /**
    * The start index of the ith block.
    */
-  unsigned int block_start (const unsigned int i) const;
+  size_type block_start (const unsigned int i) const;
   //@}
 
   /**
@@ -206,7 +216,7 @@ private:
    * value is the total number of
    * entries.
    */
-  std::vector<unsigned int> start_indices;
+  std::vector<size_type> start_indices;
 };
 
 
@@ -329,11 +339,11 @@ const bool IsBlockMatrix<MatrixType>::value;
 inline
 void
 BlockIndices::reinit (const unsigned int nb,
-                      const unsigned int block_size)
+                      const size_type block_size)
 {
   n_blocks = nb;
   start_indices.resize(n_blocks+1);
-  for (unsigned int i=0; i<=n_blocks; ++i)
+  for (size_type i=0; i<=n_blocks; ++i)
     start_indices[i] = i * block_size;
 }
 
@@ -341,15 +351,15 @@ BlockIndices::reinit (const unsigned int nb,
 
 inline
 void
-BlockIndices::reinit (const std::vector<unsigned int> &n)
+BlockIndices::reinit (const std::vector<size_type> &n)
 {
   if (start_indices.size() != n.size()+1)
     {
-      n_blocks = n.size();
+      n_blocks = static_cast<unsigned int>(n.size());
       start_indices.resize(n_blocks+1);
     }
   start_indices[0] = 0;
-  for (unsigned int i=1; i<=n_blocks; ++i)
+  for (size_type i=1; i<=n_blocks; ++i)
     start_indices[i] = start_indices[i-1] + n[i-1];
 }
 
@@ -366,21 +376,21 @@ BlockIndices::BlockIndices ()
 inline
 BlockIndices::BlockIndices (
   const unsigned int n_blocks,
-  const unsigned int block_size)
+  const size_type block_size)
   :
   n_blocks(n_blocks),
   start_indices(n_blocks+1)
 {
-  for (unsigned int i=0; i<=n_blocks; ++i)
+  for (size_type i=0; i<=n_blocks; ++i)
     start_indices[i] = i * block_size;
 }
 
 
 
 inline
-BlockIndices::BlockIndices (const std::vector<unsigned int> &n)
+BlockIndices::BlockIndices (const std::vector<size_type> &n)
   :
-  n_blocks(n.size()),
+  n_blocks(static_cast<unsigned int>(n.size())),
   start_indices(n.size()+1)
 {
   reinit (n);
@@ -389,7 +399,7 @@ BlockIndices::BlockIndices (const std::vector<unsigned int> &n)
 
 inline
 void
-BlockIndices::push_back(const unsigned int sz)
+BlockIndices::push_back(const size_type sz)
 {
   start_indices.push_back(start_indices[n_blocks]+sz);
   ++n_blocks;
@@ -398,29 +408,29 @@ BlockIndices::push_back(const unsigned int sz)
 
 
 inline
-std::pair<unsigned int,unsigned int>
-BlockIndices::global_to_local (const unsigned int i) const
+std::pair<unsigned int,BlockIndices::size_type>
+BlockIndices::global_to_local (const size_type i) const
 {
-  Assert (i<total_size(), ExcIndexRange(i, 0, total_size()));
-  Assert (n_blocks > 0, ExcLowerRange(i, 1));
+  Assert (i<total_size(), ExcIndexRangeType<size_type>(i, 0, total_size()));
+  Assert (n_blocks > 0, ExcLowerRangeType<size_type>(i, size_type(1)));
 
   unsigned int block = n_blocks-1;
   while (i < start_indices[block])
     --block;
 
-  return std::pair<unsigned int,unsigned int>(block,
-                                              i-start_indices[block]);
+  return std::pair<size_type,size_type>(block,
+                                        i-start_indices[block]);
 }
 
 
 inline
-unsigned int
+BlockIndices::size_type
 BlockIndices::local_to_global (const unsigned int block,
-                               const unsigned int index) const
+                               const size_type index) const
 {
   Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
   Assert (index < start_indices[block+1]-start_indices[block],
-          ExcIndexRange (index, 0, start_indices[block+1]-start_indices[block]));
+          ExcIndexRangeType<size_type> (index, 0, start_indices[block+1]-start_indices[block]));
 
   return start_indices[block]+index;
 }
@@ -436,7 +446,7 @@ BlockIndices::size () const
 
 
 inline
-unsigned int
+BlockIndices::size_type
 BlockIndices::total_size () const
 {
   if (n_blocks == 0) return 0;
@@ -446,7 +456,7 @@ BlockIndices::total_size () const
 
 
 inline
-unsigned int
+BlockIndices::size_type
 BlockIndices::block_size (const unsigned int block) const
 {
   Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
@@ -456,7 +466,7 @@ BlockIndices::block_size (const unsigned int block) const
 
 
 inline
-unsigned int
+BlockIndices::size_type
 BlockIndices::block_start (const unsigned int block) const
 {
   Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
@@ -483,7 +493,7 @@ BlockIndices::operator == (const BlockIndices &b) const
   if (n_blocks != b.n_blocks)
     return false;
 
-  for (unsigned int i=0; i<=n_blocks; ++i)
+  for (size_type i=0; i<=n_blocks; ++i)
     if (start_indices[i] != b.start_indices[i])
       return false;
 
@@ -499,7 +509,7 @@ BlockIndices::swap (BlockIndices &b)
   Assert (n_blocks == b.n_blocks,
           ExcDimensionMismatch(n_blocks, b.n_blocks));
 
-  for (unsigned int i=0; i<=n_blocks; ++i)
+  for (size_type i=0; i<=n_blocks; ++i)
     std::swap (start_indices[i], b.start_indices[i]);
 }
 
index 04c312d8065782e63e8ffd0422c0b55c7ef9242c..97bfc00e2085a3353c8f20bb52ce39db7e52377a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_list_h
 #define __deal2__block_list_h
 
@@ -48,8 +53,13 @@ class BlockList :
   public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /// The container for each index set
-  typedef std::vector<unsigned int> block_container;
+  typedef std::vector<size_type> block_container;
   /// The iterator for individual indices
   typedef block_container::const_iterator const_iterator;
 
@@ -65,7 +75,7 @@ public:
    * argument is the dimension of
    * the vector space.
    */
-  void create_sparsity_pattern(SparsityPattern &sparsity, unsigned int n) const;
+  void create_sparsity_pattern(SparsityPattern &sparsity, size_type n) const;
 
   /**
    * Add the indices in
@@ -73,7 +83,7 @@ public:
    * <tt>block</tt>, eliminating
    * repeated indices.
    */
-  void add(unsigned int block, const std::vector<unsigned int> &indices);
+  void add(size_type block, const std::vector<size_type> &indices);
 
   /**
    * Add the indices in
@@ -83,16 +93,16 @@ public:
    * those indices for which
    * <tt>selected_indices</tt> is true.
    */
-  void add(unsigned int block,
-           const std::vector<unsigned int> &indices,
+  void add(size_type block,
+           const std::vector<size_type> &indices,
            const std::vector<bool> &selected_indices,
-           unsigned int offset = 0);
+           size_type offset = 0);
 
   /**
    * Just set up the correct size
    * and assign indices to blocks later.
    */
-  void initialize(unsigned int n_blocks);
+  void initialize(size_type n_blocks);
 
   /**
    * Set up all index sets using an
@@ -110,7 +120,7 @@ public:
    * blocks as its first argument.
    */
   template <typename ITERATOR>
-  void initialize(unsigned int n_blocks,
+  void initialize(size_type n_blocks,
                   const ITERATOR begin,
                   const typename identity<ITERATOR>::type end);
 
@@ -133,7 +143,7 @@ public:
    * blocks as its first argument.
    */
   template <typename ITERATOR>
-  void initialize_mg(unsigned int n_blocks,
+  void initialize_mg(size_type n_blocks,
                      const ITERATOR begin,
                      const typename identity<ITERATOR>::type end) DEAL_II_DEPRECATED;
 
@@ -169,11 +179,11 @@ public:
    * blocks as its first argument.
    */
   template <typename ITERATOR>
-  void initialize(unsigned int n_blocks,
+  void initialize(size_type n_blocks,
                   const ITERATOR begin,
                   const typename identity<ITERATOR>::type end,
                   const std::vector<bool> &selected_dofs,
-                  unsigned int offset = 0) DEAL_II_DEPRECATED;
+                  size_type offset = 0) DEAL_II_DEPRECATED;
   /**
    * @deprecated This function will
    * move to DoFTools.
@@ -206,11 +216,11 @@ public:
    * blocks as its first argument.
    */
   template <typename ITERATOR>
-  void initialize_mg(unsigned int n_blocks,
+  void initialize_mg(size_type n_blocks,
                      const ITERATOR begin,
                      const typename identity<ITERATOR>::type end,
                      const std::vector<bool> &selected_dofs,
-                     unsigned int offset = 0) DEAL_II_DEPRECATED;
+                     size_type offset = 0) DEAL_II_DEPRECATED;
 
   /**
    * @deprecated This function will
@@ -224,11 +234,11 @@ public:
    * around a vertex.
    */
   template <int dim, typename ITERATOR>
-  void initialize_vertex_patches_mg(unsigned int n_blocks,
+  void initialize_vertex_patches_mg(size_type n_blocks,
                                     const ITERATOR begin,
                                     const typename identity<ITERATOR>::type end,
                                     const std::vector<bool> &selected_dofs = std::vector<bool>(),
-                                    unsigned int offset = 0) DEAL_II_DEPRECATED;
+                                    size_type offset = 0) DEAL_II_DEPRECATED;
 
   /**
    * @deprecated This function will
@@ -255,29 +265,29 @@ public:
   /**
    * The number of blocks.
    */
-  unsigned int size() const;
+  size_type size() const;
 
   /**
    * The size of a single block.
    */
-  unsigned int block_size(unsigned int block) const;
+  size_type block_size(size_type block) const;
 
   /**
    * Iterator to the first index in block.
    */
-  const_iterator begin(unsigned int block) const;
+  const_iterator begin(size_type block) const;
   /**
    * End iterator for a single block.
    */
-  const_iterator end(unsigned int block) const;
+  const_iterator end(size_type block) const;
   /**
    * Return the position of
    * <tt>index</tt> in
    * <tt>block</tt>, or
-   * numbers::invalid_unsigned_int,
+   * numbers::invalid_size_type,
    * if the index is not in the block.
    */
-  unsigned int local_index(unsigned int block, unsigned int index) const;
+  size_type local_index(size_type block, size_type index) const;
 
 private:
   /**
@@ -289,14 +299,14 @@ private:
 
 inline
 void
-BlockList::create_sparsity_pattern(SparsityPattern &sparsity, unsigned int n) const
+BlockList::create_sparsity_pattern(SparsityPattern &sparsity, size_type n) const
 {
   std::vector<unsigned int> sizes(size());
-  for (unsigned int b=0; b<size(); ++b)
+  for (size_type b=0; b<size(); ++b)
     sizes[b] = block_size(b);
 
   sparsity.reinit(size(), n, sizes);
-  for (unsigned int b=0; b<size(); ++b)
+  for (size_type b=0; b<size(); ++b)
     {
       for (const_iterator i = begin(b); i != end(b); ++i)
         sparsity.add(b,*i);
@@ -307,14 +317,14 @@ BlockList::create_sparsity_pattern(SparsityPattern &sparsity, unsigned int n) co
 
 inline
 void
-BlockList::add(const unsigned int block, const std::vector<unsigned int> &indices)
+BlockList::add(const size_type block, const std::vector<size_type> &indices)
 {
   AssertIndexRange(block, index_sets.size());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     {
-      const unsigned int k = indices[i];
-      if (k==numbers::invalid_unsigned_int)
+      const size_type k = indices[i];
+      if (k==numbers::invalid_size_type)
         continue;
       if (std::find(index_sets[block].begin(), index_sets[block].end(), k)
           == index_sets[block].end())
@@ -326,18 +336,18 @@ BlockList::add(const unsigned int block, const std::vector<unsigned int> &indice
 inline
 void
 BlockList::add(
-  const unsigned int block,
-  const std::vector<unsigned int> &indices,
+  const size_type block,
+  const std::vector<size_type> &indices,
   const std::vector<bool> &selected,
-  unsigned int offset)
+  size_type offset)
 {
   AssertIndexRange(block, index_sets.size());
   AssertDimension(indices.size(), selected.size());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     {
-      const unsigned int k = indices[i];
-      if (k==numbers::invalid_unsigned_int)
+      const size_type k = indices[i];
+      if (k==numbers::invalid_size_type)
         continue;
       if (selected[i] && std::find(index_sets[block].begin(), index_sets[block].end(), k-offset)
           == index_sets[block].end())
@@ -348,7 +358,7 @@ BlockList::add(
 
 inline
 void
-BlockList::initialize(unsigned int n_blocks)
+BlockList::initialize(size_type n_blocks)
 {
   index_sets.resize(n_blocks);
 }
@@ -357,11 +367,11 @@ BlockList::initialize(unsigned int n_blocks)
 template <typename ITERATOR>
 inline
 void
-BlockList::initialize(unsigned int n_blocks, const ITERATOR begin, const typename identity<ITERATOR>::type end)
+BlockList::initialize(size_type n_blocks, const ITERATOR begin, const typename identity<ITERATOR>::type end)
 {
   index_sets.resize(n_blocks);
-  std::vector<unsigned int> indices;
-  unsigned int k = 0;
+  std::vector<size_type> indices;
+  size_type k = 0;
   for (ITERATOR cell = begin; cell != end; ++cell, ++k)
     {
       indices.resize(cell->get_fe().dofs_per_cell);
@@ -374,11 +384,11 @@ BlockList::initialize(unsigned int n_blocks, const ITERATOR begin, const typenam
 template <typename ITERATOR>
 inline
 void
-BlockList::initialize_mg(unsigned int n_blocks, const ITERATOR begin, const typename identity<ITERATOR>::type end)
+BlockList::initialize_mg(size_type n_blocks, const ITERATOR begin, const typename identity<ITERATOR>::type end)
 {
   index_sets.resize(n_blocks);
-  std::vector<unsigned int> indices;
-  unsigned int k = 0;
+  std::vector<size_type> indices;
+  size_type k = 0;
   for (ITERATOR cell = begin; cell != end; ++cell, ++k)
     {
       indices.resize(cell->get_fe().dofs_per_cell);
@@ -392,15 +402,15 @@ template <typename ITERATOR>
 inline
 void
 BlockList::initialize(
-  unsigned int n_blocks,
+  size_type n_blocks,
   const ITERATOR begin,
   const typename identity<ITERATOR>::type end,
   const std::vector<bool> &selected_dofs,
-  unsigned int offset)
+  size_type offset)
 {
   index_sets.resize(n_blocks);
-  std::vector<unsigned int> indices;
-  unsigned int k = 0;
+  std::vector<size_type> indices;
+  size_type k = 0;
   for (ITERATOR cell = begin; cell != end; ++cell, ++k)
     {
       indices.resize(cell->get_fe().dofs_per_cell);
@@ -416,15 +426,15 @@ template <typename ITERATOR>
 inline
 void
 BlockList::initialize_mg(
-  unsigned int n_blocks,
+  size_type n_blocks,
   const ITERATOR begin,
   const typename identity<ITERATOR>::type end,
   const std::vector<bool> &selected_dofs,
-  unsigned int offset)
+  size_type offset)
 {
   index_sets.resize(n_blocks);
-  std::vector<unsigned int> indices;
-  unsigned int k = 0;
+  std::vector<size_type> indices;
+  size_type k = 0;
   for (ITERATOR cell = begin; cell != end; ++cell, ++k)
     {
       indices.resize(cell->get_fe().dofs_per_cell);
@@ -494,11 +504,11 @@ template <int dim, typename ITERATOR>
 inline
 void
 BlockList::initialize_vertex_patches_mg(
-  unsigned int n_blocks,
+  size_type n_blocks,
   const ITERATOR begin,
   const typename identity<ITERATOR>::type end,
   const std::vector<bool> &selected_dofs,
-  unsigned int offset)
+  size_type offset)
 {
   Assert(selected_dofs.size() == 0, ExcNotImplemented());
   Assert(offset==0, ExcNotImplemented());
@@ -506,8 +516,8 @@ BlockList::initialize_vertex_patches_mg(
   Assert(fe.dofs_per_vertex == 0, ExcNotImplemented());
 
   index_sets.resize(n_blocks);
-  std::vector<unsigned int> indices;
-  unsigned int k = 0;
+  std::vector<size_type> indices;
+  size_type k = 0;
   for (ITERATOR cell = begin; cell != end; ++cell)
     {
       if (cell_generates_vertex_patch<dim>(cell, true))
@@ -520,52 +530,52 @@ BlockList::initialize_vertex_patches_mg(
               cell->neighbor(4)->get_mg_dof_indices(indices);
               for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                 {
-                  indices[fe.face_to_cell_index(i,1)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,3)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,4)] = numbers::invalid_unsigned_int;
+                  indices[fe.face_to_cell_index(i,1)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,3)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,4)] = numbers::invalid_dof_index;
                 }
               add(k, indices);
               cell->neighbor(4)->neighbor(0)->get_mg_dof_indices(indices);
               for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                 {
-                  indices[fe.face_to_cell_index(i,0)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,3)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,4)] = numbers::invalid_unsigned_int;
+                  indices[fe.face_to_cell_index(i,0)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,3)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,4)] = numbers::invalid_dof_index;
                 }
               add(k, indices);
               cell->neighbor(4)->neighbor(2)->get_mg_dof_indices(indices);
               for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                 {
-                  indices[fe.face_to_cell_index(i,1)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,2)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,4)] = numbers::invalid_unsigned_int;
+                  indices[fe.face_to_cell_index(i,1)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,2)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,4)] = numbers::invalid_dof_index;
                 }
               add(k, indices);
               cell->neighbor(4)->neighbor(2)->neighbor(0)->get_mg_dof_indices(indices);
               for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                 {
-                  indices[fe.face_to_cell_index(i,0)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,2)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,4)] = numbers::invalid_unsigned_int;
+                  indices[fe.face_to_cell_index(i,0)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,2)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,4)] = numbers::invalid_dof_index;
                 }
               add(k, indices);
             case 2:
               cell->neighbor(2)->get_mg_dof_indices(indices);
               for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                 {
-                  indices[fe.face_to_cell_index(i,1)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,2)] = numbers::invalid_unsigned_int;
+                  indices[fe.face_to_cell_index(i,1)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,2)] = numbers::invalid_dof_index;
                   if (dim>2)
-                    indices[fe.face_to_cell_index(i,5)] = numbers::invalid_unsigned_int;
+                    indices[fe.face_to_cell_index(i,5)] = numbers::invalid_dof_index;
                 }
               add(k, indices);
               cell->neighbor(2)->neighbor(0)->get_mg_dof_indices(indices);
               for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                 {
-                  indices[fe.face_to_cell_index(i,0)] = numbers::invalid_unsigned_int;
-                  indices[fe.face_to_cell_index(i,2)] = numbers::invalid_unsigned_int;
+                  indices[fe.face_to_cell_index(i,0)] = numbers::invalid_dof_index;
+                  indices[fe.face_to_cell_index(i,2)] = numbers::invalid_dof_index;
                   if (dim>2)
-                    indices[fe.face_to_cell_index(i,5)] = numbers::invalid_unsigned_int;
+                    indices[fe.face_to_cell_index(i,5)] = numbers::invalid_dof_index;
                 }
               add(k, indices);
               // no break here
@@ -573,21 +583,21 @@ BlockList::initialize_vertex_patches_mg(
               cell->get_mg_dof_indices(indices);
               for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                 {
-                  indices[fe.face_to_cell_index(i,1)] = numbers::invalid_unsigned_int;
+                  indices[fe.face_to_cell_index(i,1)] = numbers::invalid_dof_index;
                   if (dim>1)
-                    indices[fe.face_to_cell_index(i,3)] = numbers::invalid_unsigned_int;
+                    indices[fe.face_to_cell_index(i,3)] = numbers::invalid_dof_index;
                   if (dim>2)
-                    indices[fe.face_to_cell_index(i,5)] = numbers::invalid_unsigned_int;
+                    indices[fe.face_to_cell_index(i,5)] = numbers::invalid_dof_index;
                 }
               add(k, indices);
               cell->neighbor(0)->get_mg_dof_indices(indices);
               for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                 {
-                  indices[fe.face_to_cell_index(i,0)] = numbers::invalid_unsigned_int;
+                  indices[fe.face_to_cell_index(i,0)] = numbers::invalid_dof_index;
                   if (dim>1)
-                    indices[fe.face_to_cell_index(i,3)] = numbers::invalid_unsigned_int;
+                    indices[fe.face_to_cell_index(i,3)] = numbers::invalid_dof_index;
                   if (dim>2)
-                    indices[fe.face_to_cell_index(i,5)] = numbers::invalid_unsigned_int;
+                    indices[fe.face_to_cell_index(i,5)] = numbers::invalid_dof_index;
                 }
               add(k, indices);
               break;
@@ -602,7 +612,7 @@ BlockList::initialize_vertex_patches_mg(
 
 
 inline
-unsigned int
+BlockList::size_type
 BlockList::size() const
 {
   return index_sets.size();
@@ -610,8 +620,8 @@ BlockList::size() const
 
 
 inline
-unsigned int
-BlockList::block_size(unsigned int block) const
+BlockList::size_type
+BlockList::block_size(size_type block) const
 {
   return index_sets[block].size();
 }
@@ -619,7 +629,7 @@ BlockList::block_size(unsigned int block) const
 
 inline
 BlockList::const_iterator
-BlockList::begin(unsigned int block) const
+BlockList::begin(size_type block) const
 {
   AssertIndexRange(block, index_sets.size());
   return index_sets[block].begin();
@@ -628,7 +638,7 @@ BlockList::begin(unsigned int block) const
 
 inline
 BlockList::const_iterator
-BlockList::end(unsigned int block) const
+BlockList::end(size_type block) const
 {
   AssertIndexRange(block, index_sets.size());
   return index_sets[block].end();
@@ -636,15 +646,15 @@ BlockList::end(unsigned int block) const
 
 
 inline
-unsigned int
-BlockList::local_index(unsigned int block, unsigned int index) const
+BlockList::size_type
+BlockList::local_index(size_type block, size_type index) const
 {
   AssertIndexRange(block, index_sets.size());
   const block_container &b = index_sets[block];
-  for (unsigned int i=0; i<b.size(); ++i)
+  for (size_type i=0; i<b.size(); ++i)
     if (b[i] == index)
       return i;
-  return numbers::invalid_unsigned_int;
+  return numbers::invalid_size_type;
 }
 
 
index 7325b5db6aae6a8bd38c6a0b1fb1c5914f67d823..381e90c8b3c53e6c49d461a23f274e45dbe16114 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_matrix_h
 #define __deal2__block_matrix_h
 
index 73420c5353d2a7bcdf5338b20a1490dd7f65033b..6f9a21d10bda62c5173f656942fde25c24a9c467 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_matrix_array_h
 #define __deal2__block_matrix_array_h
 
@@ -123,6 +128,11 @@ template <typename number = double>
 class BlockMatrixArray : public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Default constructor creating a
    * useless object. initialize()
@@ -200,11 +210,11 @@ public:
    * the multiplication functions.
    */
   template <class MATRIX>
-  void enter (const MATRIX      &matrix,
-              const unsigned int row,
-              const unsigned int col,
-              const double       prefix = 1.,
-              const bool         transpose = false);
+  void enter (const MATRIX       &matrix,
+              const unsigned int  row,
+              const unsigned int  col,
+              const double        prefix = 1.,
+              const bool          transpose = false);
 
   /**
    * Add an entry like with enter,
@@ -218,11 +228,11 @@ public:
    */
   template <class MATRIX>
   void enter_aux (VectorMemory<Vector<number> > &mem,
-                  const MATRIX      &matrix,
-                  const unsigned int row,
-                  const unsigned int col,
-                  const double       prefix = 1.,
-                  const bool         transpose = false) DEAL_II_DEPRECATED;
+                  const MATRIX       &matrix,
+                  const unsigned int  row,
+                  const unsigned int  col,
+                  const double        prefix = 1.,
+                  const bool          transpose = false) DEAL_II_DEPRECATED;
 
 
   /**
@@ -332,7 +342,7 @@ protected:
      */
     template<class MATRIX>
     Entry (const MATRIX &matrix,
-           unsigned row, unsigned int col,
+           size_type row, size_type col,
            double prefix, bool transpose);
 
     /**
@@ -362,13 +372,13 @@ protected:
      * Row number in the block
      * matrix.
      */
-    unsigned int row;
+    size_type row;
 
     /**
      * Column number in the block
      * matrix.
      */
-    unsigned int col;
+    size_type col;
 
     /**
      * Factor in front of the matrix
@@ -471,6 +481,11 @@ class BlockTrianglePrecondition
   : private BlockMatrixArray<number>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Default constructor creating a
    * useless object. initialize()
@@ -529,11 +544,11 @@ public:
    * matrices or preconditioners.
    */
   template <class MATRIX>
-  void enter (const MATRIX      &matrix,
-              const unsigned int row,
-              const unsigned int col,
-              const double       prefix = 1.,
-              const bool         transpose = false);
+  void enter (const MATRIX   &matrix,
+              const size_type row,
+              const size_type col,
+              const double    prefix = 1.,
+              const bool      transpose = false);
 
   /**
    * Enter a block. This calls
@@ -548,11 +563,11 @@ public:
    */
   template <class MATRIX>
   void enter_aux (VectorMemory<Vector<double> > &mem,
-                  const MATRIX      &matrix,
-                  const unsigned int row,
-                  const unsigned int col,
-                  const double       prefix = 1.,
-                  const bool         transpose = false) DEAL_II_DEPRECATED;
+                  const MATRIX   &matrix,
+                  const size_type row,
+                  const size_type col,
+                  const double    prefix = 1.,
+                  const bool      transpose = false) DEAL_II_DEPRECATED;
 
   /**
    * Preconditioning.
@@ -609,7 +624,7 @@ public:
    * matrix here.
    */
   DeclException1(ExcNoDiagonal,
-                 unsigned int,
+                 size_type,
                  << "No diagonal entry was added for block " << arg1);
 
   /**
@@ -620,7 +635,7 @@ public:
    * matrix here.
    */
   DeclException1(ExcMultipleDiagonal,
-                 unsigned int,
+                 size_type,
                  << "Inverse diagonal entries may not be added in block "
                  << arg1);
   //@}
@@ -632,7 +647,7 @@ private:
    * for one row.
    */
   void do_row (BlockVector<number> &dst,
-               unsigned int row_num) const;
+               size_type row_num) const;
 
   /**
    * Flag for backward insertion.
@@ -649,8 +664,8 @@ template <class MATRIX>
 inline
 BlockMatrixArray<number>::Entry::Entry (
   const MATRIX &m,
-  unsigned int row,
-  unsigned int col,
+  size_type row,
+  size_type col,
   double prefix,
   bool transpose)
   :
@@ -728,7 +743,7 @@ BlockMatrixArray<number>::print_latex (STREAM &out) const
   typename std::vector<Entry>::const_iterator m = entries.begin();
   typename std::vector<Entry>::const_iterator end = entries.end();
 
-  unsigned int matrix_number = 0;
+  size_type matrix_number = 0;
   for (; m != end ; ++m)
     {
       if (matrix_names.find(m->matrix) == matrix_names.end())
@@ -773,7 +788,7 @@ template <class MATRIX>
 inline
 void
 BlockTrianglePrecondition<number>::enter (const MATRIX &matrix,
-                                          unsigned row, unsigned int col,
+                                          size_type row, size_type col,
                                           double prefix, bool transpose)
 {
   BlockMatrixArray<number>::enter(matrix, row, col, prefix, transpose);
@@ -788,8 +803,8 @@ void
 BlockTrianglePrecondition<number>::enter_aux (
   VectorMemory<Vector<double> > &mem,
   const MATRIX &matrix,
-  unsigned int row,
-  unsigned int col,
+  size_type row,
+  size_type col,
   double prefix,
   bool transpose)
 {
index f98b791278622de43985f1d2aaef010766cfd5f5..56d0067a63f3f2706498545e2bc486419ca6c0ee 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_matrix_base_h
 #define __deal2__block_matrix_base_h
 
@@ -53,6 +58,11 @@ namespace BlockMatrixIterators
   class AccessorBase
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * Typedef the value type of the
      * matrix we point into.
@@ -120,6 +130,11 @@ namespace BlockMatrixIterators
     public AccessorBase<BlockMatrix>
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * Type of the matrix used in
      * this accessor.
@@ -145,22 +160,22 @@ namespace BlockMatrixIterators
      * of rows in the matrix.
      */
     Accessor (BlockMatrix *m,
-              const unsigned int row,
-              const unsigned int col);
+              const size_type row,
+              const size_type col);
 
     /**
      * Row number of the element
      * represented by this
      * object.
      */
-    unsigned int row() const;
+    size_type row() const;
 
     /**
      * Column number of the
      * element represented by
      * this object.
      */
-    unsigned int column() const;
+    size_type column() const;
 
     /**
      * Value of the entry at the
@@ -212,7 +227,12 @@ namespace BlockMatrixIterators
   {
   public:
     /**
-     * Thype of the matrix used in
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
+    /**
+     * Type of the matrix used in
      * this accessor.
      */
     typedef const BlockMatrix MatrixType;
@@ -236,8 +256,8 @@ namespace BlockMatrixIterators
      * of rows in the matrix.
      */
     Accessor (const BlockMatrix *m,
-              const unsigned int row,
-              const unsigned int col);
+              const size_type row,
+              const size_type col);
 
     /**
      * Initalize const accessor
@@ -250,14 +270,14 @@ namespace BlockMatrixIterators
      * represented by this
      * object.
      */
-    unsigned int row() const;
+    size_type row() const;
 
     /**
      * Column number of the
      * element represented by
      * this object.
      */
-    unsigned int column() const;
+    size_type column() const;
 
     /**
      * Value of the entry at the
@@ -376,7 +396,7 @@ public:
   typedef const value_type       *const_pointer;
   typedef value_type             &reference;
   typedef const value_type       &const_reference;
-  typedef std::size_t             size_type;
+  typedef types::global_dof_index size_type;
 
   typedef
   MatrixIterator<BlockMatrixIterators::Accessor<BlockMatrixBase, false> >
@@ -447,7 +467,7 @@ public:
    * matrix is of dimension
    * $m \times n$.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Return the dimension of the
@@ -455,7 +475,7 @@ public:
    * matrix is of dimension
    * $m \times n$.
    */
-  unsigned int n () const;
+  size_type n () const;
 
 
   /**
@@ -483,8 +503,8 @@ public:
    * is allowed to store zero
    * values in non-existent fields.
    */
-  void set (const unsigned int i,
-            const unsigned int j,
+  void set (const size_type i,
+            const size_type j,
             const value_type value);
 
   /**
@@ -515,9 +535,9 @@ public:
    * values are treated.
    */
   template <typename number>
-  void set (const std::vector<unsigned int> &indices,
-            const FullMatrix<number>        &full_matrix,
-            const bool                       elide_zero_values = false);
+  void set (const std::vector<size_type> &indices,
+            const FullMatrix<number>     &full_matrix,
+            const bool                    elide_zero_values = false);
 
   /**
    * Same function as before, but now
@@ -527,10 +547,10 @@ public:
    * on rows and columns, respectively.
    */
   template <typename number>
-  void set (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
-            const FullMatrix<number>        &full_matrix,
-            const bool                       elide_zero_values = false);
+  void set (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
+            const FullMatrix<number>     &full_matrix,
+            const bool                    elide_zero_values = false);
 
   /**
    * Set several elements in the
@@ -551,10 +571,10 @@ public:
    * values are treated.
    */
   template <typename number>
-  void set (const unsigned int               row,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number>       &values,
-            const bool                       elide_zero_values = false);
+  void set (const size_type row,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number>    &values,
+            const bool                    elide_zero_values = false);
 
   /**
    * Set several elements to values
@@ -573,11 +593,11 @@ public:
    * values are inserted/replaced.
    */
   template <typename number>
-  void set (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number       *values,
-            const bool          elide_zero_values = false);
+  void set (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number    *values,
+            const bool       elide_zero_values = false);
 
   /**
    * Add <tt>value</tt> to the
@@ -588,8 +608,8 @@ public:
    * is allowed to store zero
    * values in non-existent fields.
    */
-  void add (const unsigned int i,
-            const unsigned int j,
+  void add (const size_type i,
+            const size_type j,
             const value_type value);
 
   /**
@@ -620,9 +640,9 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const std::vector<unsigned int> &indices,
-            const FullMatrix<number>        &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &indices,
+            const FullMatrix<number>     &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Same function as before, but now
@@ -632,10 +652,10 @@ public:
    * on rows and columns, respectively.
    */
   template <typename number>
-  void add (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
-            const FullMatrix<number>        &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
+            const FullMatrix<number>     &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Set several elements in the
@@ -655,10 +675,10 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const unsigned int               row,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number>       &values,
-            const bool                       elide_zero_values = true);
+  void add (const size_type row,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number>    &values,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add an array of values given by
@@ -678,12 +698,12 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number       *values,
-            const bool          elide_zero_values = true,
-            const bool          col_indices_are_sorted = false);
+  void add (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number    *values,
+            const bool       elide_zero_values = true,
+            const bool       col_indices_are_sorted = false);
 
   /**
    * Add <tt>matrix</tt> scaled by
@@ -711,8 +731,8 @@ public:
    * if the wanted element does not
    * exist in the matrix.
    */
-  value_type operator () (const unsigned int i,
-                          const unsigned int j) const;
+  value_type operator () (const size_type i,
+                          const size_type j) const;
 
   /**
    * This function is mostly like
@@ -731,8 +751,8 @@ public:
    * solution, since the sparsity
    * of the matrix is not used.
    */
-  value_type el (const unsigned int i,
-                 const unsigned int j) const;
+  value_type el (const size_type i,
+                 const size_type j) const;
 
   /**
    * Return the main diagonal element in
@@ -751,7 +771,7 @@ public:
    * involve searching for the
    * right column number.
    */
-  value_type diag_element (const unsigned int i) const;
+  value_type diag_element (const size_type i) const;
 
   /**
    * Call the compress() function on all
@@ -880,12 +900,12 @@ public:
    * STL-like iterator with the
    * first entry of row <tt>r</tt>.
    */
-  iterator begin (const unsigned int r);
+  iterator begin (const size_type r);
 
   /**
    * Final iterator of row <tt>r</tt>.
    */
-  iterator end (const unsigned int r);
+  iterator end (const size_type r);
   /**
    * STL-like iterator with the
    * first entry.
@@ -901,12 +921,12 @@ public:
    * STL-like iterator with the
    * first entry of row <tt>r</tt>.
    */
-  const_iterator begin (const unsigned int r) const;
+  const_iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row <tt>r</tt>.
    */
-  const_iterator end (const unsigned int r) const;
+  const_iterator end (const size_type r) const;
 
   /**
    * Return a reference to the underlying
@@ -1227,7 +1247,7 @@ private:
    * individual blocks when doing a
    * collective add or set.
    */
-  std::vector<unsigned int> counter_within_block;
+  std::vector<size_type> counter_within_block;
 
   /**
    * Temporary vector for column
@@ -1235,7 +1255,7 @@ private:
    * local to global data on each
    * sparse matrix.
    */
-  std::vector<std::vector<unsigned int> > column_indices;
+  std::vector<std::vector<size_type> > column_indices;
 
   /**
    * Temporary vector for storing the
@@ -1304,8 +1324,8 @@ namespace BlockMatrixIterators
   inline
   Accessor<BlockMatrix, true>::Accessor (
     const BlockMatrix  *matrix,
-    const unsigned int  row,
-    const unsigned int  col)
+    const size_type     row,
+    const size_type     col)
     :
     matrix(matrix),
     base_iterator(matrix->block(0,0).begin())
@@ -1316,7 +1336,7 @@ namespace BlockMatrixIterators
     // the end of the matrix
     if (row < matrix->m())
       {
-        const std::pair<unsigned int,unsigned int> indices
+        const std::pair<unsigned int,size_type> indices
           = matrix->row_block_indices.global_to_local(row);
 
         // find the first block that does
@@ -1378,7 +1398,7 @@ namespace BlockMatrixIterators
 
   template <class BlockMatrix>
   inline
-  unsigned int
+  typename Accessor<BlockMatrix, true>::size_type
   Accessor<BlockMatrix, true>::row() const
   {
     Assert (this->row_block != numbers::invalid_unsigned_int,
@@ -1391,7 +1411,7 @@ namespace BlockMatrixIterators
 
   template <class BlockMatrix>
   inline
-  unsigned int
+  typename Accessor<BlockMatrix, true>::size_type
   Accessor<BlockMatrix, true>::column() const
   {
     Assert (this->col_block != numbers::invalid_unsigned_int,
@@ -1428,7 +1448,7 @@ namespace BlockMatrixIterators
             ExcIteratorPastEnd());
 
     // Remember current row inside block
-    unsigned int local_row = base_iterator->row();
+    size_type local_row = base_iterator->row();
 
     // Advance one element inside the
     // current block
@@ -1513,8 +1533,8 @@ namespace BlockMatrixIterators
   inline
   Accessor<BlockMatrix, false>::Accessor (
     BlockMatrix  *matrix,
-    const unsigned int  row,
-    const unsigned int  col)
+    const size_type row,
+    const size_type col)
     :
     matrix(matrix),
     base_iterator(matrix->block(0,0).begin())
@@ -1524,12 +1544,12 @@ namespace BlockMatrixIterators
     // the end of the matrix
     if (row < matrix->m())
       {
-        const std::pair<unsigned int,unsigned int> indices
+        const std::pair<unsigned int,size_type> indices
           = matrix->row_block_indices.global_to_local(row);
 
         // find the first block that does
         // have an entry in this row
-        for (unsigned int bc=0; bc<matrix->n_block_cols(); ++bc)
+        for (size_type bc=0; bc<matrix->n_block_cols(); ++bc)
           {
             base_iterator
               = matrix->block(indices.first, bc).begin(indices.second);
@@ -1554,18 +1574,18 @@ namespace BlockMatrixIterators
       {
         // we were asked to create the end
         // iterator for this matrix
-        this->row_block = numbers::invalid_unsigned_int;
-        this->col_block = numbers::invalid_unsigned_int;
+        this->row_block = numbers::invalid_size_type;
+        this->col_block = numbers::invalid_size_type;
       }
   }
 
 
   template <class BlockMatrix>
   inline
-  unsigned int
+  typename Accessor<BlockMatrix, false>::size_type
   Accessor<BlockMatrix, false>::row() const
   {
-    Assert (this->row_block != numbers::invalid_unsigned_int,
+    Assert (this->row_block != numbers::invalid_size_type,
             ExcIteratorPastEnd());
 
     return (matrix->row_block_indices.local_to_global(this->row_block, 0) +
@@ -1575,10 +1595,10 @@ namespace BlockMatrixIterators
 
   template <class BlockMatrix>
   inline
-  unsigned int
+  typename Accessor<BlockMatrix, false>::size_type
   Accessor<BlockMatrix, false>::column() const
   {
-    Assert (this->col_block != numbers::invalid_unsigned_int,
+    Assert (this->col_block != numbers::invalid_size_type,
             ExcIteratorPastEnd());
 
     return (matrix->column_block_indices.local_to_global(this->col_block,0) +
@@ -1591,9 +1611,9 @@ namespace BlockMatrixIterators
   typename Accessor<BlockMatrix, false>::value_type
   Accessor<BlockMatrix, false>::value () const
   {
-    Assert (this->row_block != numbers::invalid_unsigned_int,
+    Assert (this->row_block != numbers::invalid_size_type,
             ExcIteratorPastEnd());
-    Assert (this->col_block != numbers::invalid_unsigned_int,
+    Assert (this->col_block != numbers::invalid_size_type,
             ExcIteratorPastEnd());
 
     return base_iterator->value();
@@ -1606,9 +1626,9 @@ namespace BlockMatrixIterators
   void
   Accessor<BlockMatrix, false>::set_value (typename Accessor<BlockMatrix, false>::value_type newval) const
   {
-    Assert (this->row_block != numbers::invalid_unsigned_int,
+    Assert (this->row_block != numbers::invalid_size_type,
             ExcIteratorPastEnd());
-    Assert (this->col_block != numbers::invalid_unsigned_int,
+    Assert (this->col_block != numbers::invalid_size_type,
             ExcIteratorPastEnd());
 
     base_iterator->value() = newval;
@@ -1621,13 +1641,13 @@ namespace BlockMatrixIterators
   void
   Accessor<BlockMatrix, false>::advance ()
   {
-    Assert (this->row_block != numbers::invalid_unsigned_int,
+    Assert (this->row_block != numbers::invalid_size_type,
             ExcIteratorPastEnd());
-    Assert (this->col_block != numbers::invalid_unsigned_int,
+    Assert (this->col_block != numbers::invalid_size_type,
             ExcIteratorPastEnd());
 
     // Remember current row inside block
-    unsigned int local_row = base_iterator->row();
+    size_type local_row = base_iterator->row();
 
     // Advance one element inside the
     // current block
@@ -1669,8 +1689,8 @@ namespace BlockMatrixIterators
                 ++this->row_block;
                 if (this->row_block == matrix->n_block_rows())
                   {
-                    this->row_block = numbers::invalid_unsigned_int;
-                    this->col_block = numbers::invalid_unsigned_int;
+                    this->row_block = numbers::invalid_size_type;
+                    this->col_block = numbers::invalid_size_type;
                     return;
                   }
               }
@@ -1697,9 +1717,9 @@ namespace BlockMatrixIterators
       // have to have the same
       // base_iterator representation, but
       // valid iterators have to
-      return (((this->row_block == numbers::invalid_unsigned_int)
+      return (((this->row_block == numbers::invalid_size_type)
                &&
-               (this->col_block == numbers::invalid_unsigned_int))
+               (this->col_block == numbers::invalid_size_type))
               ||
               (base_iterator == a.base_iterator));
 
@@ -1810,7 +1830,7 @@ BlockMatrixBase<MatrixType>::block (const unsigned int row,
 
 template <class MatrixType>
 inline
-unsigned int
+typename BlockMatrixBase<MatrixType>::size_type
 BlockMatrixBase<MatrixType>::m () const
 {
   return row_block_indices.total_size();
@@ -1820,7 +1840,7 @@ BlockMatrixBase<MatrixType>::m () const
 
 template <class MatrixType>
 inline
-unsigned int
+typename BlockMatrixBase<MatrixType>::size_type
 BlockMatrixBase<MatrixType>::n () const
 {
   return column_block_indices.total_size();
@@ -1854,15 +1874,15 @@ BlockMatrixBase<MatrixType>::n_block_rows () const
 template <class MatrixType>
 inline
 void
-BlockMatrixBase<MatrixType>::set (const unsigned int i,
-                                  const unsigned int j,
+BlockMatrixBase<MatrixType>::set (const size_type i,
+                                  const size_type j,
                                   const value_type value)
 {
   prepare_set_operation();
 
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<unsigned int,size_type>
   row_index = row_block_indices.global_to_local (i),
   col_index = column_block_indices.global_to_local (j);
   block(row_index.first,col_index.first).set (row_index.second,
@@ -1876,8 +1896,8 @@ template <class MatrixType>
 template <typename number>
 inline
 void
-BlockMatrixBase<MatrixType>::set (const std::vector<unsigned int> &row_indices,
-                                  const std::vector<unsigned int> &col_indices,
+BlockMatrixBase<MatrixType>::set (const std::vector<size_type> &row_indices,
+                                  const std::vector<size_type> &col_indices,
                                   const FullMatrix<number>        &values,
                                   const bool                       elide_zero_values)
 {
@@ -1886,7 +1906,7 @@ BlockMatrixBase<MatrixType>::set (const std::vector<unsigned int> &row_indices,
   Assert (col_indices.size() == values.n(),
           ExcDimensionMismatch(col_indices.size(), values.n()));
 
-  for (unsigned int i=0; i<row_indices.size(); ++i)
+  for (size_type i=0; i<row_indices.size(); ++i)
     set (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1897,7 +1917,7 @@ template <class MatrixType>
 template <typename number>
 inline
 void
-BlockMatrixBase<MatrixType>::set (const std::vector<unsigned int> &indices,
+BlockMatrixBase<MatrixType>::set (const std::vector<size_type> &indices,
                                   const FullMatrix<number>        &values,
                                   const bool                       elide_zero_values)
 {
@@ -1905,7 +1925,7 @@ BlockMatrixBase<MatrixType>::set (const std::vector<unsigned int> &indices,
           ExcDimensionMismatch(indices.size(), values.m()));
   Assert (values.n() == values.m(), ExcNotQuadratic());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     set (indices[i], indices.size(), &indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1916,10 +1936,10 @@ template <class MatrixType>
 template <typename number>
 inline
 void
-BlockMatrixBase<MatrixType>::set (const unsigned int               row,
-                                  const std::vector<unsigned int> &col_indices,
-                                  const std::vector<number>       &values,
-                                  const bool                       elide_zero_values)
+BlockMatrixBase<MatrixType>::set (const size_type               row,
+                                  const std::vector<size_type> &col_indices,
+                                  const std::vector<number>    &values,
+                                  const bool                    elide_zero_values)
 {
   Assert (col_indices.size() == values.size(),
           ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1937,11 +1957,11 @@ template <class MatrixType>
 template <typename number>
 inline
 void
-BlockMatrixBase<MatrixType>::set (const unsigned int  row,
-                                  const unsigned int  n_cols,
-                                  const unsigned int *col_indices,
-                                  const number       *values,
-                                  const bool          elide_zero_values)
+BlockMatrixBase<MatrixType>::set (const size_type  row,
+                                  const size_type  n_cols,
+                                  const size_type *col_indices,
+                                  const number    *values,
+                                  const bool       elide_zero_values)
 {
   prepare_set_operation();
 
@@ -1986,17 +2006,17 @@ BlockMatrixBase<MatrixType>::set (const unsigned int  row,
   // is stored contiguously (in fact,
   // indices will be intermixed when it
   // comes from an element matrix).
-  for (unsigned int j=0; j<n_cols; ++j)
+  for (size_type j=0; j<n_cols; ++j)
     {
       double value = values[j];
 
       if (value == 0 && elide_zero_values == true)
         continue;
 
-      const std::pair<unsigned int, unsigned int>
+      const std::pair<unsigned int, size_type>
       col_index = this->column_block_indices.global_to_local(col_indices[j]);
 
-      const unsigned int local_index = counter_within_block[col_index.first]++;
+      const size_type local_index = counter_within_block[col_index.first]++;
 
       column_indices[col_index.first][local_index] = col_index.second;
       column_values[col_index.first][local_index] = value;
@@ -2005,7 +2025,7 @@ BlockMatrixBase<MatrixType>::set (const unsigned int  row,
 #ifdef DEBUG
   // If in debug mode, do a check whether
   // the right length has been obtained.
-  unsigned int length = 0;
+  size_type length = 0;
   for (unsigned int i=0; i<this->n_block_cols(); ++i)
     length += counter_within_block[i];
   Assert (length <= n_cols, ExcInternalError());
@@ -2016,7 +2036,7 @@ BlockMatrixBase<MatrixType>::set (const unsigned int  row,
   // where we should start reading out
   // data. Now let's write the data into
   // the individual blocks!
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<unsigned int,size_type>
   row_index = this->row_block_indices.global_to_local (row);
   for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
     {
@@ -2037,8 +2057,8 @@ BlockMatrixBase<MatrixType>::set (const unsigned int  row,
 template <class MatrixType>
 inline
 void
-BlockMatrixBase<MatrixType>::add (const unsigned int i,
-                                  const unsigned int j,
+BlockMatrixBase<MatrixType>::add (const size_type  i,
+                                  const size_type  j,
                                   const value_type value)
 {
 
@@ -2055,7 +2075,7 @@ BlockMatrixBase<MatrixType>::add (const unsigned int i,
       (value == value_type()))
     return;
 
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<unsigned int,size_type>
   row_index = row_block_indices.global_to_local (i),
   col_index = column_block_indices.global_to_local (j);
   block(row_index.first,col_index.first).add (row_index.second,
@@ -2069,17 +2089,17 @@ template <class MatrixType>
 template <typename number>
 inline
 void
-BlockMatrixBase<MatrixType>::add (const std::vector<unsigned int> &row_indices,
-                                  const std::vector<unsigned int> &col_indices,
-                                  const FullMatrix<number>        &values,
-                                  const bool                       elide_zero_values)
+BlockMatrixBase<MatrixType>::add (const std::vector<size_type> &row_indices,
+                                  const std::vector<size_type> &col_indices,
+                                  const FullMatrix<number>     &values,
+                                  const bool                    elide_zero_values)
 {
   Assert (row_indices.size() == values.m(),
           ExcDimensionMismatch(row_indices.size(), values.m()));
   Assert (col_indices.size() == values.n(),
           ExcDimensionMismatch(col_indices.size(), values.n()));
 
-  for (unsigned int i=0; i<row_indices.size(); ++i)
+  for (size_type i=0; i<row_indices.size(); ++i)
     add (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -2090,15 +2110,15 @@ template <class MatrixType>
 template <typename number>
 inline
 void
-BlockMatrixBase<MatrixType>::add (const std::vector<unsigned int> &indices,
-                                  const FullMatrix<number>        &values,
-                                  const bool                       elide_zero_values)
+BlockMatrixBase<MatrixType>::add (const std::vector<size_type> &indices,
+                                  const FullMatrix<number>     &values,
+                                  const bool                    elide_zero_values)
 {
   Assert (indices.size() == values.m(),
           ExcDimensionMismatch(indices.size(), values.m()));
   Assert (values.n() == values.m(), ExcNotQuadratic());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     add (indices[i], indices.size(), &indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -2109,10 +2129,10 @@ template <class MatrixType>
 template <typename number>
 inline
 void
-BlockMatrixBase<MatrixType>::add (const unsigned int               row,
-                                  const std::vector<unsigned int> &col_indices,
-                                  const std::vector<number>       &values,
-                                  const bool                       elide_zero_values)
+BlockMatrixBase<MatrixType>::add (const size_type               row,
+                                  const std::vector<size_type> &col_indices,
+                                  const std::vector<number>    &values,
+                                  const bool                    elide_zero_values)
 {
   Assert (col_indices.size() == values.size(),
           ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -2130,12 +2150,12 @@ template <class MatrixType>
 template <typename number>
 inline
 void
-BlockMatrixBase<MatrixType>::add (const unsigned int   row,
-                                  const unsigned int   n_cols,
-                                  const unsigned int  *col_indices,
-                                  const number        *values,
-                                  const bool           elide_zero_values,
-                                  const bool           col_indices_are_sorted)
+BlockMatrixBase<MatrixType>::add (const size_type  row,
+                                  const size_type  n_cols,
+                                  const size_type *col_indices,
+                                  const number    *values,
+                                  const bool       elide_zero_values,
+                                  const bool       col_indices_are_sorted)
 {
   prepare_add_operation();
 
@@ -2147,24 +2167,24 @@ BlockMatrixBase<MatrixType>::add (const unsigned int   row,
 #ifdef DEBUG
       // check whether indices really are
       // sorted.
-      unsigned int before = col_indices[0];
-      for (unsigned int i=1; i<n_cols; ++i)
+      size_type before = col_indices[0];
+      for (size_type i=1; i<n_cols; ++i)
         if (col_indices[i] <= before)
           Assert (false, ExcMessage ("Flag col_indices_are_sorted is set, but "
                                      "indices appear to not be sorted."))
           else
             before = col_indices[i];
 #endif
-      const std::pair<unsigned int,unsigned int>
+      const std::pair<unsigned int,size_type>
       row_index = this->row_block_indices.global_to_local (row);
 
       if (this->n_block_cols() > 1)
         {
-          const unsigned int *first_block = Utilities::lower_bound (col_indices,
-                                                                    col_indices+n_cols,
-                                                                    this->column_block_indices.block_start(1));
+          const size_type *first_block = Utilities::lower_bound (col_indices,
+                                                                 col_indices+n_cols,
+                                                                 this->column_block_indices.block_start(1));
 
-          const unsigned int n_zero_block_indices = first_block - col_indices;
+          const size_type n_zero_block_indices = first_block - col_indices;
           block(row_index.first, 0).add (row_index.second,
                                          n_zero_block_indices,
                                          col_indices,
@@ -2231,17 +2251,17 @@ BlockMatrixBase<MatrixType>::add (const unsigned int   row,
   // block is stored contiguously (in
   // fact, data will be intermixed when
   // it comes from an element matrix).
-  for (unsigned int j=0; j<n_cols; ++j)
+  for (size_type j=0; j<n_cols; ++j)
     {
       double value = values[j];
 
       if (value == 0 && elide_zero_values == true)
         continue;
 
-      const std::pair<unsigned int, unsigned int>
+      const std::pair<unsigned int, size_type>
       col_index = this->column_block_indices.global_to_local(col_indices[j]);
 
-      const unsigned int local_index = counter_within_block[col_index.first]++;
+      const size_type local_index = counter_within_block[col_index.first]++;
 
       column_indices[col_index.first][local_index] = col_index.second;
       column_values[col_index.first][local_index] = value;
@@ -2250,7 +2270,7 @@ BlockMatrixBase<MatrixType>::add (const unsigned int   row,
 #ifdef DEBUG
   // If in debug mode, do a check whether
   // the right length has been obtained.
-  unsigned int length = 0;
+  size_type length = 0;
   for (unsigned int i=0; i<this->n_block_cols(); ++i)
     length += counter_within_block[i];
   Assert (length <= n_cols, ExcInternalError());
@@ -2261,7 +2281,7 @@ BlockMatrixBase<MatrixType>::add (const unsigned int   row,
   // where we should start reading out
   // data. Now let's write the data into
   // the individual blocks!
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<unsigned int,size_type>
   row_index = this->row_block_indices.global_to_local (row);
   for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
     {
@@ -2311,10 +2331,10 @@ BlockMatrixBase<MatrixType>::add (const value_type                   factor,
 template <class MatrixType>
 inline
 typename BlockMatrixBase<MatrixType>::value_type
-BlockMatrixBase<MatrixType>::operator () (const unsigned int i,
-                                          const unsigned int j) const
+BlockMatrixBase<MatrixType>::operator () (const size_type i,
+                                          const size_type j) const
 {
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<unsigned int,size_type>
   row_index = row_block_indices.global_to_local (i),
   col_index = column_block_indices.global_to_local (j);
   return block(row_index.first,col_index.first) (row_index.second,
@@ -2326,10 +2346,10 @@ BlockMatrixBase<MatrixType>::operator () (const unsigned int i,
 template <class MatrixType>
 inline
 typename BlockMatrixBase<MatrixType>::value_type
-BlockMatrixBase<MatrixType>::el (const unsigned int i,
-                                 const unsigned int j) const
+BlockMatrixBase<MatrixType>::el (const size_type i,
+                                 const size_type j) const
 {
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<unsigned int,size_type>
   row_index = row_block_indices.global_to_local (i),
   col_index = column_block_indices.global_to_local (j);
   return block(row_index.first,col_index.first).el (row_index.second,
@@ -2341,12 +2361,12 @@ BlockMatrixBase<MatrixType>::el (const unsigned int i,
 template <class MatrixType>
 inline
 typename BlockMatrixBase<MatrixType>::value_type
-BlockMatrixBase<MatrixType>::diag_element (const unsigned int i) const
+BlockMatrixBase<MatrixType>::diag_element (const size_type i) const
 {
   Assert (n_block_rows() == n_block_cols(),
           ExcNotQuadratic());
 
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<unsigned int,size_type>
   index = row_block_indices.global_to_local (i);
   return block(index.first,index.first).diag_element(index.second);
 }
@@ -2440,11 +2460,11 @@ vmult_block_block (BlockVectorType       &dst,
   Assert (src.n_blocks() == n_block_cols(),
           ExcDimensionMismatch(src.n_blocks(), n_block_cols()));
 
-  for (unsigned int row=0; row<n_block_rows(); ++row)
+  for (size_type row=0; row<n_block_rows(); ++row)
     {
       block(row,0).vmult (dst.block(row),
                           src.block(0));
-      for (unsigned int col=1; col<n_block_cols(); ++col)
+      for (size_type col=1; col<n_block_cols(); ++col)
         block(row,col).vmult_add (dst.block(row),
                                   src.block(col));
     };
@@ -2466,7 +2486,7 @@ vmult_nonblock_block (VectorType    &dst,
           ExcDimensionMismatch(src.n_blocks(), n_block_cols()));
 
   block(0,0).vmult (dst, src.block(0));
-  for (unsigned int col=1; col<n_block_cols(); ++col)
+  for (size_type col=1; col<n_block_cols(); ++col)
     block(0,col).vmult_add (dst, src.block(col));
 }
 
@@ -2485,7 +2505,7 @@ vmult_block_nonblock (BlockVectorType  &dst,
   Assert (1 == n_block_cols(),
           ExcDimensionMismatch(1, n_block_cols()));
 
-  for (unsigned int row=0; row<n_block_rows(); ++row)
+  for (size_type row=0; row<n_block_rows(); ++row)
     block(row,0).vmult (dst.block(row),
                         src);
 }
@@ -2543,7 +2563,7 @@ Tvmult_block_block (BlockVectorType       &dst,
 
   dst = 0.;
 
-  for (unsigned int row=0; row<n_block_rows(); ++row)
+  for (unsigned int  row=0; row<n_block_rows(); ++row)
     {
       for (unsigned int col=0; col<n_block_cols(); ++col)
         block(row,col).Tvmult_add (dst.block(col),
@@ -2589,7 +2609,7 @@ Tvmult_nonblock_block (VectorType    &dst,
 
   block(0,0).Tvmult (dst, src.block(0));
 
-  for (unsigned int row=1; row<n_block_rows(); ++row)
+  for (size_type row=1; row<n_block_rows(); ++row)
     block(row,0).Tvmult_add (dst, src.block(row));
 }
 
@@ -2709,19 +2729,19 @@ residual (BlockVectorType          &dst,
                              x.block(0),
                              b.block(row));
 
-      for (unsigned int i=0; i<dst.block(row).size(); ++i)
+      for (size_type i=0; i<dst.block(row).size(); ++i)
         dst.block(row)(i) = -dst.block(row)(i);
 
       for (unsigned int col=1; col<n_block_cols(); ++col)
         block(row,col).vmult_add (dst.block(row),
                                   x.block(col));
 
-      for (unsigned int i=0; i<dst.block(row).size(); ++i)
+      for (size_type i=0; i<dst.block(row).size(); ++i)
         dst.block(row)(i) = -dst.block(row)(i);
     };
 
   value_type res = 0;
-  for (unsigned int row=0; row<n_block_rows(); ++row)
+  for (size_type row=0; row<n_block_rows(); ++row)
     res += dst.block(row).norm_sqr ();
   return std::sqrt(res);
 }
@@ -2769,7 +2789,7 @@ BlockMatrixBase<MatrixType>::end () const
 template <class MatrixType>
 inline
 typename BlockMatrixBase<MatrixType>::const_iterator
-BlockMatrixBase<MatrixType>::begin (const unsigned int r) const
+BlockMatrixBase<MatrixType>::begin (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   return const_iterator(this, r);
@@ -2780,7 +2800,7 @@ BlockMatrixBase<MatrixType>::begin (const unsigned int r) const
 template <class MatrixType>
 inline
 typename BlockMatrixBase<MatrixType>::const_iterator
-BlockMatrixBase<MatrixType>::end (const unsigned int r) const
+BlockMatrixBase<MatrixType>::end (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   return const_iterator(this, r+1);
@@ -2811,7 +2831,7 @@ BlockMatrixBase<MatrixType>::end ()
 template <class MatrixType>
 inline
 typename BlockMatrixBase<MatrixType>::iterator
-BlockMatrixBase<MatrixType>::begin (const unsigned int r)
+BlockMatrixBase<MatrixType>::begin (const size_type r)
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   return iterator(this, r);
@@ -2822,7 +2842,7 @@ BlockMatrixBase<MatrixType>::begin (const unsigned int r)
 template <class MatrixType>
 inline
 typename BlockMatrixBase<MatrixType>::iterator
-BlockMatrixBase<MatrixType>::end (const unsigned int r)
+BlockMatrixBase<MatrixType>::end (const size_type r)
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   return iterator(this, r+1);
@@ -2834,8 +2854,8 @@ template <class MatrixType>
 void
 BlockMatrixBase<MatrixType>::collect_sizes ()
 {
-  std::vector<unsigned int> row_sizes (this->n_block_rows());
-  std::vector<unsigned int> col_sizes (this->n_block_cols());
+  std::vector<size_type> row_sizes (this->n_block_rows());
+  std::vector<size_type> col_sizes (this->n_block_cols());
 
   // first find out the row sizes
   // from the first block column
index 5bc235ae13fd082f170663ff0a2623fbebfa37c8..e5f91ad22bca386f38d681220828eee25ae6765e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_sparse_matrix_h
 #define __deal2__block_sparse_matrix_h
 
@@ -204,7 +209,7 @@ public:
    * Return the number of entries
    * in a specific row.
    */
-  unsigned int get_row_length (const unsigned int row) const;
+  size_type get_row_length (const size_type row) const;
 
   /**
    * Return the number of nonzero
@@ -215,7 +220,7 @@ public:
    * the entries should happen to
    * be zero, it is counted anyway.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return the number of actually
@@ -224,7 +229,7 @@ public:
    * (with absolute value larger than
    * threshold) of all the blocks.
    */
-  unsigned int n_actually_nonzero_elements (const double threshold = 0.0) const;
+  size_type n_actually_nonzero_elements (const double threshold = 0.0) const;
 
   /**
    * Return a (constant) reference
@@ -470,8 +475,8 @@ BlockSparseMatrix<number>::operator = (const double d)
 {
   Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
 
-  for (unsigned int r=0; r<this->n_block_rows(); ++r)
-    for (unsigned int c=0; c<this->n_block_cols(); ++c)
+  for (size_type r=0; r<this->n_block_rows(); ++r)
+    for (size_type c=0; c<this->n_block_cols(); ++c)
       this->block(r,c) = d;
 
   return *this;
@@ -596,7 +601,7 @@ precondition_Jacobi (BlockVectorType       &dst,
 
   // do a diagonal preconditioning. uses only
   // the diagonal blocks of the matrix
-  for (unsigned int i=0; i<this->n_block_rows(); ++i)
+  for (size_type i=0; i<this->n_block_rows(); ++i)
     this->block(i,i).precondition_Jacobi (dst.block(i),
                                           src.block(i),
                                           omega);
index c50ac4fc00c2493ec033eadacc41158e2c83dacd..73b3fba70118ead3fd3800cd5b5eb6dbda49a767 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_sparse_matrix_templates_h
 #define __deal2__block_sparse_matrix_templates_h
 
@@ -60,8 +65,8 @@ operator = (const BlockSparseMatrix<number> &m)
   // anything except than checking
   // whether the base objects want to
   // do something
-  for (unsigned int r=0; r<this->n_block_rows(); ++r)
-    for (unsigned int c=0; c<this->n_block_cols(); ++c)
+  for (size_type r=0; r<this->n_block_rows(); ++r)
+    for (size_type c=0; c<this->n_block_cols(); ++c)
       this->block(r,c) = m.block(r,c);
 
   return *this;
@@ -100,8 +105,8 @@ reinit (const BlockSparsityPattern &sparsity)
                             sparsity.n_block_cols());
 
   // and reinitialize the blocks
-  for (unsigned int r=0; r<this->n_block_rows(); ++r)
-    for (unsigned int c=0; c<this->n_block_cols(); ++c)
+  for (size_type r=0; r<this->n_block_rows(); ++r)
+    for (size_type c=0; c<this->n_block_cols(); ++c)
       {
         BlockType *p = new SparseMatrix<number>();
         p->reinit (sparsity.block(r,c));
@@ -115,8 +120,8 @@ template <typename number>
 bool
 BlockSparseMatrix<number>::empty () const
 {
-  for (unsigned int r=0; r<this->n_block_rows(); ++r)
-    for (unsigned int c=0; c<this->n_block_cols(); ++c)
+  for (size_type r=0; r<this->n_block_rows(); ++r)
+    for (size_type c=0; c<this->n_block_cols(); ++c)
       if (this->block(r,c).empty () == false)
         return false;
 
@@ -127,8 +132,8 @@ BlockSparseMatrix<number>::empty () const
 
 
 template <typename number>
-unsigned int
-BlockSparseMatrix<number>::get_row_length (const unsigned int row) const
+typename BlockSparseMatrix<number>::size_type
+BlockSparseMatrix<number>::get_row_length (const size_type row) const
 {
   return sparsity_pattern->row_length(row);
 }
@@ -136,7 +141,7 @@ BlockSparseMatrix<number>::get_row_length (const unsigned int row) const
 
 
 template <typename number>
-unsigned int
+typename BlockSparseMatrix<number>::size_type
 BlockSparseMatrix<number>::n_nonzero_elements () const
 {
   return sparsity_pattern->n_nonzero_elements ();
@@ -145,12 +150,12 @@ BlockSparseMatrix<number>::n_nonzero_elements () const
 
 
 template <typename number>
-unsigned int
+typename BlockSparseMatrix<number>::size_type
 BlockSparseMatrix<number>::n_actually_nonzero_elements (const double threshold) const
 {
-  unsigned int count = 0;
-  for (unsigned int i=0; i<this->n_block_rows(); ++i)
-    for (unsigned int j=0; j<this->n_block_cols(); ++j)
+  size_type count = 0;
+  for (size_type i=0; i<this->n_block_rows(); ++i)
+    for (size_type j=0; j<this->n_block_cols(); ++j)
       count += this->sub_objects[i][j]->n_actually_nonzero_elements (threshold);
 
   return count;
@@ -177,8 +182,8 @@ print_formatted (std::ostream       &out,
                  const char         *zero_string,
                  const double        denominator) const
 {
-  for (unsigned int r=0; r<this->n_block_rows(); ++r)
-    for (unsigned int c=0; c<this->n_block_cols(); ++c)
+  for (size_type r=0; r<this->n_block_rows(); ++r)
+    for (size_type c=0; c<this->n_block_cols(); ++c)
       {
         out << "Component (" << r << "," << c << ")" << std::endl;
         this->block(r,c).print_formatted (out, precision, scientific,
@@ -194,8 +199,8 @@ BlockSparseMatrix<number>::memory_consumption () const
 {
   std::size_t mem = sizeof(*this);
   mem += MemoryConsumption::memory_consumption (this->sub_objects);
-  for (unsigned int r=0; r<this->n_block_rows(); ++r)
-    for (unsigned int c=0; c<this->n_block_cols(); ++c)
+  for (size_type r=0; r<this->n_block_rows(); ++r)
+    for (size_type c=0; c<this->n_block_cols(); ++c)
       mem += MemoryConsumption::memory_consumption(*this->sub_objects[r][c]);
 
   return mem;
index c42d51ece13e6f3a4183b955e6adc7a8fc812e3c..a056125fb4228266bf4b4d52a6cca9635aec6730 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_sparse_matrix_ez_h
 #define __deal2__block_sparse_matrix_ez_h
 
@@ -47,6 +52,11 @@ template<typename Number>
 class BlockSparseMatrixEZ : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Default constructor. The
    * result is an empty object with
@@ -189,7 +199,7 @@ public:
    * space. It is the sum of rows
    * of the rows of sub-matrices.
    */
-  unsigned int n_rows () const;
+  size_type n_rows () const;
 
   /**
    * Return number of columns of
@@ -199,7 +209,7 @@ public:
    * columns of the columns of
    * sub-matrices.
    */
-  unsigned int n_cols () const;
+  size_type n_cols () const;
 
   /**
    * Return the dimension of the
@@ -207,7 +217,7 @@ public:
    * matrix is of dimension
    * $m \times n$.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Return the dimension of the
@@ -215,7 +225,7 @@ public:
    * matrix is of dimension
    * $m \times n$.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Set the element <tt>(i,j)</tt>
@@ -226,8 +236,8 @@ public:
    * allowed to store zero values
    * in non-existent fields.
    */
-  void set (const unsigned int i,
-            const unsigned int j,
+  void set (const size_type i,
+            const size_type j,
             const Number value);
 
   /**
@@ -239,7 +249,7 @@ public:
    * is allowed to store zero
    * values in non-existent fields.
    */
-  void add (const unsigned int i, const unsigned int j,
+  void add (const size_type i, const size_type j,
             const Number value);
 
 
@@ -338,7 +348,7 @@ BlockSparseMatrixEZ<Number>::n_block_rows () const
 
 template <typename Number>
 inline
-unsigned int
+typename BlockSparseMatrixEZ<Number>::size_type
 BlockSparseMatrixEZ<Number>::n_rows () const
 {
   return row_indices.total_size();
@@ -358,7 +368,7 @@ BlockSparseMatrixEZ<Number>::n_block_cols () const
 
 template <typename Number>
 inline
-unsigned int
+typename BlockSparseMatrixEZ<Number>::size_type
 BlockSparseMatrixEZ<Number>::n_cols () const
 {
   return column_indices.total_size();
@@ -396,7 +406,7 @@ BlockSparseMatrixEZ<Number>::block (const unsigned int row,
 
 template <typename Number>
 inline
-unsigned int
+typename BlockSparseMatrixEZ<Number>::size_type
 BlockSparseMatrixEZ<Number>::m () const
 {
   return n_rows();
@@ -406,7 +416,7 @@ BlockSparseMatrixEZ<Number>::m () const
 
 template <typename Number>
 inline
-unsigned int
+typename BlockSparseMatrixEZ<Number>::size_type
 BlockSparseMatrixEZ<Number>::n () const
 {
   return n_cols();
@@ -417,14 +427,14 @@ BlockSparseMatrixEZ<Number>::n () const
 template <typename Number>
 inline
 void
-BlockSparseMatrixEZ<Number>::set (const unsigned int i,
-                                  const unsigned int j,
+BlockSparseMatrixEZ<Number>::set (const size_type i,
+                                  const size_type j,
                                   const Number value)
 {
 
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<size_type,size_type>
   row_index = row_indices.global_to_local (i),
   col_index = column_indices.global_to_local (j);
   block(row_index.first,col_index.first).set (row_index.second,
@@ -437,14 +447,14 @@ BlockSparseMatrixEZ<Number>::set (const unsigned int i,
 template <typename Number>
 inline
 void
-BlockSparseMatrixEZ<Number>::add (const unsigned int i,
-                                  const unsigned int j,
+BlockSparseMatrixEZ<Number>::add (const size_type i,
+                                  const size_type j,
                                   const Number value)
 {
 
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<unsigned int,size_type>
   row_index = row_indices.global_to_local (i),
   col_index = column_indices.global_to_local (j);
   block(row_index.first,col_index.first).add (row_index.second,
@@ -530,11 +540,9 @@ Tvmult_add (BlockVector<somenumber>       &dst,
           ExcDimensionMismatch(src.n_blocks(), n_block_rows()));
 
   for (unsigned int row=0; row<n_block_rows(); ++row)
-    {
-      for (unsigned int col=0; col<n_block_cols(); ++col)
-        block(row,col).Tvmult_add (dst.block(col),
-                                   src.block(row));
-    };
+    for (unsigned int col=0; col<n_block_cols(); ++col)
+      block(row,col).Tvmult_add (dst.block(col),
+                                 src.block(row));
 }
 
 
@@ -544,18 +552,18 @@ inline
 void
 BlockSparseMatrixEZ<number>::print_statistics (STREAM &out, bool full)
 {
-  unsigned int used_total = 0;
-  unsigned int allocated_total = 0;
-  unsigned int reserved_total = 0;
-  std::vector<unsigned int> used_by_line_total;
-
-  unsigned int used;
-  unsigned int allocated;
-  unsigned int reserved;
-  std::vector<unsigned int> used_by_line;
-
-  for (unsigned int i=0; i<n_block_rows(); ++i)
-    for (unsigned int j=0; j<n_block_cols(); ++j)
+  size_type used_total = 0;
+  size_type allocated_total = 0;
+  size_type reserved_total = 0;
+  std::vector<size_type> used_by_line_total;
+
+  size_type used;
+  size_type allocated;
+  size_type reserved;
+  std::vector<size_type> used_by_line;
+
+  for (size_type i=0; i<n_block_rows(); ++i)
+    for (size_type j=0; j<n_block_cols(); ++j)
       {
         used_by_line.clear();
         out << "block:\t" << i << '\t' << j << std::endl;
@@ -573,7 +581,7 @@ BlockSparseMatrixEZ<number>::print_statistics (STREAM &out, bool full)
         if (full)
           {
             used_by_line_total.resize(used_by_line.size());
-            for (unsigned int i=0; i< used_by_line.size(); ++i)
+            for (size_type i=0; i< used_by_line.size(); ++i)
               if (used_by_line[i] != 0)
                 {
                   out << "row-entries\t" << i
@@ -587,7 +595,7 @@ BlockSparseMatrixEZ<number>::print_statistics (STREAM &out, bool full)
       << "used:" << used_total << std::endl
       << "allocated:" << allocated_total << std::endl
       << "reserved:" << reserved_total << std::endl;
-  for (unsigned int i=0; i< used_by_line_total.size(); ++i)
+  for (size_type i=0; i< used_by_line_total.size(); ++i)
     if (used_by_line_total[i] != 0)
       {
         out << "row-entries\t" << i
index 033773ee169ad05112dda298ee8bb7c11cd4c237..49ec8b7cca52d05c5e3aecf1a225baeb2516fc77 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2011, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_sparse_matrix_ez_templates_h
 #define __deal2__block_sparse_matrix_ez_templates_h
 
@@ -137,8 +142,8 @@ BlockSparseMatrixEZ<number>::collect_sizes ()
 {
   const unsigned int rows = n_block_rows();
   const unsigned int columns = n_block_cols();
-  std::vector<unsigned int> row_sizes (rows);
-  std::vector<unsigned int> col_sizes (columns);
+  std::vector<size_type> row_sizes (rows);
+  std::vector<size_type> col_sizes (columns);
 
   // first find out the row sizes
   // from the first block column
index 21ee9f7a5bbf61388c2077d465c8d405e79f5211..392eaa4fca35564736737c7a2f14496a060cedf7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_sparsity_pattern_h
 #define __deal2__block_sparsity_pattern_h
 
@@ -72,7 +77,7 @@ namespace TrilinosWrappers
  * You will in general not want to use this class, but one of the
  * derived classes.
  *
- * @todo Handle opitmization of diagonal elements of the underlying
+ * @todo Handle optimization of diagonal elements of the underlying
  * SparsityPattern correctly.
  *
  * @see @ref GlossBlockLA "Block (linear algebra)"
@@ -82,6 +87,11 @@ template <class SparsityPatternBase>
 class BlockSparsityPatternBase : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Define a value which is used
    * to indicate that a certain
@@ -94,7 +104,7 @@ public:
    * the respective value of the
    * SparsityPattern class.
    */
-  static const unsigned int invalid_entry = SparsityPattern::invalid_entry;
+  static const size_type invalid_entry = SparsityPattern::invalid_entry;
 
   /**
    * Initialize the matrix empty,
@@ -116,8 +126,8 @@ public:
    * to call collect_sizes() after
    * you assign them sizes.
    */
-  BlockSparsityPatternBase (const unsigned int n_block_rows,
-                            const unsigned int n_block_columns);
+  BlockSparsityPatternBase (const size_type n_block_rows,
+                            const size_type n_block_columns);
 
   /**
    * Copy constructor. This
@@ -163,8 +173,8 @@ public:
    * user call whatever function
    * she desires.
    */
-  void reinit (const unsigned int n_block_rows,
-               const unsigned int n_block_columns);
+  void reinit (const size_type n_block_rows,
+               const size_type n_block_columns);
 
   /**
    * Copy operator. For this the
@@ -195,8 +205,8 @@ public:
    * given coordinates.
    */
   SparsityPatternBase &
-  block (const unsigned int row,
-         const unsigned int column);
+  block (const size_type row,
+         const size_type column);
 
 
   /**
@@ -205,8 +215,8 @@ public:
    * constant objects.
    */
   const SparsityPatternBase &
-  block (const unsigned int row,
-         const unsigned int column) const;
+  block (const size_type row,
+         const size_type column) const;
 
   /**
    * Grant access to the object
@@ -239,13 +249,13 @@ public:
    * Return the number of blocks in a
    * column.
    */
-  unsigned int n_block_rows () const;
+  size_type n_block_rows () const;
 
   /**
    * Return the number of blocks in a
    * row.
    */
-  unsigned int n_block_cols () const;
+  size_type n_block_cols () const;
 
   /**
    * Return whether the object is
@@ -268,7 +278,7 @@ public:
    * blocks in a row, and the
    * maximum over all rows.
    */
-  unsigned int max_entries_per_row () const;
+  size_type max_entries_per_row () const;
 
   /**
    * Add a nonzero entry to the matrix.
@@ -282,7 +292,7 @@ public:
    * to which block <tt>(i,j)</tt> belongs
    * and then relays to that block.
    */
-  void add (const unsigned int i, const unsigned int j);
+  void add (const size_type i, const size_type j);
 
   /**
    * Add several nonzero entries to the
@@ -300,10 +310,10 @@ public:
    * blocks.
    */
   template <typename ForwardIterator>
-  void add_entries (const unsigned int row,
-                    ForwardIterator    begin,
-                    ForwardIterator    end,
-                    const bool         indices_are_sorted = false);
+  void add_entries (const size_type  row,
+                    ForwardIterator  begin,
+                    ForwardIterator  end,
+                    const bool       indices_are_sorted = false);
 
   /**
    * Return number of rows of this
@@ -313,7 +323,7 @@ public:
    * of the (block-)rows of
    * sub-matrices.
    */
-  unsigned int n_rows () const;
+  size_type n_rows () const;
 
   /**
    * Return number of columns of
@@ -323,13 +333,13 @@ public:
    * columns of the (block-)columns
    * of sub-matrices.
    */
-  unsigned int n_cols () const;
+  size_type n_cols () const;
 
   /**
    * Check if a value at a certain
    * position may be non-zero.
    */
-  bool exists (const unsigned int i, const unsigned int j) const;
+  bool exists (const size_type i, const size_type j) const;
 
   /**
    * Number of entries in a
@@ -337,7 +347,7 @@ public:
    * all the blocks that form this
    * row.
    */
-  unsigned int row_length (const unsigned int row) const;
+  unsigned int row_length (const size_type row) const;
 
   /**
    * Return the number of nonzero
@@ -358,7 +368,7 @@ public:
    * the sum of the values as
    * returned by the sub-objects.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Print the sparsity of the
@@ -410,12 +420,12 @@ protected:
   /**
    * Number of block rows.
    */
-  unsigned int rows;
+  size_type rows;
 
   /**
    * Number of block columns.
    */
-  unsigned int columns;
+  size_type columns;
 
   /**
    * Array of sparsity patterns.
@@ -445,7 +455,7 @@ private:
    * individual blocks when doing a
    * collective add or set.
    */
-  std::vector<unsigned int> counter_within_block;
+  std::vector<size_type > counter_within_block;
 
   /**
    * Temporary vector for column
@@ -453,7 +463,7 @@ private:
    * local to global data on each
    * sparse matrix.
    */
-  std::vector<std::vector<unsigned int> > block_column_indices;
+  std::vector<std::vector<size_type > > block_column_indices;
 
   /**
    * Make the block sparse matrix a
@@ -501,15 +511,15 @@ public:
    * to call collect_sizes() after
    * you assign them sizes.
    */
-  BlockSparsityPattern (const unsigned int n_rows,
-                        const unsigned int n_columns);
+  BlockSparsityPattern (const size_type n_rows,
+                        const size_type n_columns);
 
   /**
    * Forwarding to
    * BlockSparsityPatternBase::reinit().
    */
-  void reinit (const unsigned int n_block_rows,
-               const unsigned int n_block_columns);
+  void reinit (const size_type n_block_rows,
+               const size_type n_block_columns);
 
   /**
    * Initialize the pattern with
@@ -672,8 +682,8 @@ public:
    * to call collect_sizes() after
    * you assign them sizes.
    */
-  BlockCompressedSparsityPattern (const unsigned int n_rows,
-                                  const unsigned int n_columns);
+  BlockCompressedSparsityPattern (const size_type n_rows,
+                                  const size_type n_columns);
 
   /**
    * Initialize the pattern with
@@ -686,8 +696,8 @@ public:
    * and then entering the index
    * values.
    */
-  BlockCompressedSparsityPattern (const std::vector<unsigned int> &row_block_sizes,
-                                  const std::vector<unsigned int> &col_block_sizes);
+  BlockCompressedSparsityPattern (const std::vector<size_type> &row_block_sizes,
+                                  const std::vector<size_type> &col_block_sizes);
 
   /**
    * Initialize the pattern with
@@ -713,8 +723,8 @@ public:
    * <tt>row_block_sizes[i]</tt>
    * times <tt>col_block_sizes[j]</tt>.
    */
-  void reinit (const std::vector< unsigned int > &row_block_sizes,
-               const std::vector< unsigned int > &col_block_sizes);
+  void reinit (const std::vector<size_type> &row_block_sizes,
+               const std::vector<size_type> &col_block_sizes);
 
   /**
    * Resize the matrix to a tensor
@@ -789,8 +799,8 @@ public:
    * to call collect_sizes() after
    * you assign them sizes.
    */
-  BlockCompressedSetSparsityPattern (const unsigned int n_rows,
-                                     const unsigned int n_columns);
+  BlockCompressedSetSparsityPattern (const size_type n_rows,
+                                     const size_type n_columns);
 
   /**
    * Initialize the pattern with
@@ -803,8 +813,8 @@ public:
    * and then entering the index
    * values.
    */
-  BlockCompressedSetSparsityPattern (const std::vector<unsigned int> &row_block_sizes,
-                                     const std::vector<unsigned int> &col_block_sizes);
+  BlockCompressedSetSparsityPattern (const std::vector<size_type> &row_block_sizes,
+                                     const std::vector<size_type> &col_block_sizes);
 
   /**
    * Initialize the pattern with
@@ -830,8 +840,8 @@ public:
    * <tt>row_block_sizes[i]</tt>
    * times <tt>col_block_sizes[j]</tt>.
    */
-  void reinit (const std::vector< unsigned int > &row_block_sizes,
-               const std::vector< unsigned int > &col_block_sizes);
+  void reinit (const std::vector<size_type> &row_block_sizes,
+               const std::vector<size_type> &col_block_sizes);
 
   /**
    * Resize the matrix to a tensor
@@ -899,8 +909,8 @@ public:
    * to call collect_sizes() after
    * you assign them sizes.
    */
-  BlockCompressedSimpleSparsityPattern (const unsigned int n_rows,
-                                        const unsigned int n_columns);
+  BlockCompressedSimpleSparsityPattern (const size_type n_rows,
+                                        const size_type n_columns);
 
   /**
    * Initialize the pattern with
@@ -913,8 +923,8 @@ public:
    * and then entering the index
    * values.
    */
-  BlockCompressedSimpleSparsityPattern (const std::vector<unsigned int> &row_block_sizes,
-                                        const std::vector<unsigned int> &col_block_sizes);
+  BlockCompressedSimpleSparsityPattern (const std::vector<size_type> &row_block_sizes,
+                                        const std::vector<size_type> &col_block_sizes);
 
   /**
    * Initialize the pattern with symmetric
@@ -945,8 +955,8 @@ public:
    * <tt>row_block_sizes[i]</tt>
    * times <tt>col_block_sizes[j]</tt>.
    */
-  void reinit (const std::vector< unsigned int > &row_block_sizes,
-               const std::vector< unsigned int > &col_block_sizes);
+  void reinit (const std::vector<size_type> &row_block_sizes,
+               const std::vector<size_type> &col_block_sizes);
 
   /**
    * Resize the pattern with symmetric
@@ -962,8 +972,8 @@ public:
    * Return the column number of
    * the @p index th entry in row @p row.
    */
-  unsigned int column_number (const unsigned int row,
-                              const unsigned int index) const;
+  size_type column_number (const size_type row,
+                           const unsigned int index) const;
 
   /**
    * Allow the use of the reinit
@@ -1025,8 +1035,8 @@ namespace TrilinosWrappers
      * to call collect_sizes() after
      * you assign them sizes.
      */
-    BlockSparsityPattern (const unsigned int n_rows,
-                          const unsigned int n_columns);
+    BlockSparsityPattern (const size_type n_rows,
+                          const size_type n_columns);
 
     /**
      * Initialize the pattern with
@@ -1039,8 +1049,8 @@ namespace TrilinosWrappers
      * and then entering the index
      * values.
      */
-    BlockSparsityPattern (const std::vector<unsigned int> &row_block_sizes,
-                          const std::vector<unsigned int> &col_block_sizes);
+    BlockSparsityPattern (const std::vector<size_type> &row_block_sizes,
+                          const std::vector<size_type> &col_block_sizes);
 
     /**
      * Initialize the pattern with an array
@@ -1087,8 +1097,8 @@ namespace TrilinosWrappers
      * <tt>row_block_sizes[i]</tt>
      * times <tt>col_block_sizes[j]</tt>.
      */
-    void reinit (const std::vector< unsigned int > &row_block_sizes,
-                 const std::vector< unsigned int > &col_block_sizes);
+    void reinit (const std::vector<size_type> &row_block_sizes,
+                 const std::vector<size_type> &col_block_sizes);
 
     /**
      * Resize the matrix to a square tensor
@@ -1129,8 +1139,8 @@ namespace TrilinosWrappers
 template <class SparsityPatternBase>
 inline
 SparsityPatternBase &
-BlockSparsityPatternBase<SparsityPatternBase>::block (const unsigned int row,
-                                                      const unsigned int column)
+BlockSparsityPatternBase<SparsityPatternBase>::block (const size_type row,
+                                                      const size_type column)
 {
   Assert (row<rows, ExcIndexRange(row,0,rows));
   Assert (column<columns, ExcIndexRange(column,0,columns));
@@ -1142,8 +1152,8 @@ BlockSparsityPatternBase<SparsityPatternBase>::block (const unsigned int row,
 template <class SparsityPatternBase>
 inline
 const SparsityPatternBase &
-BlockSparsityPatternBase<SparsityPatternBase>::block (const unsigned int row,
-                                                      const unsigned int column) const
+BlockSparsityPatternBase<SparsityPatternBase>::block (const size_type row,
+                                                      const size_type column) const
 {
   Assert (row<rows, ExcIndexRange(row,0,rows));
   Assert (column<columns, ExcIndexRange(column,0,columns));
@@ -1175,13 +1185,13 @@ BlockSparsityPatternBase<SparsityPatternBase>::get_column_indices () const
 template <class SparsityPatternBase>
 inline
 void
-BlockSparsityPatternBase<SparsityPatternBase>::add (const unsigned int i,
-                                                    const unsigned int j)
+BlockSparsityPatternBase<SparsityPatternBase>::add (const size_type i,
+                                                    const size_type j)
 {
   // if you get an error here, are
   // you sure you called
   // <tt>collect_sizes()</tt> before?
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<size_type,size_type>
   row_index = row_indices.global_to_local (i),
   col_index = column_indices.global_to_local (j);
   sub_objects[row_index.first][col_index.first]->add (row_index.second,
@@ -1193,10 +1203,10 @@ BlockSparsityPatternBase<SparsityPatternBase>::add (const unsigned int i,
 template <class SparsityPatternBase>
 template <typename ForwardIterator>
 void
-BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const unsigned int row,
-                                                            ForwardIterator    begin,
-                                                            ForwardIterator    end,
-                                                            const bool         indices_are_sorted)
+BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const size_type row,
+                                                            ForwardIterator begin,
+                                                            ForwardIterator end,
+                                                            const bool      indices_are_sorted)
 {
   // Resize scratch arrays
   if (block_column_indices.size() < this->n_block_cols())
@@ -1205,7 +1215,7 @@ BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const unsigned int r
       counter_within_block.resize (this->n_block_cols());
     }
 
-  const unsigned int n_cols = static_cast<unsigned int>(end - begin);
+  const size_type n_cols = static_cast<size_type>(end - begin);
 
   // Resize sub-arrays to n_cols. This
   // is a bit wasteful, but we resize
@@ -1218,12 +1228,12 @@ BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const unsigned int r
   // enough before actually going
   // through all of them.
   if (block_column_indices[0].size() < n_cols)
-    for (unsigned int i=0; i<this->n_block_cols(); ++i)
+    for (size_type i=0; i<this->n_block_cols(); ++i)
       block_column_indices[i].resize(n_cols);
 
   // Reset the number of added elements
   // in each block to zero.
-  for (unsigned int i=0; i<this->n_block_cols(); ++i)
+  for (size_type i=0; i<this->n_block_cols(); ++i)
     counter_within_block[i] = 0;
 
   // Go through the column indices to
@@ -1237,12 +1247,12 @@ BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const unsigned int r
   // comes from an element matrix).
   for (ForwardIterator it = begin; it != end; ++it)
     {
-      const unsigned int col = *it;
+      const size_type col = *it;
 
-      const std::pair<unsigned int, unsigned int>
+      const std::pair<size_type , size_type>
       col_index = this->column_indices.global_to_local(col);
 
-      const unsigned int local_index = counter_within_block[col_index.first]++;
+      const size_type local_index = counter_within_block[col_index.first]++;
 
       block_column_indices[col_index.first][local_index] = col_index.second;
     }
@@ -1250,8 +1260,8 @@ BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const unsigned int r
 #ifdef DEBUG
   // If in debug mode, do a check whether
   // the right length has been obtained.
-  unsigned int length = 0;
-  for (unsigned int i=0; i<this->n_block_cols(); ++i)
+  size_type length = 0;
+  for (size_type i=0; i<this->n_block_cols(); ++i)
     length += counter_within_block[i];
   Assert (length == n_cols, ExcInternalError());
 #endif
@@ -1261,9 +1271,9 @@ BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const unsigned int r
   // where we should start reading out
   // data. Now let's write the data into
   // the individual blocks!
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<size_type , size_type>
   row_index = this->row_indices.global_to_local (row);
-  for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
+  for (size_type block_col=0; block_col<n_block_cols(); ++block_col)
     {
       if (counter_within_block[block_col] == 0)
         continue;
@@ -1280,13 +1290,13 @@ BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const unsigned int r
 template <class SparsityPatternBase>
 inline
 bool
-BlockSparsityPatternBase<SparsityPatternBase>::exists (const unsigned int i,
-                                                       const unsigned int j) const
+BlockSparsityPatternBase<SparsityPatternBase>::exists (const size_type i,
+                                                       const size_type j) const
 {
   // if you get an error here, are
   // you sure you called
   // <tt>collect_sizes()</tt> before?
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<size_type , size_type>
   row_index = row_indices.global_to_local (i),
   col_index = column_indices.global_to_local (j);
   return sub_objects[row_index.first][col_index.first]->exists (row_index.second,
@@ -1299,14 +1309,14 @@ template <class SparsityPatternBase>
 inline
 unsigned int
 BlockSparsityPatternBase<SparsityPatternBase>::
-row_length (const unsigned int row) const
+row_length (const size_type row) const
 {
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<size_type , size_type>
   row_index = row_indices.global_to_local (row);
 
   unsigned int c = 0;
 
-  for (unsigned int b=0; b<rows; ++b)
+  for (size_type b=0; b<rows; ++b)
     c += sub_objects[row_index.first][b]->row_length (row_index.second);
 
   return c;
@@ -1316,7 +1326,7 @@ row_length (const unsigned int row) const
 
 template <class SparsityPatternBase>
 inline
-unsigned int
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
 BlockSparsityPatternBase<SparsityPatternBase>::n_block_cols () const
 {
   return columns;
@@ -1326,7 +1336,7 @@ BlockSparsityPatternBase<SparsityPatternBase>::n_block_cols () const
 
 template <class SparsityPatternBase>
 inline
-unsigned int
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
 BlockSparsityPatternBase<SparsityPatternBase>::n_block_rows () const
 {
   return rows;
@@ -1334,23 +1344,25 @@ BlockSparsityPatternBase<SparsityPatternBase>::n_block_rows () const
 
 
 inline
-unsigned int
-BlockCompressedSimpleSparsityPattern::column_number (const unsigned int row,
+BlockCompressedSimpleSparsityPattern::size_type
+BlockCompressedSimpleSparsityPattern::column_number (const size_type row,
                                                      const unsigned int index) const
 {
   // .first= ith block, .second = jth row in that block
-  const std::pair<unsigned int,unsigned int>
+  const std::pair<size_type ,size_type >
   row_index = row_indices.global_to_local (row);
 
   Assert(index<row_length(row), ExcIndexRange(index, 0, row_length(row)));
 
-  unsigned int c = 0;
+  size_type c = 0;
+  size_type block_columns = 0; //sum of n_cols for all blocks to the left
   for (unsigned int b=0; b<columns; ++b)
     {
       unsigned int rowlen = sub_objects[row_index.first][b]->row_length (row_index.second);
       if (index<c+rowlen)
-        return c+sub_objects[row_index.first][b]->column_number(row_index.second, index-c);
+        return block_columns+sub_objects[row_index.first][b]->column_number(row_index.second, index-c);
       c += rowlen;
+      block_columns += sub_objects[row_index.first][b]->n_cols();
     }
 
   Assert(false, ExcInternalError());
@@ -1361,8 +1373,8 @@ BlockCompressedSimpleSparsityPattern::column_number (const unsigned int row,
 inline
 void
 BlockSparsityPattern::reinit (
-  const unsigned int n_block_rows,
-  const unsigned int n_block_columns)
+  const size_type n_block_rows,
+  const size_type n_block_columns)
 {
   BlockSparsityPatternBase<SparsityPattern>::reinit (
     n_block_rows, n_block_columns);
index 9d7185410817e2c163deb1018106c7740e0ef8ae..77108b55258da4980eb1554d83cffa98b8ea8eba 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_vector_h
 #define __deal2__block_vector_h
 
@@ -102,7 +107,7 @@ public:
    *  sizes.
    */
   explicit BlockVector (const unsigned int num_blocks = 0,
-                        const unsigned int block_size = 0);
+                        const size_type block_size = 0);
 
   /**
    * Copy-Constructor. Dimension set to
@@ -157,7 +162,7 @@ public:
    * <tt>block_sizes[i]</tt> zero
    * elements.
    */
-  BlockVector (const std::vector<unsigned int> &block_sizes);
+  BlockVector (const std::vector<size_type> &block_sizes);
 
   /**
    * Constructor. Initialize vector
@@ -185,7 +190,7 @@ public:
    * different blocks.
    */
   template <typename InputIterator>
-  BlockVector (const std::vector<unsigned int> &n,
+  BlockVector (const std::vector<size_type>    &n,
                const InputIterator              first,
                const InputIterator              end);
 
@@ -271,7 +276,7 @@ public:
    * is filled with zeros.
    */
   void reinit (const unsigned int num_blocks,
-               const unsigned int block_size = 0,
+               const size_type block_size = 0,
                const bool fast = false);
 
   /**
@@ -305,8 +310,8 @@ public:
    * since they may be routed to
    * the wrong block.
    */
-  void reinit (const std::vector<unsigned int> &N,
-               const bool                       fast=false);
+  void reinit (const std::vector<size_type> &N,
+               const bool                    fast=false);
 
   /**
    * Reinitialize the BlockVector
@@ -470,7 +475,7 @@ public:
 
 template <typename Number>
 template <typename InputIterator>
-BlockVector<Number>::BlockVector (const std::vector<unsigned int> &n,
+BlockVector<Number>::BlockVector (const std::vector<size_type>    &n,
                                   const InputIterator              first,
                                   const InputIterator              end)
 {
@@ -479,7 +484,7 @@ BlockVector<Number>::BlockVector (const std::vector<unsigned int> &n,
   // copy elements soon
   reinit (n, true);
   InputIterator start = first;
-  for (unsigned int b=0; b<n.size(); ++b)
+  for (size_type b=0; b<n.size(); ++b)
     {
       InputIterator end = start;
       std::advance (end, static_cast<signed int>(n[b]));
@@ -543,7 +548,7 @@ template <typename Number>
 inline
 void BlockVector<Number>::compress (::dealii::VectorOperation::values operation)
 {
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->components[i].compress(operation);
 }
 
@@ -555,7 +560,7 @@ void BlockVector<Number>::scale (const value_type factor)
 
   Assert (numbers::is_finite(factor), ExcNumberNotFinite());
 
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->components[i] *= factor;
 }
 
index 0e000748e4f135b1e7db944497b6f158d92223ac..bbfee5581b2a4918739daf67897e17075c49b1ff 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_vector_templates_h
 #define __deal2__block_vector_templates_h
 
@@ -23,7 +28,7 @@ DEAL_II_NAMESPACE_OPEN
 
 template <typename Number>
 BlockVector<Number>::BlockVector (const unsigned int n_blocks,
-                                  const unsigned int block_size)
+                                  const size_type block_size)
 {
   reinit (n_blocks, block_size);
 }
@@ -31,7 +36,7 @@ BlockVector<Number>::BlockVector (const unsigned int n_blocks,
 
 
 template <typename Number>
-BlockVector<Number>::BlockVector (const std::vector<unsigned int> &n)
+BlockVector<Number>::BlockVector (const std::vector<size_type> &n)
 {
   reinit (n, false);
 }
@@ -52,7 +57,7 @@ BlockVector<Number>::BlockVector (const BlockVector<Number> &v)
   this->components.resize (v.n_blocks());
   this->block_indices = v.block_indices;
 
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->components[i] = v.components[i];
 }
 
@@ -78,7 +83,7 @@ BlockVector<Number>::BlockVector (const TrilinosWrappers::BlockVector &v)
   this->block_indices = v.get_block_indices();
   this->components.resize(this->n_blocks());
 
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->components[i] = v.block(i);
 
   BaseClass::collect_sizes();
@@ -89,23 +94,23 @@ BlockVector<Number>::BlockVector (const TrilinosWrappers::BlockVector &v)
 
 template <typename Number>
 void BlockVector<Number>::reinit (const unsigned int n_bl,
-                                  const unsigned int bl_sz,
+                                  const size_type    bl_sz,
                                   const bool         fast)
 {
-  std::vector<unsigned int> n(n_bl, bl_sz);
+  std::vector<size_type> n(n_bl, bl_sz);
   reinit(n, fast);
 }
 
 
 template <typename Number>
-void BlockVector<Number>::reinit (const std::vector<unsigned int> &n,
-                                  const bool                       fast)
+void BlockVector<Number>::reinit (const std::vector<size_type> &n,
+                                  const bool                    fast)
 {
   this->block_indices.reinit (n);
   if (this->components.size() != this->n_blocks())
     this->components.resize(this->n_blocks());
 
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->components[i].reinit(n[i], fast);
 }
 
@@ -119,7 +124,7 @@ void BlockVector<Number>::reinit (
   if (this->components.size() != this->n_blocks())
     this->components.resize(this->n_blocks());
 
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->components[i].reinit(n.block_size(i), fast);
 }
 
@@ -133,7 +138,7 @@ void BlockVector<Number>::reinit (const BlockVector<Number2> &v,
   if (this->components.size() != this->n_blocks())
     this->components.resize(this->n_blocks());
 
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->block(i).reinit(v.block(i), fast);
 }
 
@@ -161,7 +166,7 @@ void BlockVector<Number>::swap (BlockVector<Number> &v)
   Assert (this->n_blocks() == v.n_blocks(),
           ExcDimensionMismatch(this->n_blocks(), v.n_blocks()));
 
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     dealii::swap (this->components[i], v.components[i]);
   dealii::swap (this->block_indices, v.block_indices);
 }
@@ -174,7 +179,7 @@ void BlockVector<Number>::print (std::ostream       &out,
                                  const bool          scientific,
                                  const bool          across) const
 {
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     {
       if (across)
         out << 'C' << i << ':';
@@ -189,7 +194,7 @@ void BlockVector<Number>::print (std::ostream       &out,
 template <typename Number>
 void BlockVector<Number>::block_write (std::ostream &out) const
 {
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->components[i].block_write(out);
 }
 
@@ -198,7 +203,7 @@ void BlockVector<Number>::block_write (std::ostream &out) const
 template <typename Number>
 void BlockVector<Number>::block_read (std::istream &in)
 {
-  for (unsigned int i=0; i<this->n_blocks(); ++i)
+  for (size_type i=0; i<this->n_blocks(); ++i)
     this->components[i].block_read(in);
 }
 
index a512e1aa4424ac67cf4c2dbf816a9c31f37d1867..c66dfd47306e58380ec7f5db523bc4bb20f15f3c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__block_vector_base_h
 #define __deal2__block_vector_base_h
 
@@ -299,6 +304,11 @@ namespace internal
       typedef Iterator<BlockVectorType,!constness> InverseConstnessIterator;
 
     public:
+      /**
+       * Declare the type for container size.
+       */
+      typedef types::global_dof_index size_type;
+
       /**
        * Type of the number this
        * iterator points
@@ -354,8 +364,8 @@ namespace internal
        * const or non-const
        * reference.
        */
-      Iterator (BlockVector    &parent,
-                const unsigned int  global_index);
+      Iterator (BlockVector     &parent,
+                const size_type  global_index);
 
       /**
        * Copy constructor.
@@ -382,12 +392,12 @@ namespace internal
        * the respective member
        * variables.
        */
-      Iterator (BlockVector        &parent,
-                const unsigned int  global_index,
-                const unsigned int  current_block,
-                const unsigned int  index_within_block,
-                const unsigned int  next_break_forward,
-                const unsigned int  next_break_backward);
+      Iterator (BlockVector     &parent,
+                const size_type  global_index,
+                const size_type  current_block,
+                const size_type  index_within_block,
+                const size_type  next_break_forward,
+                const size_type  next_break_backward);
 
     public:
 
@@ -614,7 +624,7 @@ namespace internal
        * element to which we
        * presently point.
        */
-      unsigned int     global_index;
+      size_type     global_index;
 
       /**
        * Current block and index
@@ -623,7 +633,7 @@ namespace internal
        * to.
        */
       unsigned int current_block;
-      unsigned int index_within_block;
+      size_type index_within_block;
 
       /**
        * Indices of the global
@@ -637,8 +647,8 @@ namespace internal
        * efficient than always
        * asking the parent object.
        */
-      unsigned int next_break_forward;
-      unsigned int next_break_backward;
+      size_type next_break_forward;
+      size_type next_break_backward;
 
       /**
        * Move forward one element.
@@ -734,8 +744,7 @@ public:
   typedef dealii::internal::BlockVectorIterators::Iterator<BlockVectorBase,true>  const_iterator;
   typedef typename BlockType::reference       reference;
   typedef typename BlockType::const_reference const_reference;
-
-  typedef std::size_t                     size_type;
+  typedef types::global_dof_index             size_type;
 
   /**
    * Declare a type that has holds
@@ -844,7 +853,7 @@ public:
    * is the sum of the dimensions of all
    * components.
    */
-  unsigned int size () const;
+  std::size_t size () const;
 
   /**
    * Return an index set that describes which elements of this vector
@@ -895,20 +904,20 @@ public:
   /**
    * Access components, returns U(i).
    */
-  value_type operator() (const unsigned int i) const;
+  value_type operator() (const size_type i) const;
 
   /**
    * Access components, returns U(i)
    * as a writeable reference.
    */
-  reference operator() (const unsigned int i);
+  reference operator() (const size_type i);
 
   /**
    * Access components, returns U(i).
    *
    * Exactly the same as operator().
    */
-  value_type operator[] (const unsigned int i) const;
+  value_type operator[] (const size_type i) const;
 
   /**
    * Access components, returns U(i)
@@ -916,7 +925,7 @@ public:
    *
    * Exactly the same as operator().
    */
-  reference operator[] (const unsigned int i);
+  reference operator[] (const size_type i);
 
   /**
    * Copy operator: fill all components of
@@ -998,7 +1007,7 @@ public:
    * in the local range of this processor.
    * Asks the corresponding block.
    */
-  bool in_local_range (const types::global_dof_index global_index) const;
+  bool in_local_range (const size_type global_index) const;
 
   /**
    * Return whether the vector contains only
@@ -1044,8 +1053,8 @@ public:
    * indices.
    */
   template <typename Number>
-  void add (const std::vector<unsigned int> &indices,
-            const std::vector<Number>       &values);
+  void add (const std::vector<size_type> &indices,
+            const std::vector<Number>    &values);
 
   /**
    * This is a second collective
@@ -1055,8 +1064,8 @@ public:
    * values.
    */
   template <typename Number>
-  void add (const std::vector<unsigned int> &indices,
-            const Vector<Number>            &values);
+  void add (const std::vector<size_type> &indices,
+            const Vector<Number>         &values);
 
   /**
    * Take an address where
@@ -1068,9 +1077,9 @@ public:
    * functions above.
    */
   template <typename Number>
-  void add (const unsigned int  n_elements,
-            const unsigned int *indices,
-            const Number       *values);
+  void add (const size_type  n_elements,
+            const size_type *indices,
+            const Number    *values);
 
   /**
    * $U(0-DIM)+=s$.  Addition of <tt>s</tt>
@@ -1265,11 +1274,11 @@ namespace internal
     inline
     Iterator<BlockVectorType,constness>::
     Iterator (BlockVector        &parent,
-              const unsigned int  global_index,
-              const unsigned int  current_block,
-              const unsigned int  index_within_block,
-              const unsigned int  next_break_forward,
-              const unsigned int  next_break_backward)
+              const size_type  global_index,
+              const size_type  current_block,
+              const size_type  index_within_block,
+              const size_type  next_break_forward,
+              const size_type  next_break_backward)
       :
       parent (&parent),
       global_index (global_index),
@@ -1673,8 +1682,8 @@ namespace internal
 
     template <class BlockVectorType, bool constness>
     Iterator<BlockVectorType,constness>::
-    Iterator (BlockVector       &parent,
-              const unsigned int global_index)
+    Iterator (BlockVector    &parent,
+              const size_type global_index)
       :
       parent (&parent),
       global_index (global_index)
@@ -1687,7 +1696,7 @@ namespace internal
       // past-the-end
       if (global_index < parent.size())
         {
-          const std::pair<unsigned int, unsigned int>
+          const std::pair<size_type, size_type>
           indices = parent.block_indices.global_to_local(global_index);
           current_block      = indices.first;
           index_within_block = indices.second;
@@ -1706,7 +1715,7 @@ namespace internal
           current_block       = parent.n_blocks();
           index_within_block  = 0;
           next_break_backward = global_index;
-          next_break_forward  = numbers::invalid_unsigned_int;
+          next_break_forward  = numbers::invalid_size_type;
         };
     }
 
@@ -1738,7 +1747,7 @@ namespace internal
             // then move the next
             // boundary arbitrarily far
             // away
-            next_break_forward = numbers::invalid_unsigned_int;
+            next_break_forward = numbers::invalid_size_type;
         };
 
       ++global_index;
@@ -1772,7 +1781,7 @@ namespace internal
         // get into unspecified terrain
         {
           --current_block;
-          index_within_block = numbers::invalid_unsigned_int;
+          index_within_block = numbers::invalid_size_type;
           next_break_forward = 0;
           next_break_backward = 0;
         };
@@ -1795,7 +1804,7 @@ BlockVectorBase<VectorType>::BlockVectorBase ()
 
 template <class VectorType>
 inline
-unsigned int
+std::size_t
 BlockVectorBase<VectorType>::size () const
 {
   return block_indices.total_size();
@@ -1810,16 +1819,12 @@ BlockVectorBase<VectorType>::locally_owned_elements () const
 {
   IndexSet is (size());
 
-  // copy index sets from blocks into the global one
+  // copy index sets from blocks into the global one, shifted
+  // by the appropriate amount for each block
   for (unsigned int b=0; b<n_blocks(); ++b)
     {
       IndexSet x = block(b).locally_owned_elements();
-
-      //TODO: This can surely be made more efficient by just shifting
-      // x
-      for (unsigned int i=0; i<block(b).size(); ++i)
-        if (x.is_element(i))
-          is.add_index(block_indices.local_to_global(b,i));
+      is.add_indices(x, block_indices.block_start(b));
     }
 
   is.compress();
@@ -1876,9 +1881,9 @@ inline
 void
 BlockVectorBase<VectorType>::collect_sizes ()
 {
-  std::vector<unsigned int> sizes (n_blocks());
+  std::vector<size_type> sizes (n_blocks());
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     sizes[i] = block(i).size();
 
   block_indices.reinit(sizes);
@@ -1949,9 +1954,9 @@ template <class VectorType>
 inline
 bool
 BlockVectorBase<VectorType>::in_local_range
-(const types::global_dof_index global_index) const
+(const size_type global_index) const
 {
-  const std::pair<unsigned int,unsigned int> local_index
+  const std::pair<size_type,size_type> local_index
     = block_indices.global_to_local (global_index);
 
   return components[local_index.first].in_local_range (global_index);
@@ -1962,7 +1967,7 @@ template <class VectorType>
 bool
 BlockVectorBase<VectorType>::all_zero () const
 {
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     if (components[i].all_zero() == false)
       return false;
 
@@ -1975,7 +1980,7 @@ template <class VectorType>
 bool
 BlockVectorBase<VectorType>::is_non_negative () const
 {
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     if (components[i].is_non_negative() == false)
       return false;
 
@@ -1993,7 +1998,7 @@ operator * (const BlockVectorBase<VectorType> &v) const
           ExcDimensionMismatch(n_blocks(), v.n_blocks()));
 
   value_type sum = 0.;
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     sum += components[i]*v.components[i];
 
   return sum;
@@ -2005,7 +2010,7 @@ typename BlockVectorBase<VectorType>::real_type
 BlockVectorBase<VectorType>::norm_sqr () const
 {
   real_type sum = 0.;
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     sum += components[i].norm_sqr();
 
   return sum;
@@ -2018,7 +2023,7 @@ typename BlockVectorBase<VectorType>::value_type
 BlockVectorBase<VectorType>::mean_value () const
 {
   value_type sum = 0.;
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     sum += components[i].mean_value() * components[i].size();
 
   return sum/size();
@@ -2031,7 +2036,7 @@ typename BlockVectorBase<VectorType>::real_type
 BlockVectorBase<VectorType>::l1_norm () const
 {
   real_type sum = 0.;
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     sum += components[i].l1_norm();
 
   return sum;
@@ -2053,7 +2058,7 @@ typename BlockVectorBase<VectorType>::real_type
 BlockVectorBase<VectorType>::linfty_norm () const
 {
   real_type sum = 0.;
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       value_type newval = components[i].linfty_norm();
       if (sum<newval)
@@ -2081,7 +2086,7 @@ BlockVectorBase<VectorType>::operator -= (const BlockVectorBase<VectorType> &v)
   Assert (n_blocks() == v.n_blocks(),
           ExcDimensionMismatch(n_blocks(), v.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i] -= v.components[i];
     }
@@ -2094,8 +2099,8 @@ template <class VectorType>
 template <typename Number>
 inline
 void
-BlockVectorBase<VectorType>::add (const std::vector<unsigned int> &indices,
-                                  const std::vector<Number>       &values)
+BlockVectorBase<VectorType>::add (const std::vector<size_type> &indices,
+                                  const std::vector<Number>    &values)
 {
   Assert (indices.size() == values.size(),
           ExcDimensionMismatch(indices.size(), values.size()));
@@ -2108,13 +2113,13 @@ template <class VectorType>
 template <typename Number>
 inline
 void
-BlockVectorBase<VectorType>::add (const std::vector<unsigned int> &indices,
-                                  const Vector<Number>            &values)
+BlockVectorBase<VectorType>::add (const std::vector<size_type> &indices,
+                                  const Vector<Number>         &values)
 {
   Assert (indices.size() == values.size(),
           ExcDimensionMismatch(indices.size(), values.size()));
-  const unsigned int n_indices = indices.size();
-  for (unsigned int i=0; i<n_indices; ++i)
+  const size_type n_indices = indices.size();
+  for (size_type i=0; i<n_indices; ++i)
     (*this)(indices[i]) += values(i);
 }
 
@@ -2124,11 +2129,11 @@ template <class VectorType>
 template <typename Number>
 inline
 void
-BlockVectorBase<VectorType>::add (const unsigned int  n_indices,
-                                  const unsigned int *indices,
-                                  const Number       *values)
+BlockVectorBase<VectorType>::add (const size_type  n_indices,
+                                  const size_type *indices,
+                                  const Number    *values)
 {
-  for (unsigned int i=0; i<n_indices; ++i)
+  for (size_type i=0; i<n_indices; ++i)
     (*this)(indices[i]) += values[i];
 }
 
@@ -2139,7 +2144,7 @@ void BlockVectorBase<VectorType>::add (const value_type a)
 {
   Assert (numbers::is_finite(a), ExcNumberNotFinite());
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].add(a);
     }
@@ -2153,7 +2158,7 @@ void BlockVectorBase<VectorType>::add (const BlockVectorBase<VectorType> &v)
   Assert (n_blocks() == v.n_blocks(),
           ExcDimensionMismatch(n_blocks(), v.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].add(v.components[i]);
     }
@@ -2171,7 +2176,7 @@ void BlockVectorBase<VectorType>::add (const value_type a,
   Assert (n_blocks() == v.n_blocks(),
           ExcDimensionMismatch(n_blocks(), v.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].add(a, v.components[i]);
     }
@@ -2195,7 +2200,7 @@ void BlockVectorBase<VectorType>::add (const value_type a,
           ExcDimensionMismatch(n_blocks(), w.n_blocks()));
 
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].add(a, v.components[i], b, w.components[i]);
     }
@@ -2213,7 +2218,7 @@ void BlockVectorBase<VectorType>::sadd (const value_type x,
   Assert (n_blocks() == v.n_blocks(),
           ExcDimensionMismatch(n_blocks(), v.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].sadd(x, v.components[i]);
     }
@@ -2232,7 +2237,7 @@ void BlockVectorBase<VectorType>::sadd (const value_type x, const value_type a,
   Assert (n_blocks() == v.n_blocks(),
           ExcDimensionMismatch(n_blocks(), v.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].sadd(x, a, v.components[i]);
     }
@@ -2256,7 +2261,7 @@ void BlockVectorBase<VectorType>::sadd (const value_type x, const value_type a,
   Assert (n_blocks() == w.n_blocks(),
           ExcDimensionMismatch(n_blocks(), w.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].sadd(x, a, v.components[i], b, w.components[i]);
     }
@@ -2285,7 +2290,7 @@ void BlockVectorBase<VectorType>::sadd (const value_type x, const value_type a,
   Assert (n_blocks() == y.n_blocks(),
           ExcDimensionMismatch(n_blocks(), y.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].sadd(x, a, v.components[i],
                          b, w.components[i], c, y.components[i]);
@@ -2300,7 +2305,7 @@ void BlockVectorBase<VectorType>::scale (const BlockVector2 &v)
 {
   Assert (n_blocks() == v.n_blocks(),
           ExcDimensionMismatch(n_blocks(), v.n_blocks()));
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     components[i].scale(v.block(i));
 }
 
@@ -2321,7 +2326,7 @@ void BlockVectorBase<VectorType>::equ (const value_type a,
   Assert (n_blocks() == w.n_blocks(),
           ExcDimensionMismatch(n_blocks(), w.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     {
       components[i].equ( a, v.components[i], b, w.components[i]);
     }
@@ -2334,7 +2339,7 @@ std::size_t
 BlockVectorBase<VectorType>::memory_consumption () const
 {
   std::size_t mem = sizeof(this->n_blocks());
-  for (unsigned int i=0; i<this->components.size(); ++i)
+  for (size_type i=0; i<this->components.size(); ++i)
     mem += MemoryConsumption::memory_consumption (this->components[i]);
   mem += MemoryConsumption::memory_consumption (this->block_indices);
   return mem;
@@ -2353,7 +2358,7 @@ void BlockVectorBase<VectorType>::equ (const value_type    a,
   Assert (n_blocks() == v.n_blocks(),
           ExcDimensionMismatch(n_blocks(), v.n_blocks()));
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     components[i].equ( a, v.components[i]);
 }
 
@@ -2362,7 +2367,7 @@ void BlockVectorBase<VectorType>::equ (const value_type    a,
 template <class VectorType>
 void BlockVectorBase<VectorType>::update_ghost_values () const
 {
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     block(i).update_ghost_values ();
 }
 
@@ -2375,7 +2380,7 @@ BlockVectorBase<VectorType>::operator = (const value_type s)
 
   Assert (numbers::is_finite(s), ExcNumberNotFinite());
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     components[i] = s;
 
   return *this;
@@ -2388,7 +2393,7 @@ BlockVectorBase<VectorType>::operator = (const BlockVectorBase<VectorType> &v)
 {
   AssertDimension(n_blocks(), v.n_blocks());
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     components[i] = v.components[i];
 
   return *this;
@@ -2402,7 +2407,7 @@ BlockVectorBase<VectorType>::operator = (const BlockVectorBase<VectorType2> &v)
 {
   AssertDimension(n_blocks(), v.n_blocks());
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     components[i] = v.components[i];
 
   return *this;
@@ -2417,9 +2422,9 @@ BlockVectorBase<VectorType>::operator = (const VectorType &v)
   Assert (size() == v.size(),
           ExcDimensionMismatch(size(), v.size()));
 
-  unsigned int index_v = 0;
-  for (unsigned int b=0; b<n_blocks(); ++b)
-    for (unsigned int i=0; i<block(b).size(); ++i, ++index_v)
+  size_type index_v = 0;
+  for (size_type b=0; b<n_blocks(); ++b)
+    for (size_type i=0; i<block(b).size(); ++i, ++index_v)
       block(b)(i) = v(index_v);
 
   return *this;
@@ -2436,7 +2441,7 @@ operator == (const BlockVectorBase<VectorType2> &v) const
 {
   Assert (block_indices == v.block_indices, ExcDifferentBlockIndices());
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     if ( ! (components[i] == v.components[i]))
       return false;
 
@@ -2453,7 +2458,7 @@ BlockVectorBase<VectorType>::operator *= (const value_type factor)
 
   Assert (numbers::is_finite(factor), ExcNumberNotFinite());
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     components[i] *= factor;
 
   return *this;
@@ -2470,7 +2475,7 @@ BlockVectorBase<VectorType>::operator /= (const value_type factor)
   Assert (numbers::is_finite(factor), ExcNumberNotFinite());
   Assert (factor > 0., ExcDivideByZero() );
 
-  for (unsigned int i=0; i<n_blocks(); ++i)
+  for (size_type i=0; i<n_blocks(); ++i)
     components[i] /= factor;
 
   return *this;
@@ -2480,9 +2485,9 @@ BlockVectorBase<VectorType>::operator /= (const value_type factor)
 template <class VectorType>
 inline
 typename BlockVectorBase<VectorType>::value_type
-BlockVectorBase<VectorType>::operator() (const unsigned int i) const
+BlockVectorBase<VectorType>::operator() (const size_type i) const
 {
-  const std::pair<unsigned int,unsigned int> local_index
+  const std::pair<size_type,size_type> local_index
     = block_indices.global_to_local (i);
   return components[local_index.first](local_index.second);
 }
@@ -2492,9 +2497,9 @@ BlockVectorBase<VectorType>::operator() (const unsigned int i) const
 template <class VectorType>
 inline
 typename BlockVectorBase<VectorType>::reference
-BlockVectorBase<VectorType>::operator() (const unsigned int i)
+BlockVectorBase<VectorType>::operator() (const size_type i)
 {
-  const std::pair<unsigned int,unsigned int> local_index
+  const std::pair<size_type,size_type> local_index
     = block_indices.global_to_local (i);
   return components[local_index.first](local_index.second);
 }
@@ -2504,7 +2509,7 @@ BlockVectorBase<VectorType>::operator() (const unsigned int i)
 template <class VectorType>
 inline
 typename BlockVectorBase<VectorType>::value_type
-BlockVectorBase<VectorType>::operator[] (const unsigned int i) const
+BlockVectorBase<VectorType>::operator[] (const size_type i) const
 {
   return operator()(i);
 }
@@ -2514,7 +2519,7 @@ BlockVectorBase<VectorType>::operator[] (const unsigned int i) const
 template <class VectorType>
 inline
 typename BlockVectorBase<VectorType>::reference
-BlockVectorBase<VectorType>::operator[] (const unsigned int i)
+BlockVectorBase<VectorType>::operator[] (const size_type i)
 {
   return operator()(i);
 }
index 8ceb359cfa6717d624e9e2c535312b9974fcad7c..7de60a2cdc8effa70df3307d62d1b31376b108e5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__chunk_sparse_matrix_h
 #define __deal2__chunk_sparse_matrix_h
 
@@ -294,7 +299,7 @@ namespace ChunkSparseMatrixIterators
      * of the current kind.
      */
     typedef
-    const Accessor<number,Constness> & value_type;
+    const Accessor<number,Constness> &value_type;
 
     /**
      * Constructor. Create an iterator into the matrix @p matrix for the given
@@ -402,6 +407,11 @@ template <typename number>
 class ChunkSparseMatrix : public virtual Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Type of matrix entries. In analogy to
    * the STL container classes.
@@ -576,20 +586,20 @@ public:
    * Return the dimension of the image space.  To remember: the matrix is of
    * dimension $m \times n$.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Return the dimension of the range space.  To remember: the matrix is of
    * dimension $m \times n$.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Return the number of nonzero elements of this matrix. Actually, it
    * returns the number of entries in the sparsity pattern; if any of the
    * entries should happen to be zero, it is counted anyway.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return the number of actually nonzero elements of this matrix.
@@ -598,7 +608,7 @@ public:
    * count all entries of the sparsity pattern but only the ones that are
    * nonzero.
    */
-  unsigned int n_actually_nonzero_elements () const;
+  size_type n_actually_nonzero_elements () const;
 
   /**
    * Return a (constant) reference to the underlying sparsity pattern of this
@@ -626,8 +636,8 @@ public:
    * entry does not exist or if <tt>value</tt> is not a finite number. Still,
    * it is allowed to store zero values in non-existent fields.
    */
-  void set (const unsigned int i,
-            const unsigned int j,
+  void set (const size_type i,
+            const size_type j,
             const number value);
 
   /**
@@ -635,8 +645,8 @@ public:
    * entry does not exist or if <tt>value</tt> is not a finite number. Still,
    * it is allowed to store zero values in non-existent fields.
    */
-  void add (const unsigned int i,
-            const unsigned int j,
+  void add (const size_type i,
+            const size_type j,
             const number value);
 
   /**
@@ -649,12 +659,12 @@ public:
    * i.e., zero values won't be added into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number2      *values,
-            const bool          elide_zero_values = true,
-            const bool          col_indices_are_sorted = false);
+  void add (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number2   *values,
+            const bool       elide_zero_values = true,
+            const bool       col_indices_are_sorted = false);
 
   /**
    * Multiply the entire matrix by a fixed factor.
@@ -760,8 +770,8 @@ public:
    * classes instead, since they are tailored better to a sparse matrix
    * structure.
    */
-  number operator () (const unsigned int i,
-                      const unsigned int j) const;
+  number operator () (const size_type i,
+                      const size_type j) const;
 
   /**
    * This function is mostly like operator()() in that it returns the value of
@@ -775,8 +785,8 @@ public:
    * classes instead, since they are tailored better to a sparse matrix
    * structure.
    */
-  number el (const unsigned int i,
-             const unsigned int j) const;
+  number el (const size_type i,
+             const size_type j) const;
 
   /**
    * Return the main diagonal
@@ -790,13 +800,13 @@ public:
    * each row and access therefore does not involve searching for the right
    * column number.
    */
-  number diag_element (const unsigned int i) const;
+  number diag_element (const size_type i) const;
 
   /**
    * Same as above, but return a writeable reference. You're sure you know
    * what you do?
    */
-  number &diag_element (const unsigned int i);
+  number &diag_element (const size_type i);
 
 //@}
   /**
@@ -1015,8 +1025,8 @@ public:
    */
   template <typename somenumber>
   void PSOR (Vector<somenumber> &v,
-             const std::vector<unsigned int> &permutation,
-             const std::vector<unsigned int> &inverse_permutation,
+             const std::vector<size_type> &permutation,
+             const std::vector<size_type> &inverse_permutation,
              const number        om = 1.) const;
 
   /**
@@ -1031,8 +1041,8 @@ public:
    */
   template <typename somenumber>
   void TPSOR (Vector<somenumber> &v,
-              const std::vector<unsigned int> &permutation,
-              const std::vector<unsigned int> &inverse_permutation,
+              const std::vector<size_type> &permutation,
+              const std::vector<size_type> &inverse_permutation,
               const number        om = 1.) const;
 
   /**
@@ -1303,13 +1313,13 @@ private:
    * sparsity pattern with a smaller size to this object, using the reinit()
    * function.
    */
-  unsigned int max_len;
+  size_type max_len;
 
   /**
    * Return the location of entry $(i,j)$ within the val array.
    */
-  unsigned int compute_location (const unsigned int i,
-                                 const unsigned int j) const;
+  size_type compute_location (const size_type i,
+                              const size_type j) const;
 
   // make all other sparse matrices friends
   template <typename somenumber> friend class ChunkSparseMatrix;
@@ -1331,7 +1341,8 @@ private:
 
 template <typename number>
 inline
-unsigned int ChunkSparseMatrix<number>::m () const
+typename ChunkSparseMatrix<number>::size_type
+ChunkSparseMatrix<number>::m () const
 {
   Assert (cols != 0, ExcNotInitialized());
   return cols->rows;
@@ -1340,7 +1351,8 @@ unsigned int ChunkSparseMatrix<number>::m () const
 
 template <typename number>
 inline
-unsigned int ChunkSparseMatrix<number>::n () const
+typename ChunkSparseMatrix<number>::size_type
+ChunkSparseMatrix<number>::n () const
 {
   Assert (cols != 0, ExcNotInitialized());
   return cols->cols;
@@ -1361,13 +1373,13 @@ ChunkSparseMatrix<number>::get_sparsity_pattern () const
 
 template <typename number>
 inline
-unsigned int
-ChunkSparseMatrix<number>::compute_location (const unsigned int i,
-                                             const unsigned int j) const
+typename ChunkSparseMatrix<number>::size_type
+ChunkSparseMatrix<number>::compute_location (const size_type i,
+                                             const size_type j) const
 {
-  const unsigned int chunk_size = cols->get_chunk_size();
-  const unsigned int chunk_index
-  = cols->sparsity_pattern(i/chunk_size, j/chunk_size);
+  const size_type chunk_size = cols->get_chunk_size();
+  const size_type chunk_index
+    = cols->sparsity_pattern(i/chunk_size, j/chunk_size);
 
   if (chunk_index == ChunkSparsityPattern::invalid_entry)
     return ChunkSparsityPattern::invalid_entry;
@@ -1384,8 +1396,8 @@ ChunkSparseMatrix<number>::compute_location (const unsigned int i,
 
 template <typename number>
 inline
-void ChunkSparseMatrix<number>::set (const unsigned int i,
-                                     const unsigned int j,
+void ChunkSparseMatrix<number>::set (const size_type i,
+                                     const size_type j,
                                      const number value)
 {
 
@@ -1394,7 +1406,7 @@ void ChunkSparseMatrix<number>::set (const unsigned int i,
   Assert (cols != 0, ExcNotInitialized());
   // it is allowed to set elements of the matrix that are not part of the
   // sparsity pattern, if the value to which we set it is zero
-  const unsigned int index = compute_location(i,j);
+  const size_type index = compute_location(i,j);
   Assert ((index != SparsityPattern::invalid_entry) ||
           (value == 0.),
           ExcInvalidIndex(i,j));
@@ -1407,8 +1419,8 @@ void ChunkSparseMatrix<number>::set (const unsigned int i,
 
 template <typename number>
 inline
-void ChunkSparseMatrix<number>::add (const unsigned int i,
-                                     const unsigned int j,
+void ChunkSparseMatrix<number>::add (const size_type i,
+                                     const size_type j,
                                      const number value)
 {
 
@@ -1418,7 +1430,7 @@ void ChunkSparseMatrix<number>::add (const unsigned int i,
 
   if (value != 0.)
     {
-      const unsigned int index = compute_location(i,j);
+      const size_type index = compute_location(i,j);
       Assert ((index != ChunkSparsityPattern::invalid_entry),
               ExcInvalidIndex(i,j));
 
@@ -1431,15 +1443,15 @@ void ChunkSparseMatrix<number>::add (const unsigned int i,
 template <typename number>
 template <typename number2>
 inline
-void ChunkSparseMatrix<number>::add (const unsigned int row,
-                                     const unsigned int n_cols,
-                                     const unsigned int *col_indices,
-                                     const number2      *values,
-                                     const bool          /*elide_zero_values*/,
-                                     const bool          /*col_indices_are_sorted*/)
+void ChunkSparseMatrix<number>::add (const size_type  row,
+                                     const size_type  n_cols,
+                                     const size_type *col_indices,
+                                     const number2   *values,
+                                     const bool       /*elide_zero_values*/,
+                                     const bool       /*col_indices_are_sorted*/)
 {
   // TODO: could be done more efficiently...
-  for (unsigned int col=0; col<n_cols; ++col)
+  for (size_type col=0; col<n_cols; ++col)
     add(row, col_indices[col], static_cast<number>(values[col]));
 }
 
@@ -1453,7 +1465,7 @@ ChunkSparseMatrix<number>::operator *= (const number factor)
   Assert (cols != 0, ExcNotInitialized());
   Assert (val != 0, ExcNotInitialized());
 
-  const unsigned int chunk_size = cols->get_chunk_size();
+  const size_type chunk_size = cols->get_chunk_size();
 
   // multiply all elements of the matrix with the given factor. this includes
   // the padding elements in chunks that overlap the boundaries of the actual
@@ -1483,7 +1495,7 @@ ChunkSparseMatrix<number>::operator /= (const number factor)
 
   const number factor_inv = 1. / factor;
 
-  const unsigned int chunk_size = cols->get_chunk_size();
+  const size_type chunk_size = cols->get_chunk_size();
 
   // multiply all elements of the matrix with the given factor. this includes
   // the padding elements in chunks that overlap the boundaries of the actual
@@ -1505,8 +1517,8 @@ ChunkSparseMatrix<number>::operator /= (const number factor)
 
 template <typename number>
 inline
-number ChunkSparseMatrix<number>::operator () (const unsigned int i,
-                                               const unsigned int j) const
+number ChunkSparseMatrix<number>::operator () (const size_type i,
+                                               const size_type j) const
 {
   Assert (cols != 0, ExcNotInitialized());
   AssertThrow (compute_location(i,j) != SparsityPattern::invalid_entry,
@@ -1518,11 +1530,11 @@ number ChunkSparseMatrix<number>::operator () (const unsigned int i,
 
 template <typename number>
 inline
-number ChunkSparseMatrix<number>::el (const unsigned int i,
-                                      const unsigned int j) const
+number ChunkSparseMatrix<number>::el (const size_type i,
+                                      const size_type j) const
 {
   Assert (cols != 0, ExcNotInitialized());
-  const unsigned int index = compute_location(i,j);
+  const size_type index = compute_location(i,j);
 
   if (index != ChunkSparsityPattern::invalid_entry)
     return val[index];
@@ -1534,7 +1546,7 @@ number ChunkSparseMatrix<number>::el (const unsigned int i,
 
 template <typename number>
 inline
-number ChunkSparseMatrix<number>::diag_element (const unsigned int i) const
+number ChunkSparseMatrix<number>::diag_element (const size_type i) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (m() == n(),  ExcNotQuadratic());
@@ -1542,7 +1554,7 @@ number ChunkSparseMatrix<number>::diag_element (const unsigned int i) const
 
   // Use that the first element in each row of a quadratic matrix is the main
   // diagonal of the chunk sparsity pattern
-  const unsigned int chunk_size = cols->get_chunk_size();
+  const size_type chunk_size = cols->get_chunk_size();
   return val[cols->sparsity_pattern.rowstart[i/chunk_size]
              *
              chunk_size * chunk_size
@@ -1561,13 +1573,13 @@ void
 ChunkSparseMatrix<number>::copy_from (const ForwardIterator begin,
                                       const ForwardIterator end)
 {
-  Assert (static_cast<unsigned int>(std::distance (begin, end)) == m(),
+  Assert (static_cast<size_type >(std::distance (begin, end)) == m(),
           ExcIteratorRange (std::distance (begin, end), m()));
 
   // for use in the inner loop, we define a typedef to the type of the inner
   // iterators
   typedef typename std::iterator_traits<ForwardIterator>::value_type::const_iterator inner_iterator;
-  unsigned int row=0;
+  size_type row=0;
   for (ForwardIterator i=begin; i!=end; ++i, ++row)
     {
       const inner_iterator end_of_row = i->end();
index bbc1fb99442846f5bbdc8f97869959b9e319d3a7..f9d396419d57cb441be76035fe683b35d164cb2e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__chunk_sparse_matrix_templates_h
 #define __deal2__chunk_sparse_matrix_templates_h
 
@@ -44,29 +49,36 @@ namespace internal
   namespace ChunkSparseMatrix
   {
     /**
-     * Add the result of multiplying a chunk of size chunk_size times
-     * chunk_size by a source vector fragment of size chunk_size to the
-     * destination vector fragment.
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
+    /**
+     * Add the result of multiplying a chunk
+     * of size chunk_size times chunk_size by
+     * a source vector fragment of size
+     * chunk_size to the destination vector
+     * fragment.
      */
     template <typename MatrixIterator,
              typename SrcIterator,
              typename DstIterator>
     inline
     void
-    chunk_vmult_add (const unsigned int   chunk_size,
+    chunk_vmult_add (const size_type      chunk_size,
                      const MatrixIterator matrix,
                      const SrcIterator    src,
                      DstIterator          dst)
     {
       MatrixIterator matrix_row = matrix;
 
-      for (unsigned int i=0; i<chunk_size;
+      for (size_type i=0; i<chunk_size;
            ++i,  matrix_row += chunk_size)
         {
           typename std::iterator_traits<DstIterator>::value_type
           sum = 0;
 
-          for (unsigned int j=0; j<chunk_size; ++j)
+          for (size_type j=0; j<chunk_size; ++j)
             sum += matrix_row[j] * src[j];
 
           dst[i] += sum;
@@ -84,20 +96,20 @@ namespace internal
              typename DstIterator>
     inline
     void
-    chunk_vmult_subtract (const unsigned int   chunk_size,
+    chunk_vmult_subtract (const size_type chunk_size,
                           const MatrixIterator matrix,
                           const SrcIterator    src,
                           DstIterator          dst)
     {
       MatrixIterator matrix_row = matrix;
 
-      for (unsigned int i=0; i<chunk_size;
+      for (size_type i=0; i<chunk_size;
            ++i,  matrix_row += chunk_size)
         {
           typename std::iterator_traits<DstIterator>::value_type
           sum = 0;
 
-          for (unsigned int j=0; j<chunk_size; ++j)
+          for (size_type j=0; j<chunk_size; ++j)
             sum += matrix_row[j] * src[j];
 
           dst[i] -= sum;
@@ -115,17 +127,17 @@ namespace internal
              typename DstIterator>
     inline
     void
-    chunk_Tvmult_add (const unsigned int   chunk_size,
+    chunk_Tvmult_add (const size_type      chunk_size,
                       const MatrixIterator matrix,
                       const SrcIterator    src,
                       DstIterator          dst)
     {
-      for (unsigned int i=0; i<chunk_size; ++i)
+      for (size_type i=0; i<chunk_size; ++i)
         {
           typename std::iterator_traits<DstIterator>::value_type
           sum = 0;
 
-          for (unsigned int j=0; j<chunk_size; ++j)
+          for (size_type j=0; j<chunk_size; ++j)
             sum += matrix[j*chunk_size+i] * src[j];
 
           dst[i] += sum;
@@ -143,7 +155,7 @@ namespace internal
              typename SrcIterator2>
     inline
     result_type
-    chunk_matrix_scalar_product (const unsigned int   chunk_size,
+    chunk_matrix_scalar_product (const size_type      chunk_size,
                                  const MatrixIterator matrix,
                                  const SrcIterator1   u,
                                  const SrcIterator2   v)
@@ -152,13 +164,13 @@ namespace internal
 
       MatrixIterator matrix_row = matrix;
 
-      for (unsigned int i=0; i<chunk_size;
+      for (size_type i=0; i<chunk_size;
            ++i,  matrix_row += chunk_size)
         {
           typename std::iterator_traits<SrcIterator2>::value_type
           sum = 0;
 
-          for (unsigned int j=0; j<chunk_size; ++j)
+          for (size_type j=0; j<chunk_size; ++j)
             sum += matrix_row[j] * v[j];
 
           result += u[i] * sum;
@@ -185,26 +197,28 @@ namespace internal
                                 const unsigned int  end_row,
                                 const number       *values,
                                 const std::size_t  *rowstart,
-                                const unsigned int *colnums,
+                                const size_type    *colnums,
                                 const InVector     &src,
                                 OutVector          &dst)
     {
-      const unsigned int m = cols.n_rows();
-      const unsigned int n = cols.n_cols();
-      const unsigned int chunk_size = cols.get_chunk_size();
+      const size_type m = cols.n_rows();
+      const size_type n = cols.n_cols();
+      const size_type chunk_size = cols.get_chunk_size();
 
       // loop over all chunks. note that we need to treat the last chunk row
       // and column differently if they have padding elements
-      const unsigned int n_filled_last_rows = m % chunk_size;
-      const unsigned int n_filled_last_cols = n % chunk_size;
+      const size_type n_filled_last_rows = m % chunk_size;
+      const size_type n_filled_last_cols = n % chunk_size;
 
-      const unsigned int last_regular_row = n_filled_last_rows > 0 ?
-                                            std::min(m/chunk_size, end_row) : end_row;
-      const unsigned int irregular_col = n/chunk_size;
+      const size_type last_regular_row = n_filled_last_rows > 0 ?
+                                         std::min(m/chunk_size,
+                                                  static_cast<size_type>(end_row)) :
+                                         end_row;
+      const size_type irregular_col = n/chunk_size;
 
       typename OutVector::iterator dst_ptr = dst.begin()+chunk_size*begin_row;
       const number *val_ptr= &values[rowstart[begin_row]*chunk_size*chunk_size];
-      const unsigned int *colnum_ptr = &colnums[rowstart[begin_row]];
+      const size_type *colnum_ptr = &colnums[rowstart[begin_row]];
       for (unsigned int chunk_row=begin_row; chunk_row<last_regular_row;
            ++chunk_row)
         {
@@ -219,8 +233,8 @@ namespace internal
                                  dst_ptr);
               else
                 // we're at a chunk column that has padding
-                for (unsigned int r=0; r<chunk_size; ++r)
-                  for (unsigned int c=0; c<n_filled_last_cols; ++c)
+                for (size_type r=0; r<chunk_size; ++r)
+                  for (size_type c=0; c<n_filled_last_cols; ++c)
                     dst_ptr[r] += (val_ptr[r*chunk_size + c] *
                                    src(*colnum_ptr * chunk_size + c));
 
@@ -234,7 +248,7 @@ namespace internal
       // now deal with last chunk row if necessary
       if (n_filled_last_rows > 0 && end_row == (m/chunk_size+1))
         {
-          const unsigned int chunk_row = last_regular_row;
+          const size_type chunk_row = last_regular_row;
 
           const number *const val_end_of_row = &values[rowstart[chunk_row+1] *
                                                        chunk_size * chunk_size];
@@ -243,16 +257,16 @@ namespace internal
               if (*colnum_ptr != irregular_col)
                 {
                   // we're at a chunk row but not column that has padding
-                  for (unsigned int r=0; r<n_filled_last_rows; ++r)
-                    for (unsigned int c=0; c<chunk_size; ++c)
+                  for (size_type r=0; r<n_filled_last_rows; ++r)
+                    for (size_type c=0; c<chunk_size; ++c)
                       dst_ptr[r]
                       += (val_ptr[r*chunk_size + c] *
                           src(*colnum_ptr * chunk_size + c));
                 }
               else
                 // we're at a chunk row and column that has padding
-                for (unsigned int r=0; r<n_filled_last_rows; ++r)
-                  for (unsigned int c=0; c<n_filled_last_cols; ++c)
+                for (size_type r=0; r<n_filled_last_rows; ++r)
+                  for (size_type c=0; c<n_filled_last_cols; ++c)
                     dst_ptr[r]
                     += (val_ptr[r*chunk_size + c] *
                         src(*colnum_ptr * chunk_size + c));
@@ -334,7 +348,7 @@ ChunkSparseMatrix<number>::ChunkSparseMatrix (const ChunkSparsityPattern &c,
   Assert (c.n_cols() == id.n(), ExcDimensionMismatch (c.n_cols(), id.n()));
 
   reinit (c);
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     this->set(i,i,1.);
 }
 
@@ -414,7 +428,7 @@ ChunkSparseMatrix<number>::operator= (const IdentityMatrix  &id)
           ExcDimensionMismatch (cols->n_cols(), id.n()));
 
   *this = 0;
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     this->set(i,i,1.);
 
   return *this;
@@ -439,9 +453,9 @@ ChunkSparseMatrix<number>::reinit (const ChunkSparsityPattern &sparsity)
 
   // allocate not just m() * n() elements but enough so that we can store full
   // chunks. this entails some padding elements
-  const unsigned int chunk_size = cols->get_chunk_size();
-  const unsigned int N = cols->sparsity_pattern.n_nonzero_elements() *
-                         chunk_size * chunk_size;
+  const size_type chunk_size = cols->get_chunk_size();
+  const size_type N = cols->sparsity_pattern.n_nonzero_elements() *
+                      chunk_size * chunk_size;
   if (N > max_len || max_len == 0)
     {
       if (val != 0)
@@ -483,7 +497,7 @@ ChunkSparseMatrix<number>::empty () const
 
 
 template <typename number>
-unsigned int
+typename ChunkSparseMatrix<number>::size_type
 ChunkSparseMatrix<number>::n_nonzero_elements () const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -493,7 +507,7 @@ ChunkSparseMatrix<number>::n_nonzero_elements () const
 
 
 template <typename number>
-unsigned int
+typename ChunkSparseMatrix<number>::size_type
 ChunkSparseMatrix<number>::n_actually_nonzero_elements () const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -501,7 +515,7 @@ ChunkSparseMatrix<number>::n_actually_nonzero_elements () const
   // count those elements that are nonzero, even if they lie in the padding
   // around the matrix. since we have the invariant that padding elements are
   // zero, nothing bad can happen here
-  const unsigned int chunk_size = cols->get_chunk_size();
+  const size_type chunk_size = cols->get_chunk_size();
   return std::count_if(&val[0],
                        &val[cols->sparsity_pattern.n_nonzero_elements () *
                             chunk_size * chunk_size],
@@ -532,7 +546,7 @@ ChunkSparseMatrix<number>::copy_from (const ChunkSparseMatrix<somenumber> &matri
   Assert (cols == matrix.cols, ExcDifferentChunkSparsityPatterns());
 
   // copy everything, including padding elements
-  const unsigned int chunk_size = cols->get_chunk_size();
+  const size_type chunk_size = cols->get_chunk_size();
   std::copy (&matrix.val[0],
              &matrix.val[cols->sparsity_pattern.n_nonzero_elements()
                          * chunk_size * chunk_size],
@@ -552,8 +566,8 @@ ChunkSparseMatrix<number>::copy_from (const FullMatrix<somenumber> &matrix)
   *this = 0;
 
   // then copy old matrix
-  for (unsigned int row=0; row<matrix.m(); ++row)
-    for (unsigned int col=0; col<matrix.n(); ++col)
+  for (size_type row=0; row<matrix.m(); ++row)
+    for (size_type col=0; col<matrix.n(); ++col)
       if (matrix(row,col) != 0)
         set (row, col, matrix(row,col));
 }
@@ -571,14 +585,14 @@ ChunkSparseMatrix<number>::add (const number factor,
   Assert (cols == matrix.cols, ExcDifferentChunkSparsityPatterns());
 
   // add everything, including padding elements
-  const unsigned int chunk_size = cols->get_chunk_size();
+  const size_type     chunk_size = cols->get_chunk_size();
   number             *val_ptr    = &val[0];
   const somenumber   *matrix_ptr = &matrix.val[0];
   const number *const end_ptr    = &val[cols->sparsity_pattern.n_nonzero_elements()
                                         * chunk_size * chunk_size];
 
   while (val_ptr != end_ptr)
-    *val_ptr++ += factor * *matrix_ptr++;
+    *val_ptr++ += factor **matrix_ptr++;
 }
 
 
@@ -671,24 +685,24 @@ ChunkSparseMatrix<number>::Tvmult_add (OutVector &dst,
 
   Assert (!PointerComparison::equal(&src, &dst), ExcSourceEqualsDestination());
 
-  const unsigned int n_chunk_rows = cols->sparsity_pattern.n_rows();
+  const size_type n_chunk_rows = cols->sparsity_pattern.n_rows();
 
   // loop over all chunks. note that we need to treat the last chunk row and
   // column differently if they have padding elements
   const bool rows_have_padding = (m() % cols->chunk_size != 0),
              cols_have_padding = (n() % cols->chunk_size != 0);
 
-  const unsigned int n_regular_chunk_rows
+  const size_type n_regular_chunk_rows
     = (rows_have_padding ?
        n_chunk_rows-1 :
        n_chunk_rows);
 
   // like in vmult_add, but don't keep an iterator into dst around since we're
   // not traversing it sequentially this time
-  const number       *val_ptr    = val;
-  const unsigned int *colnum_ptr = cols->sparsity_pattern.colnums;
+  const number    *val_ptr    = val;
+  const size_type *colnum_ptr = cols->sparsity_pattern.colnums;
 
-  for (unsigned int chunk_row=0; chunk_row<n_regular_chunk_rows; ++chunk_row)
+  for (size_type chunk_row=0; chunk_row<n_regular_chunk_rows; ++chunk_row)
     {
       const number *const val_end_of_row = &val[cols->sparsity_pattern.rowstart[chunk_row+1]
                                                 * cols->chunk_size
@@ -705,8 +719,8 @@ ChunkSparseMatrix<number>::Tvmult_add (OutVector &dst,
              dst.begin() + *colnum_ptr * cols->chunk_size);
           else
             // we're at a chunk column that has padding
-            for (unsigned int r=0; r<cols->chunk_size; ++r)
-              for (unsigned int c=0; c<n() % cols->chunk_size; ++c)
+            for (size_type r=0; r<cols->chunk_size; ++r)
+              for (size_type c=0; c<n() % cols->chunk_size; ++c)
                 dst(*colnum_ptr * cols->chunk_size + c)
                 += (val_ptr[r*cols->chunk_size + c] *
                     src(chunk_row * cols->chunk_size + r));
@@ -719,7 +733,7 @@ ChunkSparseMatrix<number>::Tvmult_add (OutVector &dst,
   // now deal with last chunk row if necessary
   if (rows_have_padding)
     {
-      const unsigned int chunk_row = n_chunk_rows - 1;
+      const size_type chunk_row = n_chunk_rows - 1;
 
       const number *const val_end_of_row = &val[cols->sparsity_pattern.rowstart[chunk_row+1]
                                                 * cols->chunk_size
@@ -731,16 +745,16 @@ ChunkSparseMatrix<number>::Tvmult_add (OutVector &dst,
               (*colnum_ptr != cols->sparsity_pattern.n_cols()-1))
             {
               // we're at a chunk row but not column that has padding
-              for (unsigned int r=0; r<m() % cols->chunk_size; ++r)
-                for (unsigned int c=0; c<cols->chunk_size; ++c)
+              for (size_type r=0; r<m() % cols->chunk_size; ++r)
+                for (size_type c=0; c<cols->chunk_size; ++c)
                   dst(*colnum_ptr * cols->chunk_size + c)
                   += (val_ptr[r*cols->chunk_size + c] *
                       src(chunk_row * cols->chunk_size + r));
             }
           else
             // we're at a chunk row and column that has padding
-            for (unsigned int r=0; r<m() % cols->chunk_size; ++r)
-              for (unsigned int c=0; c<n() % cols->chunk_size; ++c)
+            for (size_type r=0; r<m() % cols->chunk_size; ++r)
+              for (size_type c=0; c<n() % cols->chunk_size; ++c)
                 dst(*colnum_ptr * cols->chunk_size + c)
                 += (val_ptr[r*cols->chunk_size + c] *
                     src(chunk_row * cols->chunk_size + r));
@@ -767,23 +781,23 @@ ChunkSparseMatrix<number>::matrix_norm_square (const Vector<somenumber> &v) cons
   ////////////////
   // like matrix_scalar_product, except that the two vectors are now the same
 
-  const unsigned int n_chunk_rows = cols->sparsity_pattern.n_rows();
+  const size_type n_chunk_rows = cols->sparsity_pattern.n_rows();
 
   // loop over all chunks. note that we need to treat the last chunk row and
   // column differently if they have padding elements
   const bool rows_have_padding = (m() % cols->chunk_size != 0),
              cols_have_padding = (n() % cols->chunk_size != 0);
 
-  const unsigned int n_regular_chunk_rows
+  const size_type n_regular_chunk_rows
     = (rows_have_padding ?
        n_chunk_rows-1 :
        n_chunk_rows);
 
-  const number       *val_ptr    = val;
-  const unsigned int *colnum_ptr = cols->sparsity_pattern.colnums;
+  const number    *val_ptr    = val;
+  const size_type *colnum_ptr = cols->sparsity_pattern.colnums;
   typename Vector<somenumber>::const_iterator v_ptr = v.begin();
 
-  for (unsigned int chunk_row=0; chunk_row<n_regular_chunk_rows; ++chunk_row)
+  for (size_type chunk_row=0; chunk_row<n_regular_chunk_rows; ++chunk_row)
     {
       const number *const val_end_of_row = &val[cols->sparsity_pattern.rowstart[chunk_row+1]
                                                 * cols->chunk_size
@@ -802,8 +816,8 @@ ChunkSparseMatrix<number>::matrix_norm_square (const Vector<somenumber> &v) cons
                v.begin() + *colnum_ptr * cols->chunk_size);
           else
             // we're at a chunk column that has padding
-            for (unsigned int r=0; r<cols->chunk_size; ++r)
-              for (unsigned int c=0; c<n() % cols->chunk_size; ++c)
+            for (size_type r=0; r<cols->chunk_size; ++r)
+              for (size_type c=0; c<n() % cols->chunk_size; ++c)
                 result
                 +=
                   v(chunk_row * cols->chunk_size + r)
@@ -821,7 +835,7 @@ ChunkSparseMatrix<number>::matrix_norm_square (const Vector<somenumber> &v) cons
   // now deal with last chunk row if necessary
   if (rows_have_padding)
     {
-      const unsigned int chunk_row = n_chunk_rows - 1;
+      const size_type chunk_row = n_chunk_rows - 1;
 
       const number *const val_end_of_row = &val[cols->sparsity_pattern.rowstart[chunk_row+1]
                                                 * cols->chunk_size
@@ -833,8 +847,8 @@ ChunkSparseMatrix<number>::matrix_norm_square (const Vector<somenumber> &v) cons
               (*colnum_ptr != cols->sparsity_pattern.n_cols()-1))
             {
               // we're at a chunk row but not column that has padding
-              for (unsigned int r=0; r<m() % cols->chunk_size; ++r)
-                for (unsigned int c=0; c<cols->chunk_size; ++c)
+              for (size_type r=0; r<m() % cols->chunk_size; ++r)
+                for (size_type c=0; c<cols->chunk_size; ++c)
                   result
                   +=
                     v(chunk_row * cols->chunk_size + r)
@@ -843,8 +857,8 @@ ChunkSparseMatrix<number>::matrix_norm_square (const Vector<somenumber> &v) cons
             }
           else
             // we're at a chunk row and column that has padding
-            for (unsigned int r=0; r<m() % cols->chunk_size; ++r)
-              for (unsigned int c=0; c<n() % cols->chunk_size; ++c)
+            for (size_type r=0; r<m() % cols->chunk_size; ++r)
+              for (size_type c=0; c<n() % cols->chunk_size; ++c)
                 result
                 +=
                   v(chunk_row * cols->chunk_size + r)
@@ -875,23 +889,23 @@ ChunkSparseMatrix<number>::matrix_scalar_product (const Vector<somenumber> &u,
   // the following works like the vmult_add function
   somenumber result = 0;
 
-  const unsigned int n_chunk_rows = cols->sparsity_pattern.n_rows();
+  const size_type n_chunk_rows = cols->sparsity_pattern.n_rows();
 
   // loop over all chunks. note that we need to treat the last chunk row and
   // column differently if they have padding elements
   const bool rows_have_padding = (m() % cols->chunk_size != 0),
              cols_have_padding = (n() % cols->chunk_size != 0);
 
-  const unsigned int n_regular_chunk_rows
+  const size_type n_regular_chunk_rows
     = (rows_have_padding ?
        n_chunk_rows-1 :
        n_chunk_rows);
 
-  const number       *val_ptr    = val;
-  const unsigned int *colnum_ptr = cols->sparsity_pattern.colnums;
+  const number    *val_ptr    = val;
+  const size_type *colnum_ptr = cols->sparsity_pattern.colnums;
   typename Vector<somenumber>::const_iterator u_ptr = u.begin();
 
-  for (unsigned int chunk_row=0; chunk_row<n_regular_chunk_rows; ++chunk_row)
+  for (size_type chunk_row=0; chunk_row<n_regular_chunk_rows; ++chunk_row)
     {
       const number *const val_end_of_row = &val[cols->sparsity_pattern.rowstart[chunk_row+1]
                                                 * cols->chunk_size
@@ -910,8 +924,8 @@ ChunkSparseMatrix<number>::matrix_scalar_product (const Vector<somenumber> &u,
                v.begin() + *colnum_ptr * cols->chunk_size);
           else
             // we're at a chunk column that has padding
-            for (unsigned int r=0; r<cols->chunk_size; ++r)
-              for (unsigned int c=0; c<n() % cols->chunk_size; ++c)
+            for (size_type r=0; r<cols->chunk_size; ++r)
+              for (size_type c=0; c<n() % cols->chunk_size; ++c)
                 result
                 +=
                   u(chunk_row * cols->chunk_size + r)
@@ -929,7 +943,7 @@ ChunkSparseMatrix<number>::matrix_scalar_product (const Vector<somenumber> &u,
   // now deal with last chunk row if necessary
   if (rows_have_padding)
     {
-      const unsigned int chunk_row = n_chunk_rows - 1;
+      const size_type chunk_row = n_chunk_rows - 1;
 
       const number *const val_end_of_row = &val[cols->sparsity_pattern.rowstart[chunk_row+1]
                                                 * cols->chunk_size
@@ -941,8 +955,8 @@ ChunkSparseMatrix<number>::matrix_scalar_product (const Vector<somenumber> &u,
               (*colnum_ptr != cols->sparsity_pattern.n_cols()-1))
             {
               // we're at a chunk row but not column that has padding
-              for (unsigned int r=0; r<m() % cols->chunk_size; ++r)
-                for (unsigned int c=0; c<cols->chunk_size; ++c)
+              for (size_type r=0; r<m() % cols->chunk_size; ++r)
+                for (size_type c=0; c<cols->chunk_size; ++c)
                   result
                   +=
                     u(chunk_row * cols->chunk_size + r)
@@ -951,8 +965,8 @@ ChunkSparseMatrix<number>::matrix_scalar_product (const Vector<somenumber> &u,
             }
           else
             // we're at a chunk row and column that has padding
-            for (unsigned int r=0; r<m() % cols->chunk_size; ++r)
-              for (unsigned int c=0; c<n() % cols->chunk_size; ++c)
+            for (size_type r=0; r<m() % cols->chunk_size; ++r)
+              for (size_type c=0; c<n() % cols->chunk_size; ++c)
                 result
                 +=
                   u(chunk_row * cols->chunk_size + r)
@@ -976,7 +990,7 @@ ChunkSparseMatrix<number>::l1_norm () const
   Assert (cols != 0, ExcNotInitialized());
   Assert (val != 0, ExcNotInitialized());
 
-  const unsigned int n_chunk_rows = cols->sparsity_pattern.n_rows();
+  const size_type n_chunk_rows = cols->sparsity_pattern.n_rows();
 
   // loop over all rows and columns; it is safe to also loop over the padding
   // elements (they are zero) if we make sure that the vector into which we
@@ -984,11 +998,11 @@ ChunkSparseMatrix<number>::l1_norm () const
   Vector<real_type> column_sums(cols->sparsity_pattern.n_cols() *
                                 cols->chunk_size);
 
-  for (unsigned int chunk_row=0; chunk_row<n_chunk_rows; ++chunk_row)
-    for (unsigned int j=cols->sparsity_pattern.rowstart[chunk_row];
+  for (size_type chunk_row=0; chunk_row<n_chunk_rows; ++chunk_row)
+    for (size_type j=cols->sparsity_pattern.rowstart[chunk_row];
          j<cols->sparsity_pattern.rowstart[chunk_row+1] ; ++j)
-      for (unsigned int r=0; r<cols->chunk_size; ++r)
-        for (unsigned int s=0; s<cols->chunk_size; ++s)
+      for (size_type r=0; r<cols->chunk_size; ++r)
+        for (size_type s=0; s<cols->chunk_size; ++s)
           column_sums(cols->sparsity_pattern.colnums[j] *
                       cols->chunk_size + s) +=
                         numbers::NumberTraits<number>::abs(val[j * cols->chunk_size *
@@ -1012,7 +1026,7 @@ ChunkSparseMatrix<number>::linfty_norm () const
   // (without allocating a temporary vector) as is done in the SparseMatrix
   // class but since it is rarely called in time critical places it is
   // probably not worth it
-  const unsigned int n_chunk_rows = cols->sparsity_pattern.n_rows();
+  const size_type n_chunk_rows = cols->sparsity_pattern.n_rows();
 
   // loop over all rows and columns; it is safe to also loop over the padding
   // elements (they are zero) if we make sure that the vector into which we
@@ -1020,11 +1034,11 @@ ChunkSparseMatrix<number>::linfty_norm () const
   Vector<real_type> row_sums(cols->sparsity_pattern.n_rows() *
                              cols->chunk_size);
 
-  for (unsigned int chunk_row=0; chunk_row<n_chunk_rows; ++chunk_row)
-    for (unsigned int j=cols->sparsity_pattern.rowstart[chunk_row];
+  for (size_type chunk_row=0; chunk_row<n_chunk_rows; ++chunk_row)
+    for (size_type j=cols->sparsity_pattern.rowstart[chunk_row];
          j<cols->sparsity_pattern.rowstart[chunk_row+1] ; ++j)
-      for (unsigned int r=0; r<cols->chunk_size; ++r)
-        for (unsigned int s=0; s<cols->chunk_size; ++s)
+      for (size_type r=0; r<cols->chunk_size; ++r)
+        for (size_type s=0; s<cols->chunk_size; ++s)
           row_sums(chunk_row * cols->chunk_size + r) +=
             numbers::NumberTraits<number>::abs(val[j * cols->chunk_size *
                                                    cols->chunk_size +
@@ -1077,23 +1091,23 @@ ChunkSparseMatrix<number>::residual (Vector<somenumber>       &dst,
   // the rest of this function is like vmult_add, except that we subtract
   // rather than add A*u
   /////////
-  const unsigned int n_chunk_rows = cols->sparsity_pattern.n_rows();
+  const size_type n_chunk_rows = cols->sparsity_pattern.n_rows();
 
   // loop over all chunks. note that we need to treat the last chunk row and
   // column differently if they have padding elements
   const bool rows_have_padding = (m() % cols->chunk_size != 0),
              cols_have_padding = (n() % cols->chunk_size != 0);
 
-  const unsigned int n_regular_chunk_rows
+  const size_type n_regular_chunk_rows
     = (rows_have_padding ?
        n_chunk_rows-1 :
        n_chunk_rows);
 
   const number       *val_ptr    = val;
-  const unsigned int *colnum_ptr = cols->sparsity_pattern.colnums;
+  const size_type *colnum_ptr = cols->sparsity_pattern.colnums;
   typename Vector<somenumber>::iterator dst_ptr = dst.begin();
 
-  for (unsigned int chunk_row=0; chunk_row<n_regular_chunk_rows; ++chunk_row)
+  for (size_type chunk_row=0; chunk_row<n_regular_chunk_rows; ++chunk_row)
     {
       const number *const val_end_of_row = &val[cols->sparsity_pattern.rowstart[chunk_row+1]
                                                 * cols->chunk_size
@@ -1110,8 +1124,8 @@ ChunkSparseMatrix<number>::residual (Vector<somenumber>       &dst,
              dst_ptr);
           else
             // we're at a chunk column that has padding
-            for (unsigned int r=0; r<cols->chunk_size; ++r)
-              for (unsigned int c=0; c<n() % cols->chunk_size; ++c)
+            for (size_type r=0; r<cols->chunk_size; ++r)
+              for (size_type c=0; c<n() % cols->chunk_size; ++c)
                 dst(chunk_row * cols->chunk_size + r)
                 -= (val_ptr[r*cols->chunk_size + c] *
                     u(*colnum_ptr * cols->chunk_size + c));
@@ -1127,7 +1141,7 @@ ChunkSparseMatrix<number>::residual (Vector<somenumber>       &dst,
   // now deal with last chunk row if necessary
   if (rows_have_padding)
     {
-      const unsigned int chunk_row = n_chunk_rows - 1;
+      const size_type chunk_row = n_chunk_rows - 1;
 
       const number *const val_end_of_row = &val[cols->sparsity_pattern.rowstart[chunk_row+1]
                                                 * cols->chunk_size
@@ -1139,16 +1153,16 @@ ChunkSparseMatrix<number>::residual (Vector<somenumber>       &dst,
               (*colnum_ptr != cols->sparsity_pattern.n_cols()-1))
             {
               // we're at a chunk row but not column that has padding
-              for (unsigned int r=0; r<m() % cols->chunk_size; ++r)
-                for (unsigned int c=0; c<cols->chunk_size; ++c)
+              for (size_type r=0; r<m() % cols->chunk_size; ++r)
+                for (size_type c=0; c<cols->chunk_size; ++c)
                   dst(chunk_row * cols->chunk_size + r)
                   -= (val_ptr[r*cols->chunk_size + c] *
                       u(*colnum_ptr * cols->chunk_size + c));
             }
           else
             // we're at a chunk row and column that has padding
-            for (unsigned int r=0; r<m() % cols->chunk_size; ++r)
-              for (unsigned int c=0; c<n() % cols->chunk_size; ++c)
+            for (size_type r=0; r<m() % cols->chunk_size; ++r)
+              for (size_type c=0; c<n() % cols->chunk_size; ++c)
                 dst(chunk_row * cols->chunk_size + r)
                 -= (val_ptr[r*cols->chunk_size + c] *
                     u(*colnum_ptr * cols->chunk_size + c));
@@ -1274,8 +1288,8 @@ template <typename number>
 template <typename somenumber>
 void
 ChunkSparseMatrix<number>::PSOR (Vector<somenumber> &dst,
-                                 const std::vector<unsigned int> &permutation,
-                                 const std::vector<unsigned int> &inverse_permutation,
+                                 const std::vector<size_type> &permutation,
+                                 const std::vector<size_type> &inverse_permutation,
                                  const number /*om*/) const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -1296,8 +1310,8 @@ template <typename number>
 template <typename somenumber>
 void
 ChunkSparseMatrix<number>::TPSOR (Vector<somenumber> &dst,
-                                  const std::vector<unsigned int> &permutation,
-                                  const std::vector<unsigned int> &inverse_permutation,
+                                  const std::vector<size_type> &permutation,
+                                  const std::vector<size_type> &inverse_permutation,
                                   const number /*om*/) const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -1430,9 +1444,9 @@ void ChunkSparseMatrix<number>::print_formatted (std::ostream &out,
         width = precision+2;
     }
 
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      for (unsigned int j=0; j<n(); ++j)
+      for (size_type j=0; j<n(); ++j)
         if (cols->sparsity_pattern(i,j) != SparsityPattern::invalid_entry)
           out << std::setw(width)
               << val[cols->sparsity_pattern(i,j)] * denominator << ' ';
@@ -1458,27 +1472,27 @@ void ChunkSparseMatrix<number>::print_pattern (std::ostream &out,
   Assert (cols != 0, ExcNotInitialized());
   Assert (val != 0, ExcNotInitialized());
 
-  const unsigned int chunk_size = cols->get_chunk_size();
+  const size_type chunk_size = cols->get_chunk_size();
 
   // loop over all chunk rows and columns, and each time we find something
   // repeat it chunk_size times in both directions
-  for (unsigned int i=0; i<cols->sparsity_pattern.n_rows(); ++i)
+  for (size_type i=0; i<cols->sparsity_pattern.n_rows(); ++i)
     {
-      for (unsigned int d=0; d<chunk_size; ++d)
-        for (unsigned int j=0; j<cols->sparsity_pattern.n_cols(); ++j)
+      for (size_type d=0; d<chunk_size; ++d)
+        for (size_type j=0; j<cols->sparsity_pattern.n_cols(); ++j)
           if (cols->sparsity_pattern(i,j) == SparsityPattern::invalid_entry)
             {
-              for (unsigned int e=0; e<chunk_size; ++e)
+              for (size_type e=0; e<chunk_size; ++e)
                 out << '.';
             }
           else if (std::fabs(val[cols->sparsity_pattern(i,j)]) > threshold)
             {
-              for (unsigned int e=0; e<chunk_size; ++e)
+              for (size_type e=0; e<chunk_size; ++e)
                 out << '*';
             }
           else
             {
-              for (unsigned int e=0; e<chunk_size; ++e)
+              for (size_type e=0; e<chunk_size; ++e)
                 out << ':';
             }
       out << std::endl;
index 200c80303d7a2ad8fe62856b2701f91de0c761fa..08f148a21d744c71a882e216976a0cbbf17d4a68 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__chunk_sparsity_pattern_h
 #define __deal2__chunk_sparsity_pattern_h
 
@@ -221,6 +226,10 @@ namespace ChunkSparsityPatternIterators
 class ChunkSparsityPattern : public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
   /**
    * Typedef an iterator class that allows to walk over all nonzero elements
    * of a sparsity pattern.
@@ -250,7 +259,7 @@ public:
    * perform some optimizations, but the actual value of the variable may
    * change over time.
    */
-  static const unsigned int invalid_entry = SparsityPattern::invalid_entry;
+  static const size_type invalid_entry = SparsityPattern::invalid_entry;
 
   /**
    * Initialize the matrix empty, that is with no memory allocated. This is
@@ -283,19 +292,19 @@ public:
    * @arg n number of columns
    * @arg max_per_row maximum number of nonzero entries per row
    */
-  ChunkSparsityPattern (const unsigned int m,
-                        const unsigned int n,
-                        const unsigned int max_chunks_per_row,
-                        const unsigned int chunk_size);
+  ChunkSparsityPattern (const size_type m,
+                        const size_type n,
+                        const size_type max_chunks_per_row,
+                        const size_type chunk_size);
 
   /**
    * @deprecated This constructor is deprecated. Use the version
    * without the last argument
    */
-  ChunkSparsityPattern (const unsigned int m,
-                        const unsigned int n,
-                        const unsigned int max_chunks_per_row,
-                        const unsigned int chunk_size,
+  ChunkSparsityPattern (const size_type m,
+                        const size_type n,
+                        const size_type max_chunks_per_row,
+                        const size_type chunk_size,
                         const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -306,19 +315,19 @@ public:
    * @arg row_lengths possible number of nonzero entries for each row.  This
    * vector must have one entry for each row.
    */
-  ChunkSparsityPattern (const unsigned int               m,
-                        const unsigned int               n,
-                        const std::vector<unsigned int> &row_lengths,
-                        const unsigned int chunk_size);
+  ChunkSparsityPattern (const size_type m,
+                        const size_type n,
+                        const std::vector<size_type> &row_lengths,
+                        const size_type chunk_size);
 
   /**
    * @deprecated This constructor is deprecated. Use the version
    * without the last argument
    */
-  ChunkSparsityPattern (const unsigned int               m,
-                        const unsigned int               n,
-                        const std::vector<unsigned int> &row_lengths,
-                        const unsigned int chunk_size,
+  ChunkSparsityPattern (const size_type               m,
+                        const size_type               n,
+                        const std::vector<size_type> &row_lengths,
+                        const size_type chunk_size,
                         const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -329,9 +338,9 @@ public:
    * elements. To avoid this, use the constructor taking row and column
    * numbers separately.
    */
-  ChunkSparsityPattern (const unsigned int n,
-                        const unsigned int max_per_row,
-                        const unsigned int chunk_size);
+  ChunkSparsityPattern (const size_type n,
+                        const size_type max_per_row,
+                        const size_type chunk_size);
 
   /**
    * Initialize a quadratic matrix.
@@ -340,17 +349,17 @@ public:
    * @arg row_lengths possible number of nonzero entries for each row.  This
    * vector must have one entry for each row.
    */
-  ChunkSparsityPattern (const unsigned int               m,
-                        const std::vector<unsigned int> &row_lengths,
-                        const unsigned int               chunk_size);
+  ChunkSparsityPattern (const size_type                m,
+                        const std::vector<size_type>  &row_lengths,
+                        const size_type                chunk_size);
 
   /**
    * @deprecated This constructor is deprecated. Use the version
    * without the last argument
    */
-  ChunkSparsityPattern (const unsigned int               m,
-                        const std::vector<unsigned int> &row_lengths,
-                        const unsigned int               chunk_size,
+  ChunkSparsityPattern (const size_type               m,
+                        const std::vector<size_type> &row_lengths,
+                        const size_type               chunk_size,
                         const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -373,19 +382,19 @@ public:
    * This function simply maps its operations to the other <tt>reinit</tt>
    * function.
    */
-  void reinit (const unsigned int m,
-               const unsigned int n,
-               const unsigned int max_per_row,
-               const unsigned int chunk_size);
+  void reinit (const size_type m,
+               const size_type n,
+               const size_type max_per_row,
+               const size_type chunk_size);
 
   /**
    * @deprecated This function is deprecated. Use the function
    * without the last argument
    */
-  void reinit (const unsigned int m,
-               const unsigned int n,
-               const unsigned int max_per_row,
-               const unsigned int chunk_size,
+  void reinit (const size_type m,
+               const size_type n,
+               const size_type max_per_row,
+               const size_type chunk_size,
                const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -405,37 +414,37 @@ public:
    * optimized access in relaxation
    * methods of SparseMatrix.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
-               const std::vector<unsigned int> &row_lengths,
-               const unsigned int chunk_size);
+  void reinit (const size_type m,
+               const size_type n,
+               const std::vector<size_type> &row_lengths,
+               const size_type chunk_size);
 
   /**
    * @deprecated This function is deprecated. Use the function
    * without the last argument
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
-               const std::vector<unsigned int> &row_lengths,
-               const unsigned int chunk_size,
-               const bool optimize_diagonal) DEAL_II_DEPRECATED;
+  void reinit (const size_type                m,
+               const size_type                n,
+               const std::vector<size_type > &row_lengths,
+               const size_type                chunk_size,
+               const bool                     optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
    * Same as above, but with a VectorSlice argument instead.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
-               const VectorSlice<const std::vector<unsigned int> > &row_lengths,
-               const unsigned int chunk_size);
+  void reinit (const size_type m,
+               const size_type n,
+               const VectorSlice<const std::vector<size_type> > &row_lengths,
+               const size_type chunk_size);
 
   /**
    * @deprecated This function is deprecated. Use the function
    * without the last argument
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
-               const VectorSlice<const std::vector<unsigned int> > &row_lengths,
-               const unsigned int chunk_size,
+  void reinit (const size_type m,
+               const size_type n,
+               const VectorSlice<const std::vector<size_type> > &row_lengths,
+               const size_type chunk_size,
                const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -486,8 +495,8 @@ public:
    * Since that all sounds very complicated, consider the following example
    * code, which may be used to fill a sparsity pattern:
    * @code
-   * std::vector<std::vector<unsigned int> > column_indices (n_rows);
-   * for (unsigned int row=0; row<n_rows; ++row)
+   * std::vector<std::vector<size_type> > column_indices (n_rows);
+   * for (size_type row=0; row<n_rows; ++row)
    *         // generate necessary columns in this row
    *   fill_row (column_indices[row]);
    *
@@ -506,8 +515,8 @@ public:
    * Another example would be as follows, where we initialize a whole matrix,
    * not only a sparsity pattern:
    * @code
-   * std::vector<std::map<unsigned int,double> > entries (n_rows);
-   * for (unsigned int row=0; row<n_rows; ++row)
+   * std::vector<std::map<size_type,double> > entries (n_rows);
+   * for (size_type row=0; row<n_rows; ++row)
    *         // generate necessary pairs of columns
    *         // and corresponding values in this row
    *   fill_row (entries[row]);
@@ -529,22 +538,22 @@ public:
    * iterators that point to such pairs.
    */
   template <typename ForwardIterator>
-  void copy_from (const unsigned int    n_rows,
-                  const unsigned int    n_cols,
+  void copy_from (const size_type n_rows,
+                  const size_type n_cols,
                   const ForwardIterator begin,
                   const ForwardIterator end,
-                  const unsigned int chunk_size);
+                  const size_type chunk_size);
 
-   /**
-    * @deprecated This function is deprecated. Use the function
-    * without the last argument
-    */
+  /**
+   * @deprecated This function is deprecated. Use the function
+   * without the last argument
+   */
   template <typename ForwardIterator>
-  void copy_from (const unsigned int    n_rows,
-                  const unsigned int    n_cols,
+  void copy_from (const size_type       n_rows,
+                  const size_type       n_cols,
                   const ForwardIterator begin,
                   const ForwardIterator end,
-                  const unsigned int chunk_size,
+                  const size_type       chunk_size,
                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -555,7 +564,7 @@ public:
    */
   template <typename SparsityType>
   void copy_from (const SparsityType &csp,
-                  const unsigned int  chunk_size);
+                  const size_type     chunk_size);
 
   /**
    * @deprecated This function is deprecated. Use the function
@@ -563,7 +572,7 @@ public:
    */
   template <typename SparsityType>
   void copy_from (const SparsityType &csp,
-                  const unsigned int  chunk_size,
+                  const size_type     chunk_size,
                   const bool          optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -575,7 +584,7 @@ public:
    */
   template <typename number>
   void copy_from (const FullMatrix<number> &matrix,
-                  const unsigned int chunk_size);
+                  const size_type chunk_size);
 
   /**
    * @deprecated This function is deprecated. Use the function
@@ -583,7 +592,7 @@ public:
    */
   template <typename number>
   void copy_from (const FullMatrix<number> &matrix,
-                  const unsigned int chunk_size,
+                  const size_type chunk_size,
                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -619,14 +628,14 @@ public:
   /**
    * Return the chunk size given as argument when constructing this object.
    */
-  unsigned int get_chunk_size () const;
+  size_type get_chunk_size () const;
 
   /**
    * Return the maximum number of entries per row. Before compression, this
    * equals the number given to the constructor, while after compression, it
    * equals the maximum number of entries actually allocated by the user.
    */
-  unsigned int max_entries_per_row () const;
+  size_type max_entries_per_row () const;
 
   /**
    * Add a nonzero entry to the matrix. This function may only be called for
@@ -634,8 +643,8 @@ public:
    *
    * If the entry already exists, nothing bad happens.
    */
-  void add (const unsigned int i,
-            const unsigned int j);
+  void add (const size_type i,
+            const size_type j);
 
   /**
    * Make the sparsity pattern symmetric by adding the sparsity pattern of the
@@ -650,24 +659,24 @@ public:
    * Return number of rows of this matrix, which equals the dimension of the
    * image space.
    */
-  unsigned int n_rows () const;
+  inline size_type n_rows () const;
 
   /**
    * Return number of columns of this matrix, which equals the dimension of
    * the range space.
    */
-  unsigned int n_cols () const;
+  inline size_type n_cols () const;
 
   /**
    * Check if a value at a certain position may be non-zero.
    */
-  bool exists (const unsigned int i,
-               const unsigned int j) const;
+  bool exists (const size_type i,
+               const size_type j) const;
 
   /**
    * Number of entries in a specific row.
    */
-  unsigned int row_length (const unsigned int row) const;
+  size_type row_length (const size_type row) const;
 
   /**
    * Compute the bandwidth of the matrix represented by this structure. The
@@ -675,7 +684,7 @@ public:
    * represents a nonzero entry of the matrix. Consequently, the maximum
    * bandwidth a $n\times m$ matrix can have is $\max\{n-1,m-1\}$.
    */
-  unsigned int bandwidth () const;
+  size_type bandwidth () const;
 
   /**
    * Return the number of nonzero elements of this matrix. Actually, it
@@ -685,7 +694,7 @@ public:
    * This function may only be called if the matrix struct is compressed. It
    * does not make too much sense otherwise anyway.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return whether the structure is compressed or not.
@@ -871,17 +880,17 @@ private:
   /**
    * Number of rows that this sparsity structure shall represent.
    */
-  unsigned int rows;
+  size_type rows;
 
   /**
    * Number of columns that this sparsity structure shall represent.
    */
-  unsigned int cols;
+  size_type cols;
 
   /**
    * The size of chunks.
    */
-  unsigned int chunk_size;
+  size_type chunk_size;
 
   /**
    * The reduced sparsity pattern. We store only which chunks exist, with each
@@ -914,7 +923,7 @@ namespace ChunkSparsityPatternIterators
             const unsigned int          row)
     :
     sparsity_pattern(sparsity_pattern),
-    reduced_accessor(row==sparsity_pattern->n_rows() ? 
+    reduced_accessor(row==sparsity_pattern->n_rows() ?
                      *sparsity_pattern->sparsity_pattern.end() :
                      *sparsity_pattern->sparsity_pattern.
                      begin(row/sparsity_pattern->get_chunk_size())),
@@ -942,12 +951,12 @@ namespace ChunkSparsityPatternIterators
   Accessor::is_valid_entry () const
   {
     return reduced_accessor.is_valid_entry()
-      &&
-      sparsity_pattern->get_chunk_size()*reduced_accessor.row()+chunk_row <
-      sparsity_pattern->n_rows()
-      &&
-      sparsity_pattern->get_chunk_size()*reduced_accessor.column()+chunk_col <
-      sparsity_pattern->n_cols();
+           &&
+           sparsity_pattern->get_chunk_size()*reduced_accessor.row()+chunk_row <
+           sparsity_pattern->n_rows()
+           &&
+           sparsity_pattern->get_chunk_size()*reduced_accessor.column()+chunk_col <
+           sparsity_pattern->n_cols();
   }
 
 
@@ -959,7 +968,7 @@ namespace ChunkSparsityPatternIterators
     Assert (is_valid_entry() == true, ExcInvalidIterator());
 
     return sparsity_pattern->get_chunk_size()*reduced_accessor.row() +
-      chunk_row;
+           chunk_row;
   }
 
 
@@ -971,7 +980,7 @@ namespace ChunkSparsityPatternIterators
     Assert (is_valid_entry() == true, ExcInvalidIterator());
 
     return sparsity_pattern->get_chunk_size()*reduced_accessor.column() +
-      chunk_col;
+           chunk_col;
   }
 
 
@@ -1019,10 +1028,10 @@ namespace ChunkSparsityPatternIterators
           return true;
 
         const unsigned int
-          global_row = sparsity_pattern->get_chunk_size()*reduced_accessor.row()
-          +chunk_row,
-          other_global_row = sparsity_pattern->get_chunk_size()*
-          other.reduced_accessor.row()+other.chunk_row;
+        global_row = sparsity_pattern->get_chunk_size()*reduced_accessor.row()
+                     +chunk_row,
+                     other_global_row = sparsity_pattern->get_chunk_size()*
+                                        other.reduced_accessor.row()+other.chunk_row;
         if (global_row < other_global_row)
           return true;
         else if (global_row > other_global_row)
@@ -1205,13 +1214,13 @@ ChunkSparsityPattern::iterator
 ChunkSparsityPattern::end (const unsigned int r) const
 {
   Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()))
-    return iterator(this, r+1);
+  return iterator(this, r+1);
 }
 
 
 
 inline
-unsigned int
+ChunkSparsityPattern::size_type
 ChunkSparsityPattern::n_rows () const
 {
   return rows;
@@ -1219,7 +1228,7 @@ ChunkSparsityPattern::n_rows () const
 
 
 inline
-unsigned int
+ChunkSparsityPattern::size_type
 ChunkSparsityPattern::n_cols () const
 {
   return cols;
@@ -1228,7 +1237,7 @@ ChunkSparsityPattern::n_cols () const
 
 
 inline
-unsigned int
+ChunkSparsityPattern::size_type
 ChunkSparsityPattern::get_chunk_size () const
 {
   return chunk_size;
@@ -1257,11 +1266,11 @@ ChunkSparsityPattern::optimize_diagonal () const
 template <typename ForwardIterator>
 inline
 void
-ChunkSparsityPattern::copy_from (const unsigned int    n_rows,
-                                 const unsigned int    n_cols,
+ChunkSparsityPattern::copy_from (const size_type n_rows,
+                                 const size_type n_cols,
                                  const ForwardIterator begin,
                                  const ForwardIterator end,
-                                 const unsigned int    chunk_size,
+                                 const size_type chunk_size,
                                  const bool)
 {
   copy_from (n_rows, n_cols, begin, end, chunk_size);
@@ -1271,13 +1280,13 @@ ChunkSparsityPattern::copy_from (const unsigned int    n_rows,
 
 template <typename ForwardIterator>
 void
-ChunkSparsityPattern::copy_from (const unsigned int    n_rows,
-                                 const unsigned int    n_cols,
+ChunkSparsityPattern::copy_from (const size_type       n_rows,
+                                 const size_type       n_cols,
                                  const ForwardIterator begin,
                                  const ForwardIterator end,
-                                 const unsigned int    chunk_size)
+                                 const size_type       chunk_size)
 {
-  Assert (static_cast<unsigned int>(std::distance (begin, end)) == n_rows,
+  Assert (static_cast<size_type>(std::distance (begin, end)) == n_rows,
           ExcIteratorRange (std::distance (begin, end), n_rows));
 
   // first determine row lengths for each row. if the matrix is quadratic,
@@ -1285,7 +1294,7 @@ ChunkSparsityPattern::copy_from (const unsigned int    n_rows,
   // is not yet present. as we have to call compress anyway later on, don't
   // bother to check whether that diagonal entry is in a certain row or not
   const bool is_square = (n_rows == n_cols);
-  std::vector<unsigned int> row_lengths;
+  std::vector<size_type> row_lengths;
   row_lengths.reserve(n_rows);
   for (ForwardIterator i=begin; i!=end; ++i)
     row_lengths.push_back (std::distance (i->begin(), i->end())
@@ -1294,15 +1303,15 @@ ChunkSparsityPattern::copy_from (const unsigned int    n_rows,
   reinit (n_rows, n_cols, row_lengths, chunk_size);
 
   // now enter all the elements into the matrix
-  unsigned int row = 0;
+  size_type row = 0;
   typedef typename std::iterator_traits<ForwardIterator>::value_type::const_iterator inner_iterator;
   for (ForwardIterator i=begin; i!=end; ++i, ++row)
     {
       const inner_iterator end_of_row = i->end();
       for (inner_iterator j=i->begin(); j!=end_of_row; ++j)
         {
-          const unsigned int col
-          = internal::SparsityPatternTools::get_column_index_from_iterator(*j);
+          const size_type col
+            = internal::SparsityPatternTools::get_column_index_from_iterator(*j);
           Assert (col < n_cols, ExcInvalidIndex(col,n_cols));
 
           add (row, col);
index 3235b5b181ea7863dccb4ca7b8bb7a8b8396d899..544ed11c13f86404df974c82e570a3bf3385817d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__compressed_set_sparsity_pattern_h
 #define __deal2__compressed_set_sparsity_pattern_h
 
@@ -106,13 +111,18 @@ template <typename number> class SparseMatrix;
 class CompressedSetSparsityPattern : public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * An iterator that can be used to
    * iterate over the elements of a single
    * row. The result of dereferencing such
    * an iterator is a column index.
    */
-  typedef std::set<unsigned int>::const_iterator row_iterator;
+  typedef std::set<size_type>::const_iterator row_iterator;
 
 
   /**
@@ -150,14 +160,14 @@ public:
    * matrix with @p m rows and
    * @p n columns.
    */
-  CompressedSetSparsityPattern (const unsigned int m,
-                                const unsigned int n);
+  CompressedSetSparsityPattern (const size_type m,
+                                const size_type n);
 
   /**
    * Initialize a square matrix of
    * dimension @p n.
    */
-  CompressedSetSparsityPattern (const unsigned int n);
+  CompressedSetSparsityPattern (const size_type n);
 
   /**
    * Copy operator. For this the
@@ -177,8 +187,8 @@ public:
    * max_entries_per_row() nonzero
    * entries per row.
    */
-  void reinit (const unsigned int m,
-               const unsigned int n);
+  void reinit (const size_type m,
+               const size_type n);
 
   /**
    * Since this object is kept
@@ -206,15 +216,15 @@ public:
    * this number may change as
    * entries are added.
    */
-  unsigned int max_entries_per_row () const;
+  size_type max_entries_per_row () const;
 
   /**
    * Add a nonzero entry to the
    * matrix. If the entry already
    * exists, nothing bad happens.
    */
-  void add (const unsigned int i,
-            const unsigned int j);
+  void add (const size_type i,
+            const size_type j);
 
   /**
    * Add several nonzero entries to the
@@ -223,17 +233,17 @@ public:
    * happens.
    */
   template <typename ForwardIterator>
-  void add_entries (const unsigned int row,
-                    ForwardIterator    begin,
-                    ForwardIterator    end,
-                    const bool         indices_are_sorted = false);
+  void add_entries (const size_type row,
+                    ForwardIterator begin,
+                    ForwardIterator end,
+                    const bool      indices_are_sorted = false);
 
   /**
    * Check if a value at a certain
    * position may be non-zero.
    */
-  bool exists (const unsigned int i,
-               const unsigned int j) const;
+  bool exists (const size_type i,
+               const size_type j) const;
 
   /**
    * Make the sparsity pattern
@@ -289,19 +299,19 @@ public:
    * matrix, which equals the dimension
    * of the image space.
    */
-  unsigned int n_rows () const;
+  size_type n_rows () const;
 
   /**
    * Return number of columns of this
    * matrix, which equals the dimension
    * of the range space.
    */
-  unsigned int n_cols () const;
+  size_type n_cols () const;
 
   /**
    * Number of entries in a specific row.
    */
-  unsigned int row_length (const unsigned int row) const;
+  size_type row_length (const size_type row) const;
 
   /**
    * Return an iterator that can loop over
@@ -309,12 +319,12 @@ public:
    * row. Dereferencing the iterator yields
    * a column index.
    */
-  row_iterator row_begin (const unsigned int row) const;
+  row_iterator row_begin (const size_type row) const;
 
   /**
    * End iterator for the given row.
    */
-  row_iterator row_end (const unsigned int row) const;
+  row_iterator row_end (const size_type row) const;
 
 
   /**
@@ -325,14 +335,14 @@ public:
    * $(i,j)$ represents a nonzero entry
    * of the matrix.
    */
-  unsigned int bandwidth () const;
+  size_type bandwidth () const;
 
   /**
    * Return the number of nonzero elements
    * allocated through this sparsity
    * pattern.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return whether this object stores only
@@ -357,13 +367,13 @@ private:
    * Number of rows that this sparsity
    * structure shall represent.
    */
-  unsigned int rows;
+  size_type rows;
 
   /**
    * Number of columns that this sparsity
    * structure shall represent.
    */
-  unsigned int cols;
+  size_type cols;
 
   /**
    * For each row of the matrix, store the
@@ -374,7 +384,7 @@ private:
    */
   struct Line
   {
-    std::set<unsigned int> entries;
+    std::set<size_type> entries;
 
     /**
      * Constructor.
@@ -385,7 +395,7 @@ private:
      * Add the given column number to
      * this line.
      */
-    void add (const unsigned int col_num);
+    void add (const size_type col_num);
 
     /**
      * Add the columns specified by the
@@ -417,7 +427,7 @@ CompressedSetSparsityPattern::Line::Line ()
 
 inline
 void
-CompressedSetSparsityPattern::Line::add (const unsigned int j)
+CompressedSetSparsityPattern::Line::add (const size_type j)
 {
   entries.insert (j);
 }
@@ -436,7 +446,7 @@ CompressedSetSparsityPattern::Line::add_entries (ForwardIterator begin,
 
 
 inline
-unsigned int
+CompressedSetSparsityPattern::size_type
 CompressedSetSparsityPattern::n_rows () const
 {
   return rows;
@@ -445,7 +455,7 @@ CompressedSetSparsityPattern::n_rows () const
 
 
 inline
-unsigned int
+CompressedSetSparsityPattern::size_type
 CompressedSetSparsityPattern::n_cols () const
 {
   return cols;
@@ -455,11 +465,11 @@ CompressedSetSparsityPattern::n_cols () const
 
 inline
 void
-CompressedSetSparsityPattern::add (const unsigned int i,
-                                   const unsigned int j)
+CompressedSetSparsityPattern::add (const size_type i,
+                                   const size_type j)
 {
-  Assert (i<rows, ExcIndexRange(i, 0, rows));
-  Assert (j<cols, ExcIndexRange(j, 0, cols));
+  Assert (i<rows, ExcIndexRangeType<size_type>(i, 0, rows));
+  Assert (j<cols, ExcIndexRangeType<size_type>(j, 0, cols));
 
   lines[i].add (j);
 }
@@ -469,12 +479,12 @@ CompressedSetSparsityPattern::add (const unsigned int i,
 template <typename ForwardIterator>
 inline
 void
-CompressedSetSparsityPattern::add_entries (const unsigned int row,
+CompressedSetSparsityPattern::add_entries (const size_type row,
                                            ForwardIterator begin,
                                            ForwardIterator end,
                                            const bool         /*indices_are_sorted*/)
 {
-  Assert (row < rows, ExcIndexRange (row, 0, rows));
+  Assert (row < rows, ExcIndexRangeType<size_type> (row, 0, rows));
 
   lines[row].add_entries (begin, end);
 }
@@ -482,10 +492,10 @@ CompressedSetSparsityPattern::add_entries (const unsigned int row,
 
 
 inline
-unsigned int
-CompressedSetSparsityPattern::row_length (const unsigned int row) const
+CompressedSetSparsityPattern::size_type
+CompressedSetSparsityPattern::row_length (const size_type row) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
 
   return lines[row].entries.size();
 }
@@ -494,7 +504,7 @@ CompressedSetSparsityPattern::row_length (const unsigned int row) const
 
 inline
 CompressedSetSparsityPattern::row_iterator
-CompressedSetSparsityPattern::row_begin (const unsigned int row) const
+CompressedSetSparsityPattern::row_begin (const size_type row) const
 {
   return (lines[row].entries.begin ());
 }
@@ -503,7 +513,7 @@ CompressedSetSparsityPattern::row_begin (const unsigned int row) const
 
 inline
 CompressedSetSparsityPattern::row_iterator
-CompressedSetSparsityPattern::row_end (const unsigned int row) const
+CompressedSetSparsityPattern::row_end (const size_type row) const
 {
   return (lines[row].entries.end ());
 }
index a7b9daed20ecbd1a836d276a720a571551fbf7db..6257f4733a9965f5066bb274ab9e9d767207fc57 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__compressed_simple_sparsity_pattern_h
 #define __deal2__compressed_simple_sparsity_pattern_h
 
@@ -87,13 +92,18 @@ template <typename number> class SparseMatrix;
 class CompressedSimpleSparsityPattern : public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * An iterator that can be used to
    * iterate over the elements of a single
    * row. The result of dereferencing such
    * an iterator is a column index.
    */
-  typedef std::vector<unsigned int>::const_iterator row_iterator;
+  typedef std::vector<size_type>::const_iterator row_iterator;
 
   /**
    * Initialize the matrix empty,
@@ -136,15 +146,21 @@ public:
    * default argument keeps all
    * entries.
    */
-  CompressedSimpleSparsityPattern (const unsigned int m,
-                                   const unsigned int n,
+  CompressedSimpleSparsityPattern (const size_type m,
+                                   const size_type n,
                                    const IndexSet &rowset = IndexSet());
 
+  /**
+   * Create a square SparsityPattern using
+   * the index set.
+   */
+  CompressedSimpleSparsityPattern (const IndexSet &indexset);
+
   /**
    * Initialize a square matrix of
    * dimension @p n.
    */
-  CompressedSimpleSparsityPattern (const unsigned int n);
+  CompressedSimpleSparsityPattern (const size_type n);
 
   /**
    * Copy operator. For this the
@@ -170,8 +186,8 @@ public:
    * default argument keeps all
    * entries.
    */
-  void reinit (const unsigned int m,
-               const unsigned int n,
+  void reinit (const size_type m,
+               const size_type n,
                const IndexSet &rowset = IndexSet());
 
   /**
@@ -200,15 +216,15 @@ public:
    * this number may change as
    * entries are added.
    */
-  unsigned int max_entries_per_row () const;
+  size_type max_entries_per_row () const;
 
   /**
    * Add a nonzero entry to the
    * matrix. If the entry already
    * exists, nothing bad happens.
    */
-  void add (const unsigned int i,
-            const unsigned int j);
+  void add (const size_type i,
+            const size_type j);
 
   /**
    * Add several nonzero entries to the
@@ -217,17 +233,17 @@ public:
    * happens.
    */
   template <typename ForwardIterator>
-  void add_entries (const unsigned int row,
-                    ForwardIterator    begin,
-                    ForwardIterator    end,
-                    const bool         indices_are_unique_and_sorted = false);
+  void add_entries (const size_type row,
+                    ForwardIterator begin,
+                    ForwardIterator end,
+                    const bool      indices_are_unique_and_sorted = false);
 
   /**
    * Check if a value at a certain
    * position may be non-zero.
    */
-  bool exists (const unsigned int i,
-               const unsigned int j) const;
+  bool exists (const size_type i,
+               const size_type j) const;
 
   /**
    * Make the sparsity pattern
@@ -283,14 +299,14 @@ public:
    * matrix, which equals the dimension
    * of the image space.
    */
-  unsigned int n_rows () const;
+  size_type n_rows () const;
 
   /**
    * Return number of columns of this
    * matrix, which equals the dimension
    * of the range space.
    */
-  unsigned int n_cols () const;
+  size_type n_cols () const;
 
   /**
    * Number of entries in a
@@ -300,15 +316,15 @@ public:
    * index set of rows that we want
    * to store.
    */
-  unsigned int row_length (const unsigned int row) const;
+  size_type row_length (const size_type row) const;
 
   /**
    * Access to column number field.
    * Return the column number of
    * the @p indexth entry in @p row.
    */
-  unsigned int column_number (const unsigned int row,
-                              const unsigned int index) const;
+  size_type column_number (const size_type row,
+                           const size_type index) const;
 
   /**
    * Return an iterator that can loop over
@@ -316,12 +332,12 @@ public:
    * row. Dereferencing the iterator yields
    * a column index.
    */
-  row_iterator row_begin (const unsigned int row) const;
+  row_iterator row_begin (const size_type row) const;
 
   /**
    * Returns the end of the current row.
    */
-  row_iterator row_end (const unsigned int row) const;
+  row_iterator row_end (const size_type row) const;
   /**
    * Compute the bandwidth of the matrix
    * represented by this structure. The
@@ -330,13 +346,13 @@ public:
    * $(i,j)$ represents a nonzero entry
    * of the matrix.
    */
-  unsigned int bandwidth () const;
+  size_type bandwidth () const;
 
   /**
    * Return the number of nonzero elements
    * allocated through this sparsity pattern.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return the IndexSet that sets which
@@ -370,20 +386,20 @@ public:
    * memory consumption (in bytes)
    * of this object.
    */
-  std::size_t memory_consumption () const;
+  size_type memory_consumption () const;
 
 private:
   /**
    * Number of rows that this sparsity
    * structure shall represent.
    */
-  unsigned int rows;
+  size_type rows;
 
   /**
    * Number of columns that this sparsity
    * structure shall represent.
    */
-  unsigned int cols;
+  size_type cols;
 
   /**
    * A set that contains the valid rows.
@@ -409,7 +425,7 @@ private:
      * this row. This array is always
      * kept sorted.
      */
-    std::vector<unsigned int> entries;
+    std::vector<size_type> entries;
 
     /**
      * Constructor.
@@ -420,7 +436,7 @@ private:
      * Add the given column number to
      * this line.
      */
-    void add (const unsigned int col_num);
+    void add (const size_type col_num);
 
     /**
      * Add the columns specified by the
@@ -434,7 +450,7 @@ private:
     /**
      * estimates memory consumption.
      */
-    std::size_t memory_consumption () const;
+    size_type memory_consumption () const;
   };
 
 
@@ -452,7 +468,7 @@ private:
 
 inline
 void
-CompressedSimpleSparsityPattern::Line::add (const unsigned int j)
+CompressedSimpleSparsityPattern::Line::add (const size_type j)
 {
   // first check the last element (or if line
   // is still empty)
@@ -464,7 +480,7 @@ CompressedSimpleSparsityPattern::Line::add (const unsigned int j)
 
   // do a binary search to find the place
   // where to insert:
-  std::vector<unsigned int>::iterator
+  std::vector<size_type>::iterator
   it = Utilities::lower_bound(entries.begin(),
                               entries.end(),
                               j);
@@ -483,7 +499,7 @@ CompressedSimpleSparsityPattern::Line::add (const unsigned int j)
 
 
 inline
-unsigned int
+CompressedSimpleSparsityPattern::size_type
 CompressedSimpleSparsityPattern::n_rows () const
 {
   return rows;
@@ -492,7 +508,7 @@ CompressedSimpleSparsityPattern::n_rows () const
 
 
 inline
-unsigned int
+types::global_dof_index
 CompressedSimpleSparsityPattern::n_cols () const
 {
   return cols;
@@ -502,16 +518,16 @@ CompressedSimpleSparsityPattern::n_cols () const
 
 inline
 void
-CompressedSimpleSparsityPattern::add (const unsigned int i,
-                                      const unsigned int j)
+CompressedSimpleSparsityPattern::add (const size_type i,
+                                      const size_type j)
 {
-  Assert (i<rows, ExcIndexRange(i, 0, rows));
-  Assert (j<cols, ExcIndexRange(j, 0, cols));
+  Assert (i<rows, ExcIndexRangeType<size_type>(i, 0, rows));
+  Assert (j<cols, ExcIndexRangeType<size_type>(j, 0, cols));
 
   if (rowset.size() > 0 && !rowset.is_element(i))
     return;
 
-  const unsigned int rowindex =
+  const size_type rowindex =
     rowset.size()==0 ? i : rowset.index_within_set(i);
   lines[rowindex].add (j);
 }
@@ -521,17 +537,17 @@ CompressedSimpleSparsityPattern::add (const unsigned int i,
 template <typename ForwardIterator>
 inline
 void
-CompressedSimpleSparsityPattern::add_entries (const unsigned int row,
+CompressedSimpleSparsityPattern::add_entries (const size_type row,
                                               ForwardIterator begin,
                                               ForwardIterator end,
                                               const bool      indices_are_sorted)
 {
-  Assert (row < rows, ExcIndexRange (row, 0, rows));
+  Assert (row < rows, ExcIndexRangeType<size_type> (row, 0, rows));
 
   if (rowset.size() > 0 && !rowset.is_element(row))
     return;
 
-  const unsigned int rowindex =
+  const size_type rowindex =
     rowset.size()==0 ? row : rowset.index_within_set(row);
   lines[rowindex].add_entries (begin, end, indices_are_sorted);
 }
@@ -545,14 +561,14 @@ CompressedSimpleSparsityPattern::Line::Line ()
 
 
 inline
-unsigned int
-CompressedSimpleSparsityPattern::row_length (const unsigned int row) const
+types::global_dof_index
+CompressedSimpleSparsityPattern::row_length (const size_type row) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
   if (rowset.size() > 0 && !rowset.is_element(row))
     return 0;
 
-  const unsigned int rowindex =
+  const size_type rowindex =
     rowset.size()==0 ? row : rowset.index_within_set(row);
   return lines[rowindex].entries.size();
 }
@@ -560,16 +576,16 @@ CompressedSimpleSparsityPattern::row_length (const unsigned int row) const
 
 
 inline
-unsigned int
-CompressedSimpleSparsityPattern::column_number (const unsigned int row,
-                                                const unsigned int index) const
+types::global_dof_index
+CompressedSimpleSparsityPattern::column_number (const size_type row,
+                                                const size_type index) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
   Assert( rowset.size() == 0 || rowset.is_element(row), ExcInternalError());
 
-  const unsigned int local_row = rowset.size() ? rowset.index_within_set(row) : row;
+  const size_type local_row = rowset.size() ? rowset.index_within_set(row) : row;
   Assert (index < lines[local_row].entries.size(),
-          ExcIndexRange (index, 0, lines[local_row].entries.size()));
+          ExcIndexRangeType<size_type> (index, 0, lines[local_row].entries.size()));
   return lines[local_row].entries[index];
 }
 
@@ -577,10 +593,10 @@ CompressedSimpleSparsityPattern::column_number (const unsigned int row,
 
 inline
 CompressedSimpleSparsityPattern::row_iterator
-CompressedSimpleSparsityPattern::row_begin (const unsigned int row) const
+CompressedSimpleSparsityPattern::row_begin (const size_type row) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
-  const unsigned int local_row = rowset.size() ? rowset.index_within_set(row) : row;
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
+  const size_type local_row = rowset.size() ? rowset.index_within_set(row) : row;
   return lines[local_row].entries.begin();
 }
 
@@ -588,10 +604,10 @@ CompressedSimpleSparsityPattern::row_begin (const unsigned int row) const
 
 inline
 CompressedSimpleSparsityPattern::row_iterator
-CompressedSimpleSparsityPattern::row_end (const unsigned int row) const
+CompressedSimpleSparsityPattern::row_end (const size_type row) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
-  const unsigned int local_row = rowset.size() ? rowset.index_within_set(row) : row;
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
+  const size_type local_row = rowset.size() ? rowset.index_within_set(row) : row;
   return lines[local_row].entries.end();
 }
 
index 94ade6925157a8aa90bd142423a5d8d4f0a8a750..8477716dc936469ac76fbcbe5c5e71c28e2c25b9 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__compressed_sparsity_pattern_h
 #define __deal2__compressed_sparsity_pattern_h
 
@@ -88,13 +93,18 @@ template <typename number> class SparseMatrix;
 class CompressedSparsityPattern : public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * An iterator that can be used to
    * iterate over the elements of a single
    * row. The result of dereferencing such
    * an iterator is a column index.
    */
-  typedef std::vector<unsigned int>::const_iterator row_iterator;
+  typedef std::vector<size_type>::const_iterator row_iterator;
 
   /**
    * Initialize the matrix empty,
@@ -131,14 +141,14 @@ public:
    * matrix with @p m rows and
    * @p n columns.
    */
-  CompressedSparsityPattern (const unsigned int m,
-                             const unsigned int n);
+  CompressedSparsityPattern (const size_type m,
+                             const size_type n);
 
   /**
    * Initialize a square matrix of
    * dimension @p n.
    */
-  CompressedSparsityPattern (const unsigned int n);
+  CompressedSparsityPattern (const size_type n);
 
   /**
    * Copy operator. For this the
@@ -158,8 +168,8 @@ public:
    * max_entries_per_row() nonzero
    * entries per row.
    */
-  void reinit (const unsigned int m,
-               const unsigned int n);
+  void reinit (const size_type m,
+               const size_type n);
 
   /**
    * Since this object is kept
@@ -187,15 +197,15 @@ public:
    * this number may change as
    * entries are added.
    */
-  unsigned int max_entries_per_row () const;
+  size_type max_entries_per_row () const;
 
   /**
    * Add a nonzero entry to the
    * matrix. If the entry already
    * exists, nothing bad happens.
    */
-  void add (const unsigned int i,
-            const unsigned int j);
+  void add (const size_type i,
+            const size_type j);
 
   /**
    * Add several nonzero entries to the
@@ -204,17 +214,17 @@ public:
    * happens.
    */
   template <typename ForwardIterator>
-  void add_entries (const unsigned int row,
-                    ForwardIterator    begin,
-                    ForwardIterator    end,
-                    const bool         indices_are_unique_and_sorted = false);
+  void add_entries (const size_type row,
+                    ForwardIterator begin,
+                    ForwardIterator end,
+                    const bool      indices_are_unique_and_sorted = false);
 
   /**
    * Check if a value at a certain
    * position may be non-zero.
    */
-  bool exists (const unsigned int i,
-               const unsigned int j) const;
+  bool exists (const size_type i,
+               const size_type j) const;
 
   /**
    * Make the sparsity pattern
@@ -270,27 +280,27 @@ public:
    * matrix, which equals the dimension
    * of the image space.
    */
-  unsigned int n_rows () const;
+  size_type n_rows () const;
 
   /**
    * Return number of columns of this
    * matrix, which equals the dimension
    * of the range space.
    */
-  unsigned int n_cols () const;
+  size_type n_cols () const;
 
   /**
    * Number of entries in a specific row.
    */
-  unsigned int row_length (const unsigned int row) const;
+  size_type row_length (const size_type row) const;
 
   /**
    * Access to column number field.
    * Return the column number of
    * the @p indexth entry in @p row.
    */
-  unsigned int column_number (const unsigned int row,
-                              const unsigned int index) const;
+  size_type column_number (const size_type row,
+                           const size_type index) const;
 
   /**
    * Return an iterator that can loop over
@@ -298,12 +308,12 @@ public:
    * row. Dereferencing the iterator yields
    * a column index.
    */
-  row_iterator row_begin (const unsigned int row) const;
+  row_iterator row_begin (const size_type row) const;
 
   /**
    * Returns the end of the current row.
    */
-  row_iterator row_end (const unsigned int row) const;
+  row_iterator row_end (const size_type row) const;
 
   /**
    * Compute the bandwidth of the matrix
@@ -313,14 +323,14 @@ public:
    * $(i,j)$ represents a nonzero entry
    * of the matrix.
    */
-  unsigned int bandwidth () const;
+  size_type bandwidth () const;
 
   /**
    * Return the number of nonzero elements
    * allocated through this sparsity
    * pattern.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return whether this object stores only
@@ -345,13 +355,13 @@ private:
    * Number of rows that this sparsity
    * structure shall represent.
    */
-  unsigned int rows;
+  size_type rows;
 
   /**
    * Number of columns that this sparsity
    * structure shall represent.
    */
-  unsigned int cols;
+  size_type cols;
 
   /**
    * Store some data for each row
@@ -425,13 +435,13 @@ private:
      * the cache. This array is always
      * kept sorted.
      */
-    mutable std::vector<unsigned int> entries;
+    mutable std::vector<size_type> entries;
 
     /**
      * Cache of entries that have not yet
      * been written to #entries;
      */
-    mutable unsigned int cache[cache_size];
+    mutable size_type cache[cache_size];
 
     /**
      * Number of entries in the cache.
@@ -447,7 +457,7 @@ private:
      * Add the given column number to
      * this line.
      */
-    void add (const unsigned int col_num);
+    void add (const size_type col_num);
 
     /**
      * Add the columns specified by the
@@ -480,7 +490,7 @@ private:
 
 inline
 void
-CompressedSparsityPattern::Line::add (const unsigned int j)
+CompressedSparsityPattern::Line::add (const size_type j)
 {
   // first check whether this entry is
   // already in the cache. if so, we can
@@ -502,7 +512,7 @@ CompressedSparsityPattern::Line::add (const unsigned int j)
 
 
 inline
-unsigned int
+types::global_dof_index
 CompressedSparsityPattern::n_rows () const
 {
   return rows;
@@ -511,7 +521,7 @@ CompressedSparsityPattern::n_rows () const
 
 
 inline
-unsigned int
+types::global_dof_index
 CompressedSparsityPattern::n_cols () const
 {
   return cols;
@@ -521,11 +531,11 @@ CompressedSparsityPattern::n_cols () const
 
 inline
 void
-CompressedSparsityPattern::add (const unsigned int i,
-                                const unsigned int j)
+CompressedSparsityPattern::add (const size_type i,
+                                const size_type j)
 {
-  Assert (i<rows, ExcIndexRange(i, 0, rows));
-  Assert (j<cols, ExcIndexRange(j, 0, cols));
+  Assert (i<rows, ExcIndexRangeType<size_type>(i, 0, rows));
+  Assert (j<cols, ExcIndexRangeType<size_type>(j, 0, cols));
 
   lines[i].add (j);
 }
@@ -535,7 +545,7 @@ CompressedSparsityPattern::add (const unsigned int i,
 template <typename ForwardIterator>
 inline
 void
-CompressedSparsityPattern::add_entries (const unsigned int row,
+CompressedSparsityPattern::add_entries (const size_type row,
                                         ForwardIterator begin,
                                         ForwardIterator end,
                                         const bool      indices_are_sorted)
@@ -556,10 +566,10 @@ CompressedSparsityPattern::Line::Line ()
 
 
 inline
-unsigned int
-CompressedSparsityPattern::row_length (const unsigned int row) const
+types::global_dof_index
+CompressedSparsityPattern::row_length (const size_type row) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
 
   if (lines[row].cache_entries != 0)
     lines[row].flush_cache ();
@@ -569,13 +579,13 @@ CompressedSparsityPattern::row_length (const unsigned int row) const
 
 
 inline
-unsigned int
-CompressedSparsityPattern::column_number (const unsigned int row,
-                                          const unsigned int index) const
+types::global_dof_index
+CompressedSparsityPattern::column_number (const size_type row,
+                                          const size_type index) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
   Assert (index < lines[row].entries.size(),
-          ExcIndexRange (index, 0, lines[row].entries.size()));
+          ExcIndexRangeType<size_type> (index, 0, lines[row].entries.size()));
 
   if (lines[row].cache_entries != 0)
     lines[row].flush_cache ();
@@ -586,9 +596,9 @@ CompressedSparsityPattern::column_number (const unsigned int row,
 
 inline
 CompressedSparsityPattern::row_iterator
-CompressedSparsityPattern::row_begin (const unsigned int row) const
+CompressedSparsityPattern::row_begin (const size_type row) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
 
   if (lines[row].cache_entries != 0)
     lines[row].flush_cache ();
@@ -599,9 +609,9 @@ CompressedSparsityPattern::row_begin (const unsigned int row) const
 
 inline
 CompressedSparsityPattern::row_iterator
-CompressedSparsityPattern::row_end (const unsigned int row) const
+CompressedSparsityPattern::row_end (const size_type row) const
 {
-  Assert (row < n_rows(), ExcIndexRange (row, 0, n_rows()));
+  Assert (row < n_rows(), ExcIndexRangeType<size_type> (row, 0, n_rows()));
   return lines[row].entries.end();
 }
 
index ce286f57c6c27ccb6fbb86c42728aca818f3a8e5..8237b943d99b9719bc86d7667d1fdf9c74dd1b76 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__constraint_matrix_h
 #define __deal2__constraint_matrix_h
@@ -54,8 +59,8 @@ namespace internals
 
 
 //TODO[WB]: We should have a function of the kind
-//   ConstraintMatrix::add_constraint (const unsigned int constrained_dof,
-//                const std::vector<std::pair<unsigned int, double> > &entries,
+//   ConstraintMatrix::add_constraint (const size_type constrained_dof,
+//                const std::vector<std::pair<size_type, double> > &entries,
 //                const double inhomogeneity = 0);
 // rather than building up constraints piecemeal through add_line/add_entry
 // etc. This would also eliminate the possibility of accidentally changing
@@ -139,6 +144,11 @@ namespace internals
 class ConstraintMatrix : public Subscriptor
 {
 public:
+  /**
+   * Declare the type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * An enum that describes what should
    * happen if the two ConstraintMatrix
@@ -221,7 +231,7 @@ public:
    * line. Always returns true if not in
    * the distributed case.
    */
-  bool can_store_line (const unsigned int line_index) const;
+  bool can_store_line (const size_type line_index) const;
 
   /**
    * This function copies the content of @p
@@ -271,7 +281,7 @@ public:
    * line already exists, then the function
    * simply returns without doing anything.
    */
-  void add_line (const unsigned int line);
+  void add_line (const size_type line);
 
   /**
    * Call the first add_line() function for
@@ -315,7 +325,7 @@ public:
    * inhomogeneities using
    * set_inhomogeneity().
    */
-  void add_lines (const std::set<unsigned int> &lines);
+  void add_lines (const std::set<size_type> &lines);
 
   /**
    * Call the first add_line() function for
@@ -360,8 +370,8 @@ public:
    * same. Thus, it does no harm to
    * enter a constraint twice.
    */
-  void add_entry (const unsigned int line,
-                  const unsigned int column,
+  void add_entry (const size_type line,
+                  const size_type column,
                   const double value);
 
   /**
@@ -373,8 +383,8 @@ public:
    * function several times, but is
    * faster.
    */
-  void add_entries (const unsigned int                                  line,
-                    const std::vector<std::pair<unsigned int,double> > &col_val_pairs);
+  void add_entries (const size_type                                  line,
+                    const std::vector<std::pair<size_type,double> > &col_val_pairs);
 
   /**
    * Set an imhomogeneity to the
@@ -385,8 +395,8 @@ public:
    * @note the line needs to be added with
    * one of the add_line() calls first.
    */
-  void set_inhomogeneity (const unsigned int line,
-                          const double       value);
+  void set_inhomogeneity (const size_type line,
+                          const double    value);
 
   /**
    * Close the filling of entries. Since
@@ -471,7 +481,7 @@ public:
    * finally merge() them together
    * again.
    */
-  void shift (const unsigned int offset);
+  void shift (const size_type offset);
 
   /**
    * Clear all entries of this
@@ -499,7 +509,7 @@ public:
    * Return number of constraints stored in
    * this matrix.
    */
-  unsigned int n_constraints () const;
+  size_type n_constraints () const;
 
   /**
    * Return whether the degree of freedom
@@ -515,7 +525,7 @@ public:
    * called, we have to perform a linear
    * search through all entries.
    */
-  bool is_constrained (const unsigned int index) const;
+  bool is_constrained (const size_type index) const;
 
   /**
    * Return whether the dof is
@@ -536,7 +546,7 @@ public:
    * freedom but with a weight different
    * from one.
    */
-  bool is_identity_constrained (const unsigned int index) const;
+  bool is_identity_constrained (const size_type index) const;
 
   /**
    * Return the maximum number of other
@@ -555,7 +565,7 @@ public:
    * constrained node are indirected to
    * the nodes it is constrained to.
    */
-  unsigned int max_constraint_indirections () const;
+  size_type max_constraint_indirections () const;
 
   /**
    * Returns <tt>true</tt> in case the
@@ -563,7 +573,7 @@ public:
    * non-trivial inhomogeneous valeus set
    * to the dof.
    */
-  bool is_inhomogeneously_constrained (const unsigned int index) const;
+  bool is_inhomogeneously_constrained (const size_type index) const;
 
   /**
    * Returns <tt>false</tt> if all
@@ -580,8 +590,8 @@ public:
    * zero pointer in case the dof is not
    * constrained.
    */
-  const std::vector<std::pair<unsigned int,double> > *
-  get_constraint_entries (const unsigned int line) const;
+  const std::vector<std::pair<size_type,double> > *
+  get_constraint_entries (const size_type line) const;
 
   /**
    * Returns the value of the inhomogeneity
@@ -589,7 +599,7 @@ public:
    * line. Unconstrained dofs also return a
    * zero value.
    */
-  double get_inhomogeneity (const unsigned int line) const;
+  double get_inhomogeneity (const size_type line) const;
 
   /**
    * Print the constraint lines. Mainly
@@ -985,9 +995,9 @@ public:
    */
   template <class InVector, class OutVector>
   void
-  distribute_local_to_global (const InVector                  &local_vector,
-                              const std::vector<unsigned int> &local_dof_indices,
-                              OutVector                       &global_vector) const;
+  distribute_local_to_global (const InVector               &local_vector,
+                              const std::vector<size_type> &local_dof_indices,
+                              OutVector                    &global_vector) const;
 
   /**
    * This function takes a vector of
@@ -1062,10 +1072,10 @@ public:
    */
   template <typename VectorType>
   void
-  distribute_local_to_global (const Vector<double>            &local_vector,
-                              const std::vector<unsigned int> &local_dof_indices,
-                              VectorType                      &global_vector,
-                              const FullMatrix<double>        &local_matrix) const;
+  distribute_local_to_global (const Vector<double>         &local_vector,
+                              const std::vector<size_type> &local_dof_indices,
+                              VectorType                   &global_vector,
+                              const FullMatrix<double>     &local_matrix) const;
 
   /**
    * Enter a single value into a
@@ -1073,9 +1083,9 @@ public:
    */
   template <class VectorType>
   void
-  distribute_local_to_global (const unsigned int index,
-                              const double       value,
-                              VectorType        &global_vector) const;
+  distribute_local_to_global (const size_type index,
+                              const double    value,
+                              VectorType     &global_vector) const;
 
   /**
    * This function takes a pointer to a
@@ -1195,9 +1205,9 @@ public:
    */
   template <typename MatrixType>
   void
-  distribute_local_to_global (const FullMatrix<double>        &local_matrix,
-                              const std::vector<unsigned int> &local_dof_indices,
-                              MatrixType                      &global_matrix) const;
+  distribute_local_to_global (const FullMatrix<double>     &local_matrix,
+                              const std::vector<size_type> &local_dof_indices,
+                              MatrixType                   &global_matrix) const;
 
   /**
    * Does the same as the function
@@ -1206,10 +1216,10 @@ public:
    */
   template <typename MatrixType>
   void
-  distribute_local_to_global (const FullMatrix<double>        &local_matrix,
-                              const std::vector<unsigned int> &row_indices,
-                              const std::vector<unsigned int> &col_indices,
-                              MatrixType                      &global_matrix) const;
+  distribute_local_to_global (const FullMatrix<double>     &local_matrix,
+                              const std::vector<size_type> &row_indices,
+                              const std::vector<size_type> &col_indices,
+                              MatrixType                   &global_matrix) const;
 
   /**
    * This function simultaneously
@@ -1231,12 +1241,12 @@ public:
    */
   template <typename MatrixType, typename VectorType>
   void
-  distribute_local_to_global (const FullMatrix<double>        &local_matrix,
-                              const Vector<double>            &local_vector,
-                              const std::vector<unsigned int> &local_dof_indices,
-                              MatrixType                      &global_matrix,
-                              VectorType                      &global_vector,
-                              bool                            use_inhomogeneities_for_rhs = false) const;
+  distribute_local_to_global (const FullMatrix<double>      &local_matrix,
+                              const Vector<double>          &local_vector,
+                              const std::vector<size_type>  &local_dof_indices,
+                              MatrixType                    &global_matrix,
+                              VectorType                    &global_vector,
+                              bool                          use_inhomogeneities_for_rhs = false) const;
 
   /**
    * Do a similar operation as the
@@ -1319,9 +1329,9 @@ public:
    */
   template <typename SparsityType>
   void
-  add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
-                               SparsityType                    &sparsity_pattern,
-                               const bool                       keep_constrained_entries = true,
+  add_entries_local_to_global (const std::vector<size_type> &local_dof_indices,
+                               SparsityType                 &sparsity_pattern,
+                               const bool                    keep_constrained_entries = true,
                                const Table<2,bool>             &dof_mask = default_empty_table) const;
 
   /**
@@ -1332,11 +1342,11 @@ public:
 
   template <typename SparsityType>
   void
-  add_entries_local_to_global (const std::vector<unsigned int> &row_indices,
-                               const std::vector<unsigned int> &col_indices,
-                               SparsityType                    &sparsity_pattern,
-                               const bool                       keep_constrained_entries = true,
-                               const Table<2,bool>             &dof_mask = default_empty_table) const;
+  add_entries_local_to_global (const std::vector<size_type> &row_indices,
+                               const std::vector<size_type> &col_indices,
+                               SparsityType                 &sparsity_pattern,
+                               const bool                    keep_constrained_entries = true,
+                               const Table<2,bool>          &dof_mask = default_empty_table) const;
 
   /**
    * This function imports values from a
@@ -1451,7 +1461,7 @@ public:
    * @ingroup Exceptions
    */
   DeclException1 (ExcLineInexistant,
-                  unsigned int,
+                  size_type,
                   << "The specified line " << arg1
                   << " does not exist.");
   /**
@@ -1460,7 +1470,7 @@ public:
    * @ingroup Exceptions
    */
   DeclException4 (ExcEntryAlreadyExists,
-                  int, int, double, double,
+                  size_type, size_type, double, double,
                   << "The entry for the indices " << arg1 << " and "
                   << arg2 << " already exists, but the values "
                   << arg3 << " (old) and " << arg4 << " (new) differ "
@@ -1481,7 +1491,7 @@ public:
    * @ingroup Exceptions
    */
   DeclException1 (ExcDoFIsConstrainedFromBothObjects,
-                  int,
+                  size_type,
                   << "Degree of freedom " << arg1
                   << " is constrained from both object in a merge operation.");
   /**
@@ -1490,7 +1500,7 @@ public:
    * @ingroup Exceptions
    */
   DeclException1 (ExcDoFIsConstrainedToConstrainedDoF,
-                  int,
+                  size_type,
                   << "In the given argument a degree of freedom is constrained "
                   << "to another DoF with number " << arg1
                   << ", which however is constrained by this object. This is not"
@@ -1501,7 +1511,7 @@ public:
    * @ingroup Exceptions
    */
   DeclException1 (ExcRowNotStoredHere,
-                  int,
+                  size_type,
                   << "The index set given to this constraint matrix indicates "
                   << "constraints for degree of freedom " << arg1
                   << " should not be stored by this object, but a constraint "
@@ -1513,7 +1523,7 @@ public:
    * @ingroup Exceptions
    */
   DeclException2 (ExcIncorrectConstraint,
-                 int, int,
+                  int, int,
                   << "While distributing the constraint for DoF "
                   << arg1 << ", it turns out that one of the processors "
                   << "who own the " << arg2
@@ -1524,7 +1534,7 @@ public:
                   << "with the appropriate locally_relevant set so "
                   << "that every processor who owns a DoF that constrains "
                   << "another DoF also knows about this constraint?");
-  
+
 private:
 
   /**
@@ -1538,7 +1548,7 @@ private:
      * of entries that make up the homogenous
      * part of a constraint.
      */
-    typedef std::vector<std::pair<unsigned int,double> > Entries;
+    typedef std::vector<std::pair<size_type,double> > Entries;
 
     /**
      * Number of this line. Since only
@@ -1547,7 +1557,7 @@ private:
      * and have to store the line
      * number explicitly.
      */
-    unsigned int line;
+    size_type line;
 
     /**
      * Row numbers and values of the
@@ -1619,15 +1629,15 @@ private:
   std::vector<ConstraintLine> lines;
 
   /**
-   * A list of unsigned integers that
+   * A list of size_type that
    * contains the position of the
    * ConstraintLine of a constrained degree
    * of freedom, or
-   * numbers::invalid_unsigned_int if the
+   * numbers::invalid_size_type if the
    * degree of freedom is not
    * constrained. The
-   * numbers::invalid_unsigned_int
-  * return value returns thus whether
+   * numbers::invalid_size_type
+   * return value returns thus whether
    * there is a constraint line for a given
    * degree of freedom index. Note that
    * this class has no notion of how many
@@ -1676,7 +1686,7 @@ private:
    * contributions into vectors and
    * matrices.
    */
-  std::vector<unsigned int> lines_cache;
+  std::vector<size_type> lines_cache;
 
   /**
    * This IndexSet is used to limit the
@@ -1699,7 +1709,7 @@ private:
    * index of line @p line in the vector
    * lines_cache using local_lines.
    */
-  unsigned int calculate_line_index (const unsigned int line) const;
+  size_type calculate_line_index (const size_type line) const;
 
   /**
    * Return @p true if the weight of an
@@ -1708,7 +1718,7 @@ private:
    * used to delete entries with zero
    * weight.
    */
-  static bool check_zero_weight (const std::pair<unsigned int, double> &p);
+  static bool check_zero_weight (const std::pair<size_type, double> &p);
 
   /**
    * Dummy table that serves as default
@@ -1724,12 +1734,12 @@ private:
    */
   template <typename MatrixType, typename VectorType>
   void
-  distribute_local_to_global (const FullMatrix<double>        &local_matrix,
-                              const Vector<double>            &local_vector,
-                              const std::vector<unsigned int> &local_dof_indices,
-                              MatrixType                      &global_matrix,
-                              VectorType                      &global_vector,
-                              bool                            use_inhomogeneities_for_rhs,
+  distribute_local_to_global (const FullMatrix<double>     &local_matrix,
+                              const Vector<double>         &local_vector,
+                              const std::vector<size_type> &local_dof_indices,
+                              MatrixType                   &global_matrix,
+                              VectorType                   &global_vector,
+                              bool                          use_inhomogeneities_for_rhs,
                               internal::bool2type<false>) const;
 
   /**
@@ -1739,12 +1749,12 @@ private:
    */
   template <typename MatrixType, typename VectorType>
   void
-  distribute_local_to_global (const FullMatrix<double>        &local_matrix,
-                              const Vector<double>            &local_vector,
-                              const std::vector<unsigned int> &local_dof_indices,
-                              MatrixType                      &global_matrix,
-                              VectorType                      &global_vector,
-                              bool                            use_inhomogeneities_for_rhs,
+  distribute_local_to_global (const FullMatrix<double>     &local_matrix,
+                              const Vector<double>         &local_vector,
+                              const std::vector<size_type> &local_dof_indices,
+                              MatrixType                   &global_matrix,
+                              VectorType                   &global_vector,
+                              bool                          use_inhomogeneities_for_rhs,
                               internal::bool2type<true>) const;
 
   /**
@@ -1754,10 +1764,10 @@ private:
    */
   template <typename SparsityType>
   void
-  add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
-                               SparsityType                    &sparsity_pattern,
-                               const bool                       keep_constrained_entries,
-                               const Table<2,bool>             &dof_mask,
+  add_entries_local_to_global (const std::vector<size_type> &local_dof_indices,
+                               SparsityType                 &sparsity_pattern,
+                               const bool                    keep_constrained_entries,
+                               const Table<2,bool>          &dof_mask,
                                internal::bool2type<false>) const;
 
   /**
@@ -1767,10 +1777,10 @@ private:
    */
   template <typename SparsityType>
   void
-  add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
-                               SparsityType                    &sparsity_pattern,
-                               const bool                       keep_constrained_entries,
-                               const Table<2,bool>             &dof_mask,
+  add_entries_local_to_global (const std::vector<size_type> &local_dof_indices,
+                               SparsityType                 &sparsity_pattern,
+                               const bool                    keep_constrained_entries,
+                               const Table<2,bool>          &dof_mask,
                                internal::bool2type<true>) const;
 
   /**
@@ -1784,7 +1794,7 @@ private:
    * row indices.
    */
   void
-  make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
+  make_sorted_row_list (const std::vector<size_type> &local_dof_indices,
                         internals::GlobalRowsFromLocal  &global_rows) const;
 
   /**
@@ -1798,18 +1808,18 @@ private:
    * function.
    */
   void
-  make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
-                        std::vector<unsigned int>       &active_dofs) const;
+  make_sorted_row_list (const std::vector<size_type> &local_dof_indices,
+                        std::vector<size_type>       &active_dofs) const;
 
   /**
    * Internal helper function for
    * distribute_local_to_global function.
    */
   double
-  resolve_vector_entry (const unsigned int                    i,
+  resolve_vector_entry (const size_type                       i,
                         const internals::GlobalRowsFromLocal &global_rows,
                         const Vector<double>                 &local_vector,
-                        const std::vector<unsigned int>      &local_dof_indices,
+                        const std::vector<size_type>         &local_dof_indices,
                         const FullMatrix<double>             &local_matrix) const;
 };
 
@@ -1840,7 +1850,7 @@ ConstraintMatrix::ConstraintMatrix (const ConstraintMatrix &constraint_matrix)
 
 inline
 void
-ConstraintMatrix::add_line (const unsigned int line)
+ConstraintMatrix::add_line (const size_type line)
 {
   Assert (sorted==false, ExcMatrixIsClosed());
 
@@ -1854,9 +1864,9 @@ ConstraintMatrix::add_line (const unsigned int line)
   // several terabytes of memory to
   // resize the various arrays below
   // :-)
-  Assert (line != numbers::invalid_unsigned_int,
+  Assert (line != numbers::invalid_size_type,
           ExcInternalError());
-  const unsigned int line_index = calculate_line_index (line);
+  const size_type line_index = calculate_line_index (line);
 
   // check whether line already exists; it
   // may, in which case we can just quit
@@ -1866,9 +1876,9 @@ ConstraintMatrix::add_line (const unsigned int line)
   // if necessary enlarge vector of
   // existing entries for cache
   if (line_index >= lines_cache.size())
-    lines_cache.resize (std::max(2*static_cast<unsigned int>(lines_cache.size()),
+    lines_cache.resize (std::max(2*static_cast<size_type>(lines_cache.size()),
                                  line_index+1),
-                        numbers::invalid_unsigned_int);
+                        numbers::invalid_size_type);
 
   // push a new line to the end of the
   // list
@@ -1882,9 +1892,9 @@ ConstraintMatrix::add_line (const unsigned int line)
 
 inline
 void
-ConstraintMatrix::add_entry (const unsigned int line,
-                             const unsigned int column,
-                             const double       value)
+ConstraintMatrix::add_entry (const size_type line,
+                             const size_type column,
+                             const double    value)
 {
   Assert (sorted==false, ExcMatrixIsClosed());
   Assert (line != column,
@@ -1898,7 +1908,7 @@ ConstraintMatrix::add_entry (const unsigned int line,
   // in any case: exit the function if an
   // entry for this column already exists,
   // since we don't want to enter it twice
-  Assert (lines_cache[calculate_line_index(line)] != numbers::invalid_unsigned_int,
+  Assert (lines_cache[calculate_line_index(line)] != numbers::invalid_size_type,
           ExcInternalError());
   ConstraintLine *line_ptr = &lines[lines_cache[calculate_line_index(line)]];
   Assert (line_ptr->line == line, ExcInternalError());
@@ -1919,12 +1929,12 @@ ConstraintMatrix::add_entry (const unsigned int line,
 
 inline
 void
-ConstraintMatrix::set_inhomogeneity (const unsigned int line,
-                                     const double       value)
+ConstraintMatrix::set_inhomogeneity (const size_type line,
+                                     const double    value)
 {
-  const unsigned int line_index = calculate_line_index(line);
+  const size_type line_index = calculate_line_index(line);
   Assert( line_index < lines_cache.size() &&
-          lines_cache[line_index] != numbers::invalid_unsigned_int,
+          lines_cache[line_index] != numbers::invalid_size_type,
           ExcMessage("call add_line() before calling set_inhomogeneity()"));
   Assert(lines_cache[line_index] < lines.size(), ExcInternalError());
   ConstraintLine *line_ptr = &lines[lines_cache[line_index]];
@@ -1934,7 +1944,7 @@ ConstraintMatrix::set_inhomogeneity (const unsigned int line,
 
 
 inline
-unsigned int
+types::global_dof_index
 ConstraintMatrix::n_constraints () const
 {
   return lines.size();
@@ -1944,26 +1954,26 @@ ConstraintMatrix::n_constraints () const
 
 inline
 bool
-ConstraintMatrix::is_constrained (const unsigned int index) const
+ConstraintMatrix::is_constrained (const size_type index) const
 {
-  const unsigned int line_index = calculate_line_index(index);
+  const size_type line_index = calculate_line_index(index);
   return ((line_index < lines_cache.size())
           &&
-          (lines_cache[line_index] != numbers::invalid_unsigned_int));
+          (lines_cache[line_index] != numbers::invalid_size_type));
 }
 
 
 
 inline
 bool
-ConstraintMatrix::is_inhomogeneously_constrained (const unsigned int index) const
+ConstraintMatrix::is_inhomogeneously_constrained (const size_type index) const
 {
   // check whether the entry is
   // constrained. could use is_constrained, but
   // that means computing the line index twice
-  const unsigned int line_index = calculate_line_index(index);
+  const size_type line_index = calculate_line_index(index);
   if (line_index >= lines_cache.size() ||
-      lines_cache[line_index] == numbers::invalid_unsigned_int)
+      lines_cache[line_index] == numbers::invalid_size_type)
     return false;
   else
     {
@@ -1975,15 +1985,15 @@ ConstraintMatrix::is_inhomogeneously_constrained (const unsigned int index) cons
 
 
 inline
-const std::vector<std::pair<unsigned int,double> > *
-ConstraintMatrix::get_constraint_entries (unsigned int line) const
+const std::vector<std::pair<types::global_dof_index,double> > *
+ConstraintMatrix::get_constraint_entries (const size_type line) const
 {
   // check whether the entry is
   // constrained. could use is_constrained, but
   // that means computing the line index twice
-  const unsigned int line_index = calculate_line_index(line);
+  const size_type line_index = calculate_line_index(line);
   if (line_index >= lines_cache.size() ||
-      lines_cache[line_index] == numbers::invalid_unsigned_int)
+      lines_cache[line_index] == numbers::invalid_size_type)
     return 0;
   else
     return &lines[lines_cache[line_index]].entries;
@@ -1993,14 +2003,14 @@ ConstraintMatrix::get_constraint_entries (unsigned int line) const
 
 inline
 double
-ConstraintMatrix::get_inhomogeneity (const unsigned int line) const
+ConstraintMatrix::get_inhomogeneity (const size_type line) const
 {
   // check whether the entry is
   // constrained. could use is_constrained, but
   // that means computing the line index twice
-  const unsigned int line_index = calculate_line_index(line);
+  const size_type line_index = calculate_line_index(line);
   if (line_index >= lines_cache.size() ||
-      lines_cache[line_index] == numbers::invalid_unsigned_int)
+      lines_cache[line_index] == numbers::invalid_size_type)
     return 0;
   else
     return lines[lines_cache[line_index]].inhomogeneity;
@@ -2008,8 +2018,8 @@ ConstraintMatrix::get_inhomogeneity (const unsigned int line) const
 
 
 
-inline unsigned int
-ConstraintMatrix::calculate_line_index (const unsigned int line) const
+inline types::global_dof_index
+ConstraintMatrix::calculate_line_index (const size_type line) const
 {
   //IndexSet is unused (serial case)
   if (!local_lines.size())
@@ -2024,7 +2034,7 @@ ConstraintMatrix::calculate_line_index (const unsigned int line) const
 
 
 inline bool
-ConstraintMatrix::can_store_line (unsigned int line_index) const
+ConstraintMatrix::can_store_line (size_type line_index) const
 {
   return !local_lines.size() || local_lines.is_element(line_index);
 }
@@ -2034,9 +2044,9 @@ ConstraintMatrix::can_store_line (unsigned int line_index) const
 template <class VectorType>
 inline
 void ConstraintMatrix::distribute_local_to_global (
-  const unsigned int index,
-  const double       value,
-  VectorType        &global_vector) const
+  const size_type index,
+  const double    value,
+  VectorType     &global_vector) const
 {
   Assert (lines.empty() || sorted == true, ExcMatrixNotClosed());
 
@@ -2046,7 +2056,7 @@ void ConstraintMatrix::distribute_local_to_global (
     {
       const ConstraintLine &position =
         lines[lines_cache[calculate_line_index(index)]];
-      for (unsigned int j=0; j<position.entries.size(); ++j)
+      for (size_type j=0; j<position.entries.size(); ++j)
         global_vector(position.entries[j].first)
         += value * position.entries[j].second;
     }
@@ -2072,7 +2082,7 @@ void ConstraintMatrix::distribute_local_to_global (
         {
           const ConstraintLine &position =
             lines[lines_cache[calculate_line_index(*local_indices_begin)]];
-          for (unsigned int j=0; j<position.entries.size(); ++j)
+          for (size_type j=0; j<position.entries.size(); ++j)
             global_vector(position.entries[j].first)
             += *local_vector_begin * position.entries[j].second;
         }
@@ -2084,9 +2094,9 @@ template <class InVector, class OutVector>
 inline
 void
 ConstraintMatrix::distribute_local_to_global (
-  const InVector                  &local_vector,
-  const std::vector<unsigned int> &local_dof_indices,
-  OutVector                       &global_vector) const
+  const InVector               &local_vector,
+  const std::vector<size_type> &local_dof_indices,
+  OutVector                    &global_vector) const
 {
   Assert (local_vector.size() == local_dof_indices.size(),
           ExcDimensionMismatch(local_vector.size(), local_dof_indices.size()));
@@ -2115,7 +2125,7 @@ void ConstraintMatrix::get_dof_values (const VectorType  &global_vector,
           const ConstraintLine &position =
             lines[lines_cache[calculate_line_index(*local_indices_begin)]];
           typename VectorType::value_type value = position.inhomogeneity;
-          for (unsigned int j=0; j<position.entries.size(); ++j)
+          for (size_type j=0; j<position.entries.size(); ++j)
             value += (global_vector(position.entries[j].first) *
                       position.entries[j].second);
           *local_vector_begin = value;
@@ -2129,9 +2139,9 @@ template <typename MatrixType>
 inline
 void
 ConstraintMatrix::
-distribute_local_to_global (const FullMatrix<double>        &local_matrix,
-                            const std::vector<unsigned int> &local_dof_indices,
-                            MatrixType                      &global_matrix) const
+distribute_local_to_global (const FullMatrix<double>     &local_matrix,
+                            const std::vector<size_type> &local_dof_indices,
+                            MatrixType                   &global_matrix) const
 {
   // create a dummy and hand on to the
   // function actually implementing this
@@ -2148,12 +2158,12 @@ template <typename MatrixType, typename VectorType>
 inline
 void
 ConstraintMatrix::
-distribute_local_to_global (const FullMatrix<double>        &local_matrix,
-                            const Vector<double>            &local_vector,
-                            const std::vector<unsigned int> &local_dof_indices,
-                            MatrixType                      &global_matrix,
-                            VectorType                      &global_vector,
-                            bool                            use_inhomogeneities_for_rhs) const
+distribute_local_to_global (const FullMatrix<double>     &local_matrix,
+                            const Vector<double>         &local_vector,
+                            const std::vector<size_type> &local_dof_indices,
+                            MatrixType                   &global_matrix,
+                            VectorType                   &global_vector,
+                            bool                          use_inhomogeneities_for_rhs) const
 {
   // enter the internal function with the
   // respective block information set, the
@@ -2170,10 +2180,10 @@ template <typename SparsityType>
 inline
 void
 ConstraintMatrix::
-add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
-                             SparsityType                    &sparsity_pattern,
-                             const bool                       keep_constrained_entries,
-                             const Table<2,bool>             &dof_mask) const
+add_entries_local_to_global (const std::vector<size_type> &local_dof_indices,
+                             SparsityType                 &sparsity_pattern,
+                             const bool                    keep_constrained_entries,
+                             const Table<2,bool>          &dof_mask) const
 {
   // enter the internal function with the
   // respective block information set, the
index 037b2f953591065c5e48536adec8ee05584a7540..4a1ce1888cdd58a7a0662e36c3b73026373b4371 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__constraint_matrix_templates_h
 #define __deal2__constraint_matrix_templates_h
@@ -24,6 +29,9 @@
 #include <deal.II/lac/block_sparse_matrix.h>
 #include <deal.II/lac/parallel_vector.h>
 #include <deal.II/lac/parallel_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/trilinos_vector.h>
 
 #include <iomanip>
 
@@ -80,15 +88,15 @@ ConstraintMatrix::condense (const VectorType &uncondensed,
   new_line.reserve (uncondensed.size());
 
   std::vector<ConstraintLine>::const_iterator next_constraint = lines.begin();
-  unsigned int                                shift           = 0;
-  unsigned int n_rows = uncondensed.size();
+  size_type                                   shift           = 0;
+  size_type n_rows = uncondensed.size();
 
   if (next_constraint == lines.end())
     // if no constraint is to be handled
-    for (unsigned int row=0; row!=n_rows; ++row)
+    for (size_type row=0; row!=n_rows; ++row)
       new_line.push_back (row);
   else
-    for (unsigned int row=0; row!=n_rows; ++row)
+    for (size_type row=0; row!=n_rows; ++row)
       if (row == next_constraint->line)
         {
           // this line is constrained
@@ -100,7 +108,7 @@ ConstraintMatrix::condense (const VectorType &uncondensed,
             // nothing more to do; finish rest
             // of loop
             {
-              for (unsigned int i=row+1; i<n_rows; ++i)
+              for (size_type i=row+1; i<n_rows; ++i)
                 new_line.push_back (i-shift);
               break;
             };
@@ -116,7 +124,7 @@ ConstraintMatrix::condense (const VectorType &uncondensed,
   // only evaluated so often as there are
   // entries in new_line[*] which tells us
   // which constraints exist
-  for (unsigned int row=0; row<uncondensed.size(); ++row)
+  for (size_type row=0; row<uncondensed.size(); ++row)
     if (new_line[row] != -1)
       // line not constrained
       // copy entry
@@ -125,7 +133,7 @@ ConstraintMatrix::condense (const VectorType &uncondensed,
     else
       // line must be distributed
       {
-        for (unsigned int q=0; q!=next_constraint->entries.size(); ++q)
+        for (size_type q=0; q!=next_constraint->entries.size(); ++q)
           condensed(new_line[next_constraint->entries[q].first])
           +=
             uncondensed(row) * next_constraint->entries[q].second;
@@ -159,7 +167,7 @@ ConstraintMatrix::condense (VectorType &vec) const
                           "without any matrix specified."));
 
       const typename VectorType::value_type old_value = vec(constraint_line->line);
-      for (unsigned int q=0; q!=constraint_line->entries.size(); ++q)
+      for (size_type q=0; q!=constraint_line->entries.size(); ++q)
         if (vec.in_local_range(constraint_line->entries[q].first) == true)
           vec(constraint_line->entries[q].first)
           += (static_cast<typename VectorType::value_type>
@@ -219,15 +227,15 @@ ConstraintMatrix::condense (const SparseMatrix<number> &uncondensed,
   new_line.reserve (uncondensed_struct.n_rows());
 
   std::vector<ConstraintLine>::const_iterator next_constraint = lines.begin();
-  unsigned int                                shift           = 0;
-  const unsigned int n_rows = uncondensed_struct.n_rows();
+  size_type                                   shift           = 0;
+  const size_type n_rows = uncondensed_struct.n_rows();
 
   if (next_constraint == lines.end())
     // if no constraint is to be handled
-    for (unsigned int row=0; row!=n_rows; ++row)
+    for (size_type row=0; row!=n_rows; ++row)
       new_line.push_back (row);
   else
-    for (unsigned int row=0; row!=n_rows; ++row)
+    for (size_type row=0; row!=n_rows; ++row)
       if (row == next_constraint->line)
         {
           // this line is constrained
@@ -239,7 +247,7 @@ ConstraintMatrix::condense (const SparseMatrix<number> &uncondensed,
             // nothing more to do; finish rest
             // of loop
             {
-              for (unsigned int i=row+1; i<n_rows; ++i)
+              for (size_type i=row+1; i<n_rows; ++i)
                 new_line.push_back (i-shift);
               break;
             };
@@ -256,7 +264,7 @@ ConstraintMatrix::condense (const SparseMatrix<number> &uncondensed,
   // only evaluated so often as there are
   // entries in new_line[*] which tells us
   // which constraints exist
-  for (unsigned int row=0; row<uncondensed_struct.n_rows(); ++row)
+  for (size_type row=0; row<uncondensed_struct.n_rows(); ++row)
     if (new_line[row] != -1)
       {
         // line not constrained
@@ -278,7 +286,7 @@ ConstraintMatrix::condense (const SparseMatrix<number> &uncondensed,
               while (c->line != p->column())
                 ++c;
 
-              for (unsigned int q=0; q!=c->entries.size(); ++q)
+              for (size_type q=0; q!=c->entries.size(); ++q)
                 // distribute to rows with
                 // appropriate weight
                 condensed.add (new_line[row], new_line[c->entries[q].first],
@@ -307,7 +315,7 @@ ConstraintMatrix::condense (const SparseMatrix<number> &uncondensed,
           // for each column: distribute
           if (new_line[p->column()] != -1)
             // column is not constrained
-            for (unsigned int q=0; q!=next_constraint->entries.size(); ++q)
+            for (size_type q=0; q!=next_constraint->entries.size(); ++q)
               condensed.add (new_line[next_constraint->entries[q].first],
                              new_line[p->column()],
                              p->value() *
@@ -323,8 +331,8 @@ ConstraintMatrix::condense (const SparseMatrix<number> &uncondensed,
               while (c->line != p->column())
                 ++c;
 
-              for (unsigned int r=0; r!=c->entries.size(); ++r)
-                for (unsigned int q=0; q!=next_constraint->entries.size(); ++q)
+              for (size_type r=0; r!=c->entries.size(); ++r)
+                for (size_type q=0; q!=next_constraint->entries.size(); ++q)
                   condensed.add (new_line[next_constraint->entries[q].first],
                                  new_line[c->entries[r].first],
                                  p->value() *
@@ -332,7 +340,7 @@ ConstraintMatrix::condense (const SparseMatrix<number> &uncondensed,
                                  c->entries[r].second);
 
               if (use_vectors == true)
-                for (unsigned int q=0; q!=next_constraint->entries.size(); ++q)
+                for (size_type q=0; q!=next_constraint->entries.size(); ++q)
                   condensed_vector (new_line[next_constraint->entries[q].first])
                   -= p->value() *
                      next_constraint->entries[q].second *
@@ -341,7 +349,7 @@ ConstraintMatrix::condense (const SparseMatrix<number> &uncondensed,
 
         // condense the vector
         if (use_vectors == true)
-          for (unsigned int q=0; q!=next_constraint->entries.size(); ++q)
+          for (size_type q=0; q!=next_constraint->entries.size(); ++q)
             condensed_vector(new_line[next_constraint->entries[q].first])
             +=
               uncondensed_vector(row) * next_constraint->entries[q].second;
@@ -372,33 +380,33 @@ ConstraintMatrix::condense (SparseMatrix<number> &uncondensed,
     AssertDimension (vec.size(), sparsity.n_rows());
 
   double average_diagonal = 0;
-  for (unsigned int i=0; i<uncondensed.m(); ++i)
+  for (size_type i=0; i<uncondensed.m(); ++i)
     average_diagonal += std::fabs (uncondensed.diag_element(i));
   average_diagonal /= uncondensed.m();
 
   // store for each index whether it must be
   // distributed or not. If entry is
-  // invalid_unsigned_int, no distribution is
+  // invalid_size_type, no distribution is
   // necessary.  otherwise, the number states
   // which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute (sparsity.n_rows(),
-                                        numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute (sparsity.n_rows(),
+                                     numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = c;
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         // regular line. loop over cols
         {
           for (typename SparseMatrix<number>::iterator
                entry = uncondensed.begin(row);
                entry != uncondensed.end(row); ++entry)
             {
-              const unsigned int column = entry->column();
+              const size_type column = entry->column();
 
               // end of row reached?
               // this should not
@@ -408,7 +416,7 @@ ConstraintMatrix::condense (SparseMatrix<number> &uncondensed,
               Assert (column != SparsityPattern::invalid_entry,
                       ExcMatrixNotClosed());
 
-              if (distribute[column] != numbers::invalid_unsigned_int)
+              if (distribute[column] != numbers::invalid_size_type)
                 // distribute entry at
                 // regular row @p row
                 // and irregular column
@@ -416,7 +424,7 @@ ConstraintMatrix::condense (SparseMatrix<number> &uncondensed,
                 // set old entry to
                 // zero
                 {
-                  for (unsigned int q=0;
+                  for (size_type q=0;
                        q!=lines[distribute[column]].entries.size(); ++q)
                     uncondensed.add (row,
                                      lines[distribute[column]].entries[q].first,
@@ -444,7 +452,7 @@ ConstraintMatrix::condense (SparseMatrix<number> &uncondensed,
                entry = uncondensed.begin(row);
                entry != uncondensed.end(row); ++entry)
             {
-              const unsigned int column = entry->column();
+              const size_type column = entry->column();
 
               // end of row reached?
               // this should not
@@ -454,7 +462,7 @@ ConstraintMatrix::condense (SparseMatrix<number> &uncondensed,
               Assert (column != SparsityPattern::invalid_entry,
                       ExcMatrixNotClosed());
 
-              if (distribute[column] == numbers::invalid_unsigned_int)
+              if (distribute[column] == numbers::invalid_size_type)
                 // distribute entry at
                 // irregular row
                 // @p row and regular
@@ -462,7 +470,7 @@ ConstraintMatrix::condense (SparseMatrix<number> &uncondensed,
                 // column. set
                 // old entry to zero
                 {
-                  for (unsigned int q=0;
+                  for (size_type q=0;
                        q!=lines[distribute[row]].entries.size(); ++q)
                     uncondensed.add (lines[distribute[row]].entries[q].first,
                                      column,
@@ -480,9 +488,9 @@ ConstraintMatrix::condense (SparseMatrix<number> &uncondensed,
                 // to one on main
                 // diagonal, zero otherwise
                 {
-                  for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                  for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
                     {
-                      for (unsigned int q=0;
+                      for (size_type q=0;
                            q!=lines[distribute[column]].entries.size(); ++q)
                         uncondensed.add (lines[distribute[row]].entries[p].first,
                                          lines[distribute[column]].entries[q].first,
@@ -505,7 +513,7 @@ ConstraintMatrix::condense (SparseMatrix<number> &uncondensed,
           // take care of vector
           if (use_vectors == true)
             {
-              for (unsigned int q=0; q!=lines[distribute[row]].entries.size(); ++q)
+              for (size_type q=0; q!=lines[distribute[row]].entries.size(); ++q)
                 vec(lines[distribute[row]].entries[q].first)
                 += (vec(row) * lines[distribute[row]].entries[q].second);
 
@@ -527,7 +535,7 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
   // the other function above.
   const bool use_vectors = vec.n_blocks() == 0 ? false : true;
 
-  const unsigned int blocks = uncondensed.n_block_rows();
+  const size_type blocks = uncondensed.n_block_rows();
 
   const BlockSparsityPattern &
   sparsity = uncondensed.get_sparsity_pattern ();
@@ -550,8 +558,8 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
     }
 
   double average_diagonal = 0;
-  for (unsigned int b=0; b<uncondensed.n_block_rows(); ++b)
-    for (unsigned int i=0; i<uncondensed.block(b,b).m(); ++i)
+  for (size_type b=0; b<uncondensed.n_block_rows(); ++b)
+    for (size_type i=0; i<uncondensed.block(b,b).m(); ++i)
       average_diagonal += std::fabs (uncondensed.block(b,b).diag_element(i));
   average_diagonal /= uncondensed.m();
 
@@ -560,27 +568,27 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
 
   // store for each index whether it must be
   // distributed or not. If entry is
-  // numbers::invalid_unsigned_int,
+  // numbers::invalid_size_type,
   // no distribution is necessary.
   // otherwise, the number states which line
   // in the constraint matrix handles this
   // index
-  std::vector<unsigned int> distribute (sparsity.n_rows(),
-                                        numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute (sparsity.n_rows(),
+                                     numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = c;
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
       // get index of this row
       // within the blocks
-      const std::pair<unsigned int,unsigned int>
+      const std::pair<size_type,size_type>
       block_index = index_mapping.global_to_local(row);
-      const unsigned int block_row = block_index.first;
+      const size_type block_row = block_index.first;
 
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         // regular line. loop over
         // all columns and see
         // whether this column must
@@ -593,17 +601,17 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
           // this blockrow and the
           // corresponding row
           // therein
-          for (unsigned int block_col=0; block_col<blocks; ++block_col)
+          for (size_type block_col=0; block_col<blocks; ++block_col)
             {
               for (typename SparseMatrix<number>::iterator
                    entry = uncondensed.block(block_row, block_col).begin(block_index.second);
                    entry != uncondensed.block(block_row, block_col).end(block_index.second);
                    ++entry)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global(block_col,entry->column());
 
-                  if (distribute[global_col] != numbers::invalid_unsigned_int)
+                  if (distribute[global_col] != numbers::invalid_size_type)
                     // distribute entry at
                     // regular row @p row
                     // and irregular column
@@ -612,7 +620,7 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
                     {
                       const double old_value = entry->value ();
 
-                      for (unsigned int q=0;
+                      for (size_type q=0;
                            q!=lines[distribute[global_col]].entries.size(); ++q)
                         uncondensed.add (row,
                                          lines[distribute[global_col]].entries[q].first,
@@ -640,18 +648,18 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
           // whole row into the
           // chunks defined by the
           // blocks
-          for (unsigned int block_col=0; block_col<blocks; ++block_col)
+          for (size_type block_col=0; block_col<blocks; ++block_col)
             {
               for (typename SparseMatrix<number>::iterator
                    entry = uncondensed.block(block_row, block_col).begin(block_index.second);
                    entry != uncondensed.block(block_row, block_col).end(block_index.second);
                    ++entry)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global (block_col, entry->column());
 
                   if (distribute[global_col] ==
-                      numbers::invalid_unsigned_int)
+                      numbers::invalid_size_type)
                     // distribute
                     // entry at
                     // irregular
@@ -664,7 +672,7 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
                     {
                       const double old_value = entry->value();
 
-                      for (unsigned int q=0;
+                      for (size_type q=0;
                            q!=lines[distribute[row]].entries.size(); ++q)
                         uncondensed.add (lines[distribute[row]].entries[q].first,
                                          global_col,
@@ -684,9 +692,9 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
                     {
                       const double old_value = entry->value ();
 
-                      for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                      for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
                         {
-                          for (unsigned int q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
+                          for (size_type q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
                             uncondensed.add (lines[distribute[row]].entries[p].first,
                                              lines[distribute[global_col]].entries[q].first,
                                              old_value *
@@ -707,7 +715,7 @@ ConstraintMatrix::condense (BlockSparseMatrix<number> &uncondensed,
           // take care of vector
           if (use_vectors == true)
             {
-              for (unsigned int q=0; q!=lines[distribute[row]].entries.size(); ++q)
+              for (size_type q=0; q!=lines[distribute[row]].entries.size(); ++q)
                 vec(lines[distribute[row]].entries[q].first)
                 += (vec(row) * lines[distribute[row]].entries[q].second);
 
@@ -730,33 +738,61 @@ namespace internal
   {
     namespace
     {
-      // TODO: in general we should iterate over the constraints and not over all DoFs
-      // for performance reasons
+      typedef types::global_dof_index size_type;
+
       template<class VEC>
-      void set_zero_parallel(const dealii::ConstraintMatrix &cm, VEC &vec, unsigned int shift = 0)
+      void set_zero_parallel(const std::vector<size_type> &cm, VEC &vec, size_type shift = 0)
       {
-        Assert(!vec.has_ghost_elements(), ExcInternalError());//ExcGhostsPresent());
-
-        const unsigned int
-        start = vec.local_range().first,
-        end   = vec.local_range().second;
-        for (unsigned int i=start; i<end; ++i)
-          if (cm.is_constrained (shift + i))
-            vec(i) = 0;
+        Assert(!vec.has_ghost_elements(), ExcInternalError());
+        IndexSet locally_owned = vec.locally_owned_elements();
+        for (typename std::vector<size_type>::const_iterator it = cm.begin();
+             it != cm.end(); ++it)
+          {
+            // If shift>0 then we are working on a part of a BlockVector
+            // so vec(i) is actually the global entry i+shift.
+            // We first make sure the line falls into the range of vec,
+            // then check if is part of the local part of the vector, before
+            // finally setting it to 0.
+            if ((*it)<shift)
+              continue;
+            size_type idx = *it - shift;
+            if (idx<vec.size() && locally_owned.is_element(idx))
+              vec(idx) = 0.;
+          }
+      }
+
+      template<typename Number>
+      void set_zero_parallel(const std::vector<size_type> &cm, parallel::distributed::Vector<Number> &vec, size_type shift = 0)
+      {
+        for (typename std::vector<size_type>::const_iterator it = cm.begin();
+             it != cm.end(); ++it)
+          {
+            // If shift>0 then we are working on a part of a BlockVector
+            // so vec(i) is actually the global entry i+shift.
+            // We first make sure the line falls into the range of vec,
+            // then check if is part of the local part of the vector, before
+            // finally setting it to 0.
+            if ((*it)<shift)
+              continue;
+            size_type idx = *it - shift;
+            if (vec.in_local_range(idx))
+              vec(idx) = 0.;
+          }
+        vec.zero_out_ghosts();
       }
 
       template<class VEC>
-      void set_zero_in_parallel(const dealii::ConstraintMatrix &cm, VEC &vec, internal::bool2type<false>)
+      void set_zero_in_parallel(const std::vector<size_type> &cm, VEC &vec, internal::bool2type<false>)
       {
         set_zero_parallel(cm, vec, 0);
       }
 
       // in parallel for BlockVectors
       template<class VEC>
-      void set_zero_in_parallel(const dealii::ConstraintMatrix &cm, VEC &vec, internal::bool2type<true>)
+      void set_zero_in_parallel(const std::vector<size_type> &cm, VEC &vec, internal::bool2type<true>)
       {
-        unsigned int start_shift = 0;
-        for (unsigned int j=0; j<vec.n_blocks(); ++j)
+        size_type start_shift = 0;
+        for (size_type j=0; j<vec.n_blocks(); ++j)
           {
             set_zero_parallel(cm, vec.block(j), start_shift);
             start_shift += vec.block(j).size();
@@ -764,19 +800,15 @@ namespace internal
       }
 
       template<class VEC>
-      void set_zero_serial(const dealii::ConstraintMatrix &cm, VEC &vec)
+      void set_zero_serial(const std::vector<size_type> &cm, VEC &vec)
       {
-        // TODO would be faster:
-        /* std::vector<dealii::ConstraintMatrix::ConstraintLine>::const_iterator constraint_line = cm.lines.begin();
-           for (; constraint_line!=cm.lines.end(); ++constraint_line)
-           vec(constraint_line->line) = 0.;*/
-        for (unsigned int i=0; i<vec.size(); ++i)
-          if (cm.is_constrained (i))
-            vec(i) = 0;
+        for (typename std::vector<size_type>::const_iterator it = cm.begin();
+             it != cm.end(); ++it)
+          vec(*it) = 0.;
       }
 
       template<class VEC>
-      void set_zero_all(const dealii::ConstraintMatrix &cm, VEC &vec)
+      void set_zero_all(const std::vector<size_type> &cm, VEC &vec)
       {
         set_zero_in_parallel<VEC>(cm, vec, internal::bool2type<IsBlockVector<VEC>::value>());
         vec.compress(VectorOperation::insert);
@@ -784,31 +816,16 @@ namespace internal
 
 
       template<class T>
-      void set_zero_all(const dealii::ConstraintMatrix &cm, dealii::Vector<T> &vec)
+      void set_zero_all(const std::vector<size_type> &cm, dealii::Vector<T> &vec)
       {
         set_zero_serial(cm, vec);
       }
 
       template<class T>
-      void set_zero_all(const dealii::ConstraintMatrix &cm, dealii::BlockVector<T> &vec)
+      void set_zero_all(const std::vector<size_type> &cm, dealii::BlockVector<T> &vec)
       {
         set_zero_serial(cm, vec);
       }
-
-
-      template<class T>
-      void set_zero_all(const dealii::ConstraintMatrix &, dealii::parallel::distributed::Vector<T> &)
-      {
-        // should use the general template above, but requires that
-        // some member functions are added to parallel::distributed::Vector
-        Assert (false, ExcNotImplemented());
-      }
-
-      template<class T>
-      void set_zero_all(const dealii::ConstraintMatrix &, dealii::parallel::distributed::BlockVector<T> &)
-      {
-        Assert (false, ExcNotImplemented());
-      }
     }
   }
 }
@@ -818,7 +835,12 @@ template <class VectorType>
 void
 ConstraintMatrix::set_zero (VectorType &vec) const
 {
-  internal::ConstraintMatrix::set_zero_all(*this, vec);
+  // since we lines is a private member, we cannot pass it to the functions
+  // above. therefore, copy the content which is cheap
+  std::vector<size_type> constrained_lines(lines.size());
+  for (unsigned int i=0; i<lines.size(); ++i)
+    constrained_lines[i] = lines[i].line;
+  internal::ConstraintMatrix::set_zero_all(constrained_lines, vec);
 }
 
 
@@ -828,7 +850,7 @@ template <typename VectorType>
 void
 ConstraintMatrix::
 distribute_local_to_global (const Vector<double>            &local_vector,
-                            const std::vector<unsigned int> &local_dof_indices,
+                            const std::vector<size_type> &local_dof_indices,
                             VectorType                      &global_vector,
                             const FullMatrix<double>        &local_matrix) const
 {
@@ -837,11 +859,11 @@ distribute_local_to_global (const Vector<double>            &local_vector,
   AssertDimension (local_matrix.m(), local_dof_indices.size());
   AssertDimension (local_matrix.n(), local_dof_indices.size());
 
-  const unsigned int n_local_dofs = local_vector.size();
+  const size_type n_local_dofs = local_vector.size();
   if (lines.empty())
     global_vector.add(local_dof_indices, local_vector);
   else
-    for (unsigned int i=0; i<n_local_dofs; ++i)
+    for (size_type i=0; i<n_local_dofs; ++i)
       {
         // check whether the current index is
         // constrained. if not, just write the entry
@@ -855,7 +877,7 @@ distribute_local_to_global (const Vector<double>            &local_vector,
 
         // find the constraint line to the given
         // global dof index
-        const unsigned int line_index = calculate_line_index (local_dof_indices[i]);
+        const size_type line_index = calculate_line_index (local_dof_indices[i]);
         const ConstraintLine *position =
           lines_cache.size() <= line_index ? 0 : &lines[lines_cache[line_index]];
 
@@ -865,7 +887,7 @@ distribute_local_to_global (const Vector<double>            &local_vector,
         // constrained. If so, distribute the constraint
         const double val = position->inhomogeneity;
         if (val != 0)
-          for (unsigned int j=0; j<n_local_dofs; ++j)
+          for (size_type j=0; j<n_local_dofs; ++j)
             if (is_constrained(local_dof_indices[j]) == false)
               global_vector(local_dof_indices[j]) -= val * local_matrix(j,i);
             else
@@ -876,7 +898,7 @@ distribute_local_to_global (const Vector<double>            &local_vector,
 
                 const ConstraintLine &position_j =
                   lines[lines_cache[calculate_line_index(local_dof_indices[j])]];
-                for (unsigned int q=0; q<position_j.entries.size(); ++q)
+                for (size_type q=0; q<position_j.entries.size(); ++q)
                   {
                     Assert (!(!local_lines.size()
                               || local_lines.is_element(position_j.entries[q].first))
@@ -890,7 +912,7 @@ distribute_local_to_global (const Vector<double>            &local_vector,
         // now distribute the constraint,
         // but make sure we don't touch
         // the entries of fixed dofs
-        for (unsigned int j=0; j<position->entries.size(); ++j)
+        for (size_type j=0; j<position->entries.size(); ++j)
           {
             Assert (!(!local_lines.size()
                       || local_lines.is_element(position->entries[j].first))
@@ -921,15 +943,15 @@ ConstraintMatrix::distribute (const VectorType &condensed,
   old_line.reserve (uncondensed.size());
 
   std::vector<ConstraintLine>::const_iterator next_constraint = lines.begin();
-  unsigned int                                shift           = 0;
-  unsigned int n_rows = uncondensed.size();
+  size_type                                   shift           = 0;
+  size_type n_rows = uncondensed.size();
 
   if (next_constraint == lines.end())
     // if no constraint is to be handled
-    for (unsigned int row=0; row!=n_rows; ++row)
+    for (size_type row=0; row!=n_rows; ++row)
       old_line.push_back (row);
   else
-    for (unsigned int row=0; row!=n_rows; ++row)
+    for (size_type row=0; row!=n_rows; ++row)
       if (row == next_constraint->line)
         {
           // this line is constrained
@@ -941,10 +963,10 @@ ConstraintMatrix::distribute (const VectorType &condensed,
             // nothing more to do; finish rest
             // of loop
             {
-              for (unsigned int i=row+1; i<n_rows; ++i)
+              for (size_type i=row+1; i<n_rows; ++i)
                 old_line.push_back (i-shift);
               break;
-            };
+            }
         }
       else
         old_line.push_back (row-shift);
@@ -957,7 +979,7 @@ ConstraintMatrix::distribute (const VectorType &condensed,
   // only evaluated so often as there are
   // entries in new_line[*] which tells us
   // which constraints exist
-  for (unsigned int line=0; line<uncondensed.size(); ++line)
+  for (size_type line=0; line<uncondensed.size(); ++line)
     if (old_line[line] != -1)
       // line was not condensed away
       uncondensed(line) = condensed(old_line[line]);
@@ -969,7 +991,7 @@ ConstraintMatrix::distribute (const VectorType &condensed,
         uncondensed(line) = next_constraint->inhomogeneity;
         // then add the different
         // contributions
-        for (unsigned int i=0; i<next_constraint->entries.size(); ++i)
+        for (size_type i=0; i<next_constraint->entries.size(); ++i)
           uncondensed(line) += (condensed(old_line[next_constraint->entries[i].first]) *
                                 next_constraint->entries[i].second);
         ++next_constraint;
@@ -977,87 +999,183 @@ ConstraintMatrix::distribute (const VectorType &condensed,
 }
 
 
+namespace internal
+{
+  namespace
+  {
+    // create an output vector that consists of the input vector's locally owned
+    // elements plus some ghost elements that need to be imported from elsewhere
+    //
+    // this is an operation that is different for all vector types and so we
+    // need a few overloads
+#ifdef DEAL_II_WITH_TRILINOS
+    void
+    import_vector_with_ghost_elements (const TrilinosWrappers::MPI::Vector &vec,
+                                       const IndexSet                      &/*locally_owned_elements*/,
+                                       const IndexSet                      &needed_elements,
+                                       TrilinosWrappers::MPI::Vector       &output,
+                                       const internal::bool2type<false>     /*is_block_vector*/)
+    {
+      Assert(!vec.has_ghost_elements(),
+             TrilinosWrappers::VectorBase::ExcGhostsPresent());
+#ifdef DEAL_II_WITH_MPI
+      const Epetra_MpiComm *mpi_comm
+        = dynamic_cast<const Epetra_MpiComm *>(&vec.trilinos_vector().Comm());
+
+      Assert (mpi_comm != 0, ExcInternalError());
+      output.reinit (needed_elements, mpi_comm->GetMpiComm());
+#else
+      output.reinit (needed_elements, MPI_COMM_WORLD);
+#endif
+      output = vec;
+    }
+#endif
 
-template<class VectorType>
+#ifdef DEAL_II_WITH_PETSC
+    void
+    import_vector_with_ghost_elements (const PETScWrappers::MPI::Vector &vec,
+                                       const IndexSet                   &locally_owned_elements,
+                                       const IndexSet                   &needed_elements,
+                                       PETScWrappers::MPI::Vector       &output,
+                                       const internal::bool2type<false>  /*is_block_vector*/)
+    {
+      output.reinit (vec.get_mpi_communicator(), locally_owned_elements, needed_elements);
+      output = vec;
+    }
+#endif
+
+    template <typename number>
+    void
+    import_vector_with_ghost_elements (const parallel::distributed::Vector<number> &vec,
+                                       const IndexSet                              &locally_owned_elements,
+                                       const IndexSet                              &needed_elements,
+                                       parallel::distributed::Vector<number>       &output,
+                                       const internal::bool2type<false>             /*is_block_vector*/)
+    {
+      // TODO: the in vector might already have all elements. need to find a
+      // way to efficiently avoid the copy then
+      const_cast<parallel::distributed::Vector<number>&>(vec).zero_out_ghosts();
+      output.reinit (locally_owned_elements, needed_elements, vec.get_mpi_communicator());
+      output = vec;
+      output.update_ghost_values();
+    }
+
+
+    // all other vector non-block vector types are sequential and we should
+    // not have this function called at all -- so throw an exception
+    template <typename Vector>
+    void
+    import_vector_with_ghost_elements (const Vector                     &/*vec*/,
+                                       const IndexSet                   &/*locally_owned_elements*/,
+                                       const IndexSet                   &/*needed_elements*/,
+                                       Vector                           &/*output*/,
+                                       const internal::bool2type<false>  /*is_block_vector*/)
+    {
+      Assert (false, ExcMessage ("We shouldn't even get here!"));
+    }
+
+
+    // for block vectors, simply dispatch to the individual blocks
+    template <class VectorType>
+    void
+    import_vector_with_ghost_elements (const VectorType                &vec,
+                                       const IndexSet                  &locally_owned_elements,
+                                       const IndexSet                  &needed_elements,
+                                       VectorType                      &output,
+                                       const internal::bool2type<true>  /*is_block_vector*/)
+    {
+      output.reinit (vec.n_blocks());
+
+      types::global_dof_index block_start = 0;
+      for (unsigned int b=0; b<vec.n_blocks(); ++b)
+        {
+          import_vector_with_ghost_elements (vec.block(b),
+                                             locally_owned_elements.get_view (block_start, block_start+vec.block(b).size()),
+                                             needed_elements.get_view (block_start, block_start+vec.block(b).size()),
+                                             output.block(b),
+                                             internal::bool2type<false>());
+          block_start += vec.block(b).size();
+        }
+
+      output.collect_sizes ();
+    }
+  }
+}
+
+
+template <class VectorType>
 void
 ConstraintMatrix::distribute (VectorType &vec) const
 {
-  Assert (sorted==true, ExcMatrixIsClosed());
-
-  // if the vector type supports parallel storage and if the
-  // vector actually does it, we need to be a bit more
-  // careful about how we do things
-  if ((vec.supports_distributed_data == true)
-      &&
-      (vec.locally_owned_elements() != complete_index_set(vec.size())))
+  Assert (sorted==true, ExcMatrixNotClosed());
+
+  // if the vector type supports parallel storage and if the vector actually
+  // does store only part of the vector, distributing is slightly more
+  // complicated. we might be able to skip the complicated part if one
+  // processor owns everything and pretend that this is a sequential vector,
+  // but it is difficult for the other processors to know whether they should
+  // not do anything or if other processors will create a temporary vector,
+  // exchange data (requiring communication, maybe even with the processors
+  // that do not own anything because of that particular parallel model), and
+  // call compress() finally. the first case here is for the complicated case,
+  // the last else is for the simple case (sequential vector)
+  const IndexSet vec_owned_elements = vec.locally_owned_elements();
+  if (vec.supports_distributed_data == true)
     {
-      const IndexSet vec_owned_elements = vec.locally_owned_elements();
+      // This processor owns only part of the vector. one may think that
+      // every processor should be able to simply communicate those elements
+      // it owns and for which it knows that they act as sources to constrained
+      // DoFs to the owner of these DoFs. This would lead to a scheme where all
+      // we need to do is to add some local elements to (possibly non-local) ones
+      // and then call compress().
+      //
+      // Alas, this scheme does not work as evidenced by the disaster of bug #51,
+      // see http://code.google.com/p/dealii/issues/detail?id=51 and the
+      // reversion of one attempt that implements this in r29662. Rather, we
+      // need to get a vector that has all the *sources* or constraints we
+      // own locally, possibly as ghost vector elements, then read from them,
+      // and finally throw away the ghosted vector. Implement this in the following.
+      IndexSet needed_elements = vec_owned_elements;
 
       typedef std::vector<ConstraintLine>::const_iterator constraint_iterator;
-
-#ifdef DEBUG
-      {
-        // the algorithm below pushes contributions c_ij x_j to a constrained
-        // DoF x_j *from the side of the owner of x_j*, as opposed to pulling
-        // it from the owner of the target side x_i. this relies on the
-        // assumption that both target and source know about the constraint
-        // on x_i.
-        //
-        // the disadvantage is that it is incredibly difficult to find out what
-        // is happening if the assumption is not satisfied. to help debug
-        // problems of this kind, we do the following in a first step if
-        // debugging is enabled:
-        // - every processor who owns an x_j where c_ij!=0 sends a one
-        //   to the owner of x_i to add up
-        // - the owner of x_i knows how many nonzero entries exist, so can
-        //   verify that the correct number of ones has been added
-        // - if the sum is not correct, then apparently one of the owners
-        //   of the x_j's did not know to send its one and, consequently,
-        //   will also not know to send the correct c_ij*x_j later on,
-        //   leading to a bug
-        set_zero (vec);
-        for (constraint_iterator it = lines.begin();
-            it != lines.end(); ++it)
+      for (constraint_iterator it = lines.begin();
+           it != lines.end(); ++it)
+        if (vec_owned_elements.is_element(it->line))
           for (unsigned int i=0; i<it->entries.size(); ++i)
-            if (vec_owned_elements.is_element (it->entries[i].first))
-              vec(it->line) += 1;
-        vec.compress (VectorOperation::add);
-
-        for (constraint_iterator it = lines.begin();
-            it != lines.end(); ++it)
-          if (vec_owned_elements.is_element(it->line))
-            Assert (vec(it->line) == it->entries.size(),
-                ExcIncorrectConstraint(it->line, it->entries.size()));
-      }
-#endif
+            if (!vec_owned_elements.is_element(it->entries[i].first))
+              needed_elements.add_index(it->entries[i].first);
 
-      // set the values of all constrained DoFs to zero, then add the
-      // contributions for each constrained DoF of all the ones we
-      // own locally
-      set_zero (vec);
+      VectorType ghosted_vector;
+      internal::import_vector_with_ghost_elements (vec,
+                                                   vec_owned_elements, needed_elements,
+                                                   ghosted_vector,
+                                                   internal::bool2type<IsBlockVector<VectorType>::value>());
 
       for (constraint_iterator it = lines.begin();
-          it != lines.end(); ++it)
-        for (unsigned int i=0; i<it->entries.size(); ++i)
-          if (vec_owned_elements.is_element(it->entries[i].first))
-            vec(it->line) += it->entries[i].second *
-                             vec(it->entries[i].first);
-
-      // in a final step, add the inhomogeneities to the elements we
-      // own locally
-      for (constraint_iterator it = lines.begin();
-          it != lines.end(); ++it)
+           it != lines.end(); ++it)
         if (vec_owned_elements.is_element(it->line))
-          vec(it->line) += it->inhomogeneity;
+          {
+            typename VectorType::value_type
+            new_value = it->inhomogeneity;
+            for (unsigned int i=0; i<it->entries.size(); ++i)
+              new_value += (static_cast<typename VectorType::value_type>
+                            (ghosted_vector(it->entries[i].first)) *
+                            it->entries[i].second);
+            Assert(numbers::is_finite(new_value), ExcNumberNotFinite());
+            vec(it->line) = new_value;
+          }
 
       // now compress to communicate the entries that we added to
       // and that weren't to local processors to the owner
-      vec.compress (VectorOperation::add);
+      //
+      // this shouldn't be strictly necessary but it probably doesn't
+      // hurt either
+      vec.compress (VectorOperation::insert);
     }
   else
     // purely sequential vector (either because the type doesn't
     // support anything else or because it's completely stored
-    // locally
+    // locally)
     {
       std::vector<ConstraintLine>::const_iterator next_constraint = lines.begin();
       for (; next_constraint != lines.end(); ++next_constraint)
@@ -1070,7 +1188,7 @@ ConstraintMatrix::distribute (VectorType &vec) const
           for (unsigned int i=0; i<next_constraint->entries.size(); ++i)
             new_value += (static_cast<typename VectorType::value_type>
                           (vec(next_constraint->entries[i].first)) *
-                           next_constraint->entries[i].second);
+                          next_constraint->entries[i].second);
           Assert(numbers::is_finite(new_value), ExcNumberNotFinite());
           vec(next_constraint->line) = new_value;
         }
@@ -1083,6 +1201,8 @@ ConstraintMatrix::distribute (VectorType &vec) const
 // local_to_global functions.
 namespace internals
 {
+  typedef types::global_dof_index size_type;
+
   // this struct contains all the information
   // we need to store about each of the
   // global entries (global_row): are they
@@ -1112,8 +1232,8 @@ namespace internals
   // comes from a constraint.
   struct Distributing
   {
-    Distributing (const unsigned int global_row = numbers::invalid_unsigned_int,
-                  const unsigned int local_row = numbers::invalid_unsigned_int);
+    Distributing (const size_type global_row = numbers::invalid_size_type,
+                  const size_type local_row = numbers::invalid_size_type);
     Distributing (const Distributing &in);
     Distributing &operator = (const Distributing &in);
     bool operator < (const Distributing &in) const
@@ -1121,22 +1241,22 @@ namespace internals
       return global_row<in.global_row;
     };
 
-    unsigned int global_row;
-    unsigned int local_row;
-    mutable unsigned int constraint_position;
+    size_type global_row;
+    size_type local_row;
+    mutable size_type constraint_position;
   };
 
   inline
-  Distributing::Distributing (const unsigned int global_row,
-                              const unsigned int local_row) :
+  Distributing::Distributing (const size_type global_row,
+                              const size_type local_row) :
     global_row (global_row),
     local_row (local_row),
-    constraint_position (numbers::invalid_unsigned_int) {}
+    constraint_position (numbers::invalid_size_type) {}
 
   inline
   Distributing::Distributing (const Distributing &in)
     :
-    constraint_position (numbers::invalid_unsigned_int)
+    constraint_position (numbers::invalid_size_type)
   {
     *this = (in);
   }
@@ -1148,13 +1268,13 @@ namespace internals
     local_row = in.local_row;
     // the constraints pointer should not
     // contain any data here.
-    Assert (constraint_position == numbers::invalid_unsigned_int,
+    Assert (constraint_position == numbers::invalid_size_type,
             ExcInternalError());
 
-    if (in.constraint_position != numbers::invalid_unsigned_int)
+    if (in.constraint_position != numbers::invalid_size_type)
       {
         constraint_position = in.constraint_position;
-        in.constraint_position = numbers::invalid_unsigned_int;
+        in.constraint_position = numbers::invalid_size_type;
       }
     return *this;
   }
@@ -1189,52 +1309,52 @@ namespace internals
     {
       Assert (element_size == 0, ExcInternalError());
       element_size = 6;
-      data = new std::pair<unsigned int,double> [20*6];
+      data = new std::pair<size_type,double> [20*6];
       individual_size.resize(20);
       n_used_elements = 0;
     }
 
-    unsigned int element_size;
+    size_type element_size;
 
-    std::pair<unsigned int,double> *data;
+    std::pair<size_type,double> *data;
 
-    std::vector<unsigned int> individual_size;
+    std::vector<size_type> individual_size;
 
-    unsigned int n_used_elements;
+    size_type n_used_elements;
 
-    unsigned int insert_new_index (const std::pair<unsigned int,double> &pair)
+    size_type insert_new_index (const std::pair<size_type,double> &pair)
     {
       if (element_size == 0)
         reinit();
       if (n_used_elements == individual_size.size())
         {
-          std::pair<unsigned int,double> *new_data =
-            new std::pair<unsigned int,double> [2*individual_size.size()*element_size];
+          std::pair<size_type,double> *new_data =
+            new std::pair<size_type,double> [2*individual_size.size()*element_size];
           memcpy (new_data, data, individual_size.size()*element_size*
-                  sizeof(std::pair<unsigned int,double>));
+                  sizeof(std::pair<size_type,double>));
           delete [] data;
           data = new_data;
           individual_size.resize (2*individual_size.size(), 0);
         }
-      unsigned int index = n_used_elements;
+      size_type index = n_used_elements;
       data[index*element_size] = pair;
       individual_size[index] = 1;
       ++n_used_elements;
       return index;
     }
 
-    void append_index (const unsigned int index,
-                       const std::pair<unsigned int,double> &pair)
+    void append_index (const size_type index,
+                       const std::pair<size_type,double> &pair)
     {
       AssertIndexRange (index, n_used_elements);
-      const unsigned int my_size = individual_size[index];
+      const size_type my_size = individual_size[index];
       if (my_size == element_size)
         {
-          std::pair<unsigned int,double> *new_data =
-            new std::pair<unsigned int,double> [2*individual_size.size()*element_size];
-          for (unsigned int i=0; i<n_used_elements; ++i)
+          std::pair<size_type,double> *new_data =
+            new std::pair<size_type,double> [2*individual_size.size()*element_size];
+          for (size_type i=0; i<n_used_elements; ++i)
             memcpy (&new_data[i*element_size*2], &data[i*element_size],
-                    element_size*sizeof(std::pair<unsigned int,double>));
+                    element_size*sizeof(std::pair<size_type,double>));
           delete [] data;
           data = new_data;
           element_size *= 2;
@@ -1243,14 +1363,14 @@ namespace internals
       individual_size[index]++;
     }
 
-    unsigned int
-    get_size (const unsigned int index) const
+    size_type
+    get_size (const size_type index) const
     {
       return individual_size[index];
     }
 
-    const std::pair<unsigned int,double> *
-    get_entry (const unsigned int index) const
+    const std::pair<size_type,double> *
+    get_entry (const size_type index) const
     {
       return &data[index*element_size];
     }
@@ -1299,7 +1419,7 @@ namespace internals
   class GlobalRowsFromLocal
   {
   public:
-    GlobalRowsFromLocal (const unsigned int n_local_rows)
+    GlobalRowsFromLocal (const size_type n_local_rows)
       :
       total_row_indices (n_local_rows),
       n_active_rows (n_local_rows),
@@ -1308,8 +1428,8 @@ namespace internals
 
 
     // implemented below
-    void insert_index (const unsigned int global_row,
-                       const unsigned int local_row,
+    void insert_index (const size_type global_row,
+                       const size_type local_row,
                        const double       constraint_value);
     void sort ();
 
@@ -1321,15 +1441,15 @@ namespace internals
          << "Constr rows " << n_constraints() << std::endl
          << "Inhom  rows " << n_inhomogeneous_rows << std::endl
          << "Local: ";
-      for (unsigned int i=0 ; i<total_row_indices.size() ; ++i)
+      for (size_type i=0 ; i<total_row_indices.size() ; ++i)
         os << ' ' << std::setw(4) << total_row_indices[i].local_row;
       os << std::endl
          << "Global:";
-      for (unsigned int i=0 ; i<total_row_indices.size() ; ++i)
+      for (size_type i=0 ; i<total_row_indices.size() ; ++i)
         os << ' ' << std::setw(4) << total_row_indices[i].global_row;
       os << std::endl
          << "ConPos:";
-      for (unsigned int i=0 ; i<total_row_indices.size() ; ++i)
+      for (size_type i=0 ; i<total_row_indices.size() ; ++i)
         os << ' ' << std::setw(4) << total_row_indices[i].constraint_position;
       os << std::endl;
     }
@@ -1340,14 +1460,14 @@ namespace internals
 
     // returns the number of global indices in the
     // struct
-    unsigned int size () const
+    size_type size () const
     {
       return n_active_rows;
     }
 
     // returns the global index of the
     // counter_index-th entry in the list
-    unsigned int &global_row (const unsigned int counter_index)
+    size_type &global_row (const size_type counter_index)
     {
       return total_row_indices[counter_index].global_row;
     }
@@ -1355,10 +1475,10 @@ namespace internals
     // returns the number of constraints that are
     // associated to the counter_index-th entry in
     // the list
-    unsigned int size (const unsigned int counter_index) const
+    size_type size (const size_type counter_index) const
     {
       return (total_row_indices[counter_index].constraint_position ==
-              numbers::invalid_unsigned_int ?
+              numbers::invalid_size_type ?
               0 :
               data_cache.get_size(total_row_indices[counter_index].
                                   constraint_position));
@@ -1366,22 +1486,22 @@ namespace internals
 
     // returns the global row associated with the
     // counter_index-th entry in the list
-    const unsigned int &global_row (const unsigned int counter_index) const
+    const size_type &global_row (const size_type counter_index) const
     {
       return total_row_indices[counter_index].global_row;
     }
 
     // returns the local row in the cell matrix
     // associated with the counter_index-th entry
-    // in the list. Returns invalid_unsigned_int
-    // for invalid unsigned ints
-    const unsigned int &local_row (const unsigned int counter_index) const
+    // in the list. Returns invalid_size_type
+    // for invalid size_types
+    const size_type &local_row (const size_type counter_index) const
     {
       return total_row_indices[counter_index].local_row;
     }
 
     // writable index
-    unsigned int &local_row (const unsigned int counter_index)
+    size_type &local_row (const size_type counter_index)
     {
       return total_row_indices[counter_index].local_row;
     }
@@ -1390,8 +1510,8 @@ namespace internals
     // associated with the counter_index-th entry
     // in the list in the index_in_constraint-th
     // position of constraints
-    unsigned int local_row (const unsigned int counter_index,
-                            const unsigned int index_in_constraint) const
+    size_type local_row (const size_type counter_index,
+                         const size_type index_in_constraint) const
     {
       return (data_cache.get_entry(total_row_indices[counter_index].constraint_position)
               [index_in_constraint]).first;
@@ -1401,8 +1521,8 @@ namespace internals
     // counter_index-th entry in the list in the
     // index_in_constraint-th position of
     // constraints
-    double constraint_value (const unsigned int counter_index,
-                             const unsigned int index_in_constraint) const
+    double constraint_value (const size_type counter_index,
+                             const size_type index_in_constraint) const
     {
       return (data_cache.get_entry(total_row_indices[counter_index].constraint_position)
               [index_in_constraint]).second;
@@ -1421,7 +1541,7 @@ namespace internals
     // constrained. This means that
     // there is one less nontrivial
     // row
-    void insert_constraint (const unsigned int constrained_local_dof)
+    void insert_constraint (const size_type constrained_local_dof)
     {
       --n_active_rows;
       total_row_indices[n_active_rows].local_row = constrained_local_dof;
@@ -1433,7 +1553,7 @@ namespace internals
     // the matrix, but are needed in order
     // to set matrix diagonals and resolve
     // inhomogeneities
-    unsigned int n_constraints () const
+    size_type n_constraints () const
     {
       return total_row_indices.size()-n_active_rows;
     }
@@ -1441,7 +1561,7 @@ namespace internals
     // returns the number of constrained
     // dofs in the structure that have an
     // inhomogeneity
-    unsigned int n_inhomogeneities () const
+    size_type n_inhomogeneities () const
     {
       return n_inhomogeneous_rows;
     }
@@ -1453,7 +1573,7 @@ namespace internals
     // sides, so to have fast access to
     // them, put them before homogeneous
     // constraints
-    void set_ith_constraint_inhomogeneous (const unsigned int i)
+    void set_ith_constraint_inhomogeneous (const size_type i)
     {
       Assert (i >= n_inhomogeneous_rows, ExcInternalError());
       std::swap (total_row_indices[n_active_rows+i],
@@ -1467,7 +1587,7 @@ namespace internals
     // easily when the
     // GlobalRowsToLocal has been
     // set up
-    unsigned int constraint_origin (unsigned int i) const
+    size_type constraint_origin (size_type i) const
     {
       return total_row_indices[n_active_rows+i].local_row;
     }
@@ -1486,35 +1606,35 @@ namespace internals
 
     // how many rows there are,
     // constraints disregarded
-    unsigned int              n_active_rows;
+    size_type                 n_active_rows;
 
     // the number of rows with
     // inhomogeneous constraints
-    unsigned int              n_inhomogeneous_rows;
+    size_type                 n_inhomogeneous_rows;
   };
 
   // a function that appends an additional
   // row to the list of values, or appends a
   // value to an already existing
   // row. Similar functionality as for
-  // std::map<unsigned int,Distributing>, but
+  // std::map<size_type,Distributing>, but
   // here done for a
   // std::vector<Distributing>, much faster
   // for short lists as we have them here
   inline
   void
-  GlobalRowsFromLocal::insert_index (const unsigned int global_row,
-                                     const unsigned int local_row,
-                                     const double       constraint_value)
+  GlobalRowsFromLocal::insert_index (const size_type global_row,
+                                     const size_type local_row,
+                                     const double    constraint_value)
   {
     typedef std::vector<Distributing>::iterator index_iterator;
     index_iterator pos, pos1;
     Distributing row_value (global_row);
-    std::pair<unsigned int,double> constraint (local_row, constraint_value);
+    std::pair<size_type,double> constraint (local_row, constraint_value);
 
     // check whether the list was really
     // sorted before entering here
-    for (unsigned int i=1; i<n_active_rows; ++i)
+    for (size_type i=1; i<n_active_rows; ++i)
       Assert (total_row_indices[i-1] < total_row_indices[i], ExcInternalError());
 
     pos = Utilities::lower_bound (total_row_indices.begin(),
@@ -1528,7 +1648,7 @@ namespace internals
         ++n_active_rows;
       }
 
-    if (pos1->constraint_position == numbers::invalid_unsigned_int)
+    if (pos1->constraint_position == numbers::invalid_size_type)
       pos1->constraint_position = data_cache.insert_new_index (constraint);
     else
       data_cache.append_index (pos1->constraint_position, constraint);
@@ -1548,19 +1668,19 @@ namespace internals
   void
   GlobalRowsFromLocal::sort ()
   {
-    unsigned int i, j, j2, temp, templ, istep;
-    unsigned int step;
+    size_type i, j, j2, temp, templ, istep;
+    size_type step;
 
     // check whether the
     // constraints are really empty.
-    const unsigned int length = size();
+    const size_type length = size();
 
     // make sure that we are in the
     // range of the vector
     AssertIndexRange (length, total_row_indices.size()+1);
-    for (unsigned int i=0; i<length; ++i)
+    for (size_type i=0; i<length; ++i)
       Assert (total_row_indices[i].constraint_position ==
-              numbers::invalid_unsigned_int,
+              numbers::invalid_size_type,
               ExcInternalError());
 
     step = length/2;
@@ -1603,21 +1723,21 @@ namespace internals
   template <class BlockType>
   inline
   void
-  make_block_starts (const BlockType           &block_object,
-                     GlobalRowsFromLocal       &global_rows,
-                     std::vector<unsigned int> &block_starts)
+  make_block_starts (const BlockType        &block_object,
+                     GlobalRowsFromLocal    &global_rows,
+                     std::vector<size_type> &block_starts)
   {
     AssertDimension (block_starts.size(), block_object.n_block_rows()+1);
 
     typedef std::vector<Distributing>::iterator row_iterator;
     row_iterator block_indices = global_rows.total_row_indices.begin();
 
-    const unsigned int num_blocks = block_object.n_block_rows();
-    const unsigned int n_active_rows = global_rows.size();
+    const size_type num_blocks = block_object.n_block_rows();
+    const size_type n_active_rows = global_rows.size();
 
     // find end of rows.
     block_starts[0] = 0;
-    for (unsigned int i=1; i<num_blocks; ++i)
+    for (size_type i=1; i<num_blocks; ++i)
       {
         row_iterator first_block =
           Utilities::lower_bound (block_indices,
@@ -1629,7 +1749,7 @@ namespace internals
 
     // transform row indices to block-local
     // index space
-    for (unsigned int i=block_starts[1]; i<n_active_rows; ++i)
+    for (size_type i=block_starts[1]; i<n_active_rows; ++i)
       global_rows.global_row(i) = block_object.get_row_indices().
                                   global_to_local(global_rows.global_row(i)).second;
   }
@@ -1643,20 +1763,20 @@ namespace internals
   template <class BlockType>
   inline
   void
-  make_block_starts (const BlockType           &block_object,
-                     std::vector<unsigned int> &row_indices,
-                     std::vector<unsigned int> &block_starts)
+  make_block_starts (const BlockType        &block_object,
+                     std::vector<size_type> &row_indices,
+                     std::vector<size_type> &block_starts)
   {
     AssertDimension (block_starts.size(), block_object.n_block_rows()+1);
 
-    typedef std::vector<unsigned int>::iterator row_iterator;
+    typedef std::vector<size_type>::iterator row_iterator;
     row_iterator col_indices = row_indices.begin();
 
-    const unsigned int num_blocks = block_object.n_block_rows();
+    const size_type num_blocks = block_object.n_block_rows();
 
     // find end of rows.
     block_starts[0] = 0;
-    for (unsigned int i=1; i<num_blocks; ++i)
+    for (size_type i=1; i<num_blocks; ++i)
       {
         row_iterator first_block =
           Utilities::lower_bound (col_indices,
@@ -1668,7 +1788,7 @@ namespace internals
 
     // transform row indices to local index
     // space
-    for (unsigned int i=block_starts[1]; i<row_indices.size(); ++i)
+    for (size_type i=block_starts[1]; i<row_indices.size(); ++i)
       row_indices[i] = block_object.get_row_indices().
                        global_to_local(row_indices[i]).second;
   }
@@ -1682,26 +1802,26 @@ namespace internals
   static inline
   double resolve_matrix_entry (const GlobalRowsFromLocal &global_rows,
                                const GlobalRowsFromLocal &global_cols,
-                               const unsigned int        i,
-                               const unsigned int        j,
-                               const unsigned int        loc_row,
+                               const size_type            i,
+                               const size_type            j,
+                               const size_type            loc_row,
                                const FullMatrix<double> &local_matrix)
   {
-    const unsigned int loc_col = global_cols.local_row(j);
+    const size_type loc_col = global_cols.local_row(j);
     double col_val;
 
     // case 1: row has direct contribution in
     // local matrix. decide whether col has a
     // direct contribution. if not,
     // set the value to zero.
-    if (loc_row != numbers::invalid_unsigned_int)
+    if (loc_row != numbers::invalid_size_type)
       {
-        col_val = ((loc_col != numbers::invalid_unsigned_int) ?
+        col_val = ((loc_col != numbers::invalid_size_type) ?
                    local_matrix(loc_row, loc_col) : 0);
 
         // account for indirect contributions by
         // constraints in column
-        for (unsigned int p=0; p<global_cols.size(j); ++p)
+        for (size_type p=0; p<global_cols.size(j); ++p)
           col_val += (local_matrix(loc_row, global_cols.local_row(j,p)) *
                       global_cols.constraint_value(j,p));
       }
@@ -1715,12 +1835,12 @@ namespace internals
     // constraints in row, going trough the
     // direct and indirect references in the
     // given column.
-    for (unsigned int q=0; q<global_rows.size(i); ++q)
+    for (size_type q=0; q<global_rows.size(i); ++q)
       {
-        double add_this = (loc_col != numbers::invalid_unsigned_int)
+        double add_this = (loc_col != numbers::invalid_size_type)
                           ? local_matrix(global_rows.local_row(i,q), loc_col) : 0;
 
-        for (unsigned int p=0; p<global_cols.size(j); ++p)
+        for (size_type p=0; p<global_cols.size(j); ++p)
           add_this += (local_matrix(global_rows.local_row(i,q),
                                     global_cols.local_row(j,p))
                        *
@@ -1741,18 +1861,18 @@ namespace internals
   void
   resolve_matrix_row (const GlobalRowsFromLocal &global_rows,
                       const GlobalRowsFromLocal &global_cols,
-                      const unsigned int        i,
-                      const unsigned int        column_start,
-                      const unsigned int        column_end,
-                      const FullMatrix<double> &local_matrix,
-                      unsigned int *&col_ptr,
-                      number *&val_ptr)
+                      const size_type            i,
+                      const size_type            column_start,
+                      const size_type            column_end,
+                      const FullMatrix<double>  &local_matrix,
+                      size_type                *&col_ptr,
+                      number                   *&val_ptr)
   {
     if (column_end == column_start)
       return;
 
     AssertIndexRange (column_end-1, global_cols.size());
-    const unsigned int loc_row = global_rows.local_row(i);
+    const size_type loc_row = global_rows.local_row(i);
 
     // fast function if there are no indirect
     // references to any of the local rows at
@@ -1766,9 +1886,9 @@ namespace internals
         AssertIndexRange(loc_row, local_matrix.m());
         const double *matrix_ptr = &local_matrix(loc_row, 0);
 
-        for (unsigned int j=column_start; j<column_end; ++j)
+        for (size_type j=column_start; j<column_end; ++j)
           {
-            const unsigned int loc_col = global_cols.local_row(j);
+            const size_type loc_col = global_cols.local_row(j);
             AssertIndexRange(loc_col, local_matrix.n());
             const double col_val = matrix_ptr[loc_col];
             if (col_val != 0.)
@@ -1784,7 +1904,7 @@ namespace internals
     // to do some more checks.
     else
       {
-        for (unsigned int j=column_start; j<column_end; ++j)
+        for (size_type j=column_start; j<column_end; ++j)
           {
             double col_val = resolve_matrix_entry (global_rows, global_cols, i, j,
                                                    loc_row, local_matrix);
@@ -1809,8 +1929,8 @@ namespace internals
     template <typename SparseMatrixIterator>
     static inline
     void add_value (const double          value,
-                    const unsigned int    row,
-                    const unsigned int    column,
+                    const size_type       row,
+                    const size_type       column,
                     SparseMatrixIterator &matrix_values)
     {
       if (value != 0.)
@@ -1834,11 +1954,11 @@ namespace internals
   inline
   void
   resolve_matrix_row (const GlobalRowsFromLocal &global_rows,
-                      const unsigned int        i,
-                      const unsigned int        column_start,
-                      const unsigned int        column_end,
-                      const FullMatrix<double> &local_matrix,
-                      SparseMatrix<number>     *sparse_matrix)
+                      const size_type            i,
+                      const size_type            column_start,
+                      const size_type            column_end,
+                      const FullMatrix<double>  &local_matrix,
+                      SparseMatrix<number>      *sparse_matrix)
   {
     if (column_end == column_start)
       return;
@@ -1849,11 +1969,11 @@ namespace internals
     if (sparsity.n_nonzero_elements() == 0)
       return;
 
-    const unsigned int row = global_rows.global_row(i);
-    const unsigned int loc_row = global_rows.local_row(i);
+    const size_type row = global_rows.global_row(i);
+    const size_type loc_row = global_rows.local_row(i);
 
     typename SparseMatrix<number>::iterator
-      matrix_values = sparse_matrix->begin(row);
+    matrix_values = sparse_matrix->begin(row);
     const bool optimize_diagonal = sparsity.n_rows() == sparsity.n_cols();
 
     // distinguish three cases about what can
@@ -1869,9 +1989,9 @@ namespace internals
             AssertIndexRange (loc_row, local_matrix.m());
             const double *matrix_ptr = &local_matrix(loc_row, 0);
 
-            for (unsigned int j=column_start; j<column_end; ++j)
+            for (size_type j=column_start; j<column_end; ++j)
               {
-                const unsigned int loc_col = global_rows.local_row(j);
+                const size_type loc_col = global_rows.local_row(j);
                 const double col_val = matrix_ptr[loc_col];
                 dealiiSparseMatrix::add_value (col_val, row,
                                                global_rows.global_row(j),
@@ -1880,7 +2000,7 @@ namespace internals
           }
         else
           {
-            for (unsigned int j=column_start; j<column_end; ++j)
+            for (size_type j=column_start; j<column_end; ++j)
               {
                 double col_val = resolve_matrix_entry (global_rows, global_rows, i, j,
                                                        loc_row, local_matrix);
@@ -1899,17 +2019,17 @@ namespace internals
             const double *matrix_ptr = &local_matrix(loc_row, 0);
 
             sparse_matrix->begin(row)->value() += matrix_ptr[loc_row];
-            for (unsigned int j=column_start; j<i; ++j)
+            for (size_type j=column_start; j<i; ++j)
               {
-                const unsigned int loc_col = global_rows.local_row(j);
+                const size_type loc_col = global_rows.local_row(j);
                 const double col_val = matrix_ptr[loc_col];
                 dealiiSparseMatrix::add_value(col_val, row,
                                               global_rows.global_row(j),
                                               matrix_values);
               }
-            for (unsigned int j=i+1; j<column_end; ++j)
+            for (size_type j=i+1; j<column_end; ++j)
               {
-                const unsigned int loc_col = global_rows.local_row(j);
+                const size_type loc_col = global_rows.local_row(j);
                 const double col_val = matrix_ptr[loc_col];
                 dealiiSparseMatrix::add_value(col_val, row,
                                               global_rows.global_row(j),
@@ -1921,7 +2041,7 @@ namespace internals
             sparse_matrix->begin(row)->value() +=
               resolve_matrix_entry (global_rows, global_rows, i, i,
                                     loc_row, local_matrix);
-            for (unsigned int j=column_start; j<i; ++j)
+            for (size_type j=column_start; j<i; ++j)
               {
                 double col_val = resolve_matrix_entry (global_rows, global_rows, i, j,
                                                        loc_row, local_matrix);
@@ -1929,7 +2049,7 @@ namespace internals
                                                global_rows.global_row(j),
                                                matrix_values);
               }
-            for (unsigned int j=i+1; j<column_end; ++j)
+            for (size_type j=i+1; j<column_end; ++j)
               {
                 double col_val = resolve_matrix_entry (global_rows, global_rows, i, j,
                                                        loc_row, local_matrix);
@@ -1947,9 +2067,9 @@ namespace internals
         AssertIndexRange (loc_row, local_matrix.m());
         const double *matrix_ptr = &local_matrix(loc_row, 0);
 
-        for (unsigned int j=column_start; j<column_end; ++j)
+        for (size_type j=column_start; j<column_end; ++j)
           {
-            const unsigned int loc_col = global_rows.local_row(j);
+            const size_type loc_col = global_rows.local_row(j);
             const double col_val = matrix_ptr[loc_col];
             if (row==global_rows.global_row(j))
               sparse_matrix->begin(row)->value() += col_val;
@@ -1962,7 +2082,7 @@ namespace internals
     else
       {
         ++matrix_values; // jump over diagonal element
-        for (unsigned int j=column_start; j<column_end; ++j)
+        for (size_type j=column_start; j<column_end; ++j)
           {
             double col_val = resolve_matrix_entry (global_rows, global_rows, i,
                                                    j, loc_row, local_matrix);
@@ -1985,16 +2105,16 @@ namespace internals
   inline
   void
   resolve_matrix_row (const GlobalRowsFromLocal     &global_rows,
-                      const unsigned int             i,
-                      const unsigned int             column_start,
-                      const unsigned int             column_end,
+                      const size_type                i,
+                      const size_type                column_start,
+                      const size_type                column_end,
                       const Table<2,bool>           &dof_mask,
-                      std::vector<unsigned int>::iterator &col_ptr)
+                      std::vector<size_type>::iterator &col_ptr)
   {
     if (column_end == column_start)
       return;
 
-    const unsigned int loc_row = global_rows.local_row(i);
+    const size_type loc_row = global_rows.local_row(i);
 
     // fast function if there are no indirect
     // references to any of the local rows at
@@ -2004,9 +2124,9 @@ namespace internals
         Assert(loc_row < dof_mask.n_rows(),
                ExcInternalError());
 
-        for (unsigned int j=column_start; j<column_end; ++j)
+        for (size_type j=column_start; j<column_end; ++j)
           {
-            const unsigned int loc_col = global_rows.local_row(j);
+            const size_type loc_col = global_rows.local_row(j);
             Assert(loc_col < dof_mask.n_cols(), ExcInternalError());
 
             if (dof_mask(loc_row,loc_col) == true)
@@ -2019,34 +2139,34 @@ namespace internals
     // to do some more checks.
     else
       {
-        for (unsigned int j=column_start; j<column_end; ++j)
+        for (size_type j=column_start; j<column_end; ++j)
           {
-            const unsigned int loc_col = global_rows.local_row(j);
-            if (loc_row != numbers::invalid_unsigned_int)
+            const size_type loc_col = global_rows.local_row(j);
+            if (loc_row != numbers::invalid_size_type)
               {
                 Assert (loc_row < dof_mask.n_rows(), ExcInternalError());
-                if (loc_col != numbers::invalid_unsigned_int)
+                if (loc_col != numbers::invalid_size_type)
                   {
                     Assert (loc_col < dof_mask.n_cols(), ExcInternalError());
                     if (dof_mask(loc_row,loc_col) == true)
                       goto add_this_index;
                   }
 
-                for (unsigned int p=0; p<global_rows.size(j); ++p)
+                for (size_type p=0; p<global_rows.size(j); ++p)
                   if (dof_mask(loc_row,global_rows.local_row(j,p)) == true)
                     goto add_this_index;
               }
 
-            for (unsigned int q=0; q<global_rows.size(i); ++q)
+            for (size_type q=0; q<global_rows.size(i); ++q)
               {
-                if (loc_col != numbers::invalid_unsigned_int)
+                if (loc_col != numbers::invalid_size_type)
                   {
                     Assert (loc_col < dof_mask.n_cols(), ExcInternalError());
                     if (dof_mask(global_rows.local_row(i,q),loc_col) == true)
                       goto add_this_index;
                   }
 
-                for (unsigned int p=0; p<global_rows.size(j); ++p)
+                for (size_type p=0; p<global_rows.size(j); ++p)
                   if (dof_mask(global_rows.local_row(i,q),
                                global_rows.local_row(j,p)) == true)
                     goto add_this_index;
@@ -2093,7 +2213,7 @@ add_this_index:
   template <typename MatrixType, typename VectorType>
   inline void
   set_matrix_diagonals (const internals::GlobalRowsFromLocal &global_rows,
-                        const std::vector<unsigned int>      &local_dof_indices,
+                        const std::vector<size_type>         &local_dof_indices,
                         const FullMatrix<double>             &local_matrix,
                         const ConstraintMatrix               &constraints,
                         MatrixType                           &global_matrix,
@@ -2103,14 +2223,14 @@ add_this_index:
     if (global_rows.n_constraints() > 0)
       {
         double average_diagonal = 0;
-        for (unsigned int i=0; i<local_matrix.m(); ++i)
+        for (size_type i=0; i<local_matrix.m(); ++i)
           average_diagonal += std::fabs (local_matrix(i,i));
         average_diagonal /= static_cast<double>(local_matrix.m());
 
-        for (unsigned int i=0; i<global_rows.n_constraints(); i++)
+        for (size_type i=0; i<global_rows.n_constraints(); i++)
           {
-            const unsigned int local_row = global_rows.constraint_origin(i);
-            const unsigned int global_row = local_dof_indices[local_row];
+            const size_type local_row = global_rows.constraint_origin(i);
+            const size_type global_row = local_dof_indices[local_row];
             const typename MatrixType::value_type new_diagonal
               = (std::fabs(local_matrix(local_row,local_row)) != 0 ?
                  std::fabs(local_matrix(local_row,local_row)) : average_diagonal);
@@ -2141,7 +2261,7 @@ add_this_index:
   template <typename SparsityType>
   inline void
   set_sparsity_diagonals (const internals::GlobalRowsFromLocal &global_rows,
-                          const std::vector<unsigned int>      &local_dof_indices,
+                          const std::vector<size_type>      &local_dof_indices,
                           const Table<2,bool>                  &dof_mask,
                           const bool                            keep_constrained_entries,
                           SparsityType                         &sparsity_pattern)
@@ -2153,13 +2273,13 @@ add_this_index:
     // that have been left out above
     if (global_rows.n_constraints() > 0)
       {
-        for (unsigned int i=0; i<global_rows.n_constraints(); i++)
+        for (size_type i=0; i<global_rows.n_constraints(); i++)
           {
-            const unsigned int local_row = global_rows.constraint_origin(i);
-            const unsigned int global_row = local_dof_indices[local_row];
+            const size_type local_row = global_rows.constraint_origin(i);
+            const size_type global_row = local_dof_indices[local_row];
             if (keep_constrained_entries == true)
               {
-                for (unsigned int j=0; j<local_dof_indices.size(); ++j)
+                for (size_type j=0; j<local_dof_indices.size(); ++j)
                   {
                     if (dof_mask(local_row,j) == true)
                       sparsity_pattern.add(global_row,
@@ -2189,10 +2309,10 @@ add_this_index:
 // are related to it.
 void
 ConstraintMatrix::
-make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
+make_sorted_row_list (const std::vector<size_type> &local_dof_indices,
                       internals::GlobalRowsFromLocal  &global_rows) const
 {
-  const unsigned int n_local_dofs = local_dof_indices.size();
+  const size_type n_local_dofs = local_dof_indices.size();
   AssertDimension (n_local_dofs, global_rows.size());
 
   // when distributing the local data to
@@ -2225,13 +2345,13 @@ make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
   // cache whether we have to resolve any
   // indirect rows generated from resolving
   // constrained dofs.
-  unsigned int added_rows = 0;
+  size_type added_rows = 0;
 
   // first add the indices in an unsorted
   // way and only keep track of the
   // constraints that appear. They are
   // resolved in a second step.
-  for (unsigned int i = 0; i<n_local_dofs; ++i)
+  for (size_type i = 0; i<n_local_dofs; ++i)
     {
       if (is_constrained(local_dof_indices[i]) == false)
         {
@@ -2243,18 +2363,18 @@ make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
     }
   global_rows.sort();
 
-  const unsigned int n_constrained_rows = n_local_dofs-added_rows;
-  for (unsigned int i=0; i<n_constrained_rows; ++i)
+  const size_type n_constrained_rows = n_local_dofs-added_rows;
+  for (size_type i=0; i<n_constrained_rows; ++i)
     {
-      const unsigned int local_row = global_rows.constraint_origin(i);
+      const size_type local_row = global_rows.constraint_origin(i);
       AssertIndexRange(local_row, n_local_dofs);
-      const unsigned int global_row = local_dof_indices[local_row];
+      const size_type global_row = local_dof_indices[local_row];
       Assert (is_constrained(global_row), ExcInternalError());
       const ConstraintLine &position =
         lines[lines_cache[calculate_line_index(global_row)]];
       if (position.inhomogeneity != 0)
         global_rows.set_ith_constraint_inhomogeneous (i);
-      for (unsigned int q=0; q<position.entries.size(); ++q)
+      for (size_type q=0; q<position.entries.size(); ++q)
         global_rows.insert_index (position.entries[q].first,
                                   local_row,
                                   position.entries[q].second);
@@ -2271,12 +2391,12 @@ make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
 inline
 void
 ConstraintMatrix::
-make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
-                      std::vector<unsigned int>       &active_dofs) const
+make_sorted_row_list (const std::vector<size_type> &local_dof_indices,
+                      std::vector<size_type>       &active_dofs) const
 {
-  const unsigned int n_local_dofs = local_dof_indices.size();
-  unsigned int added_rows = 0;
-  for (unsigned int i = 0; i<n_local_dofs; ++i)
+  const size_type n_local_dofs = local_dof_indices.size();
+  size_type added_rows = 0;
+  for (size_type i = 0; i<n_local_dofs; ++i)
     {
       if (is_constrained(local_dof_indices[i]) == false)
         {
@@ -2288,20 +2408,20 @@ make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
     }
   std::sort (active_dofs.begin(), active_dofs.begin()+added_rows);
 
-  const unsigned int n_constrained_dofs = n_local_dofs-added_rows;
-  for (unsigned int i=n_constrained_dofs; i>0; --i)
+  const size_type n_constrained_dofs = n_local_dofs-added_rows;
+  for (size_type i=n_constrained_dofs; i>0; --i)
     {
-      const unsigned int local_row = active_dofs.back();
+      const size_type local_row = active_dofs.back();
 
       // remove constrained entry since we
       // are going to resolve it in place
       active_dofs.pop_back();
-      const unsigned int global_row = local_dof_indices[local_row];
+      const size_type global_row = local_dof_indices[local_row];
       const ConstraintLine &position =
         lines[lines_cache[calculate_line_index(global_row)]];
-      for (unsigned int q=0; q<position.entries.size(); ++q)
+      for (size_type q=0; q<position.entries.size(); ++q)
         {
-          const unsigned int new_index = position.entries[q].first;
+          const size_type new_index = position.entries[q].first;
           if (active_dofs[active_dofs.size()-i] < new_index)
             active_dofs.insert(active_dofs.end()-i+1,new_index);
 
@@ -2310,7 +2430,7 @@ make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
           // the list sorted
           else
             {
-              std::vector<unsigned int>::iterator it =
+              std::vector<size_type>::iterator it =
                 Utilities::lower_bound(active_dofs.begin(),
                                        active_dofs.end()-i+1,
                                        new_index);
@@ -2328,23 +2448,23 @@ make_sorted_row_list (const std::vector<unsigned int> &local_dof_indices,
 inline
 double
 ConstraintMatrix::
-resolve_vector_entry (const unsigned int                    i,
+resolve_vector_entry (const size_type                       i,
                       const internals::GlobalRowsFromLocal &global_rows,
                       const Vector<double>                 &local_vector,
-                      const std::vector<unsigned int>      &local_dof_indices,
+                      const std::vector<size_type>         &local_dof_indices,
                       const FullMatrix<double>             &local_matrix) const
 {
-  const unsigned int loc_row = global_rows.local_row(i);
-  const unsigned int n_inhomogeneous_rows = global_rows.n_inhomogeneities();
+  const size_type loc_row = global_rows.local_row(i);
+  const size_type n_inhomogeneous_rows = global_rows.n_inhomogeneities();
   double val = 0;
   // has a direct contribution from some local
   // entry. If we have inhomogeneous
   // constraints, compute the contribution of
   // the inhomogeneity in the current row.
-  if (loc_row != numbers::invalid_unsigned_int)
+  if (loc_row != numbers::invalid_size_type)
     {
       val = local_vector(loc_row);
-      for (unsigned int i=0; i<n_inhomogeneous_rows; ++i)
+      for (size_type i=0; i<n_inhomogeneous_rows; ++i)
         val -= (lines[lines_cache[calculate_line_index(local_dof_indices
                                                        [global_rows.constraint_origin(i)])]].
                 inhomogeneity *
@@ -2352,11 +2472,11 @@ resolve_vector_entry (const unsigned int                    i,
     }
 
   // go through the indirect contributions
-  for (unsigned int q=0; q<global_rows.size(i); ++q)
+  for (size_type q=0; q<global_rows.size(i); ++q)
     {
-      const unsigned int loc_row_q = global_rows.local_row(i,q);
+      const size_type loc_row_q = global_rows.local_row(i,q);
       double add_this = local_vector (loc_row_q);
-      for (unsigned int k=0; k<n_inhomogeneous_rows; ++k)
+      for (size_type k=0; k<n_inhomogeneous_rows; ++k)
         add_this -= (lines[lines_cache[calculate_line_index
                                        (local_dof_indices
                                         [global_rows.constraint_origin(k)])]].
@@ -2376,7 +2496,7 @@ void
 ConstraintMatrix::distribute_local_to_global (
   const FullMatrix<double>        &local_matrix,
   const Vector<double>            &local_vector,
-  const std::vector<unsigned int> &local_dof_indices,
+  const std::vector<size_type>    &local_dof_indices,
   MatrixType                      &global_matrix,
   VectorType                      &global_vector,
   bool                            use_inhomogeneities_for_rhs,
@@ -2401,18 +2521,18 @@ ConstraintMatrix::distribute_local_to_global (
     }
   Assert (lines.empty() || sorted == true, ExcMatrixNotClosed());
 
-  const unsigned int n_local_dofs = local_dof_indices.size();
+  const size_type n_local_dofs = local_dof_indices.size();
   internals::GlobalRowsFromLocal global_rows (n_local_dofs);
   make_sorted_row_list (local_dof_indices, global_rows);
 
-  const unsigned int n_actual_dofs = global_rows.size();
+  const size_type n_actual_dofs = global_rows.size();
 
   // create arrays for the column data
   // (indices and values) that will then be
   // written into the matrix. Shortcut for
   // deal.II sparse matrix
-  std::vector<unsigned int> cols;
-  std::vector<number>       vals;
+  std::vector<size_type>  cols;
+  std::vector<number>     vals;
   SparseMatrix<number> *sparse_matrix
     = dynamic_cast<SparseMatrix<number> *>(&global_matrix);
   if (use_dealii_matrix == false)
@@ -2427,21 +2547,21 @@ ConstraintMatrix::distribute_local_to_global (
   // the global rows that we will touch and
   // call resolve_matrix_row for each of
   // those.
-  for (unsigned int i=0; i<n_actual_dofs; ++i)
+  for (size_type i=0; i<n_actual_dofs; ++i)
     {
-      const unsigned int row = global_rows.global_row(i);
+      const size_type row = global_rows.global_row(i);
 
       // calculate all the data that will be
       // written into the matrix row.
       if (use_dealii_matrix == false)
         {
-          unsigned int *col_ptr = &cols[0];
+          size_type *col_ptr = &cols[0];
           number *val_ptr = &vals[0];
           internals::resolve_matrix_row (global_rows, global_rows, i, 0,
                                          n_actual_dofs,
                                          local_matrix, col_ptr, val_ptr);
-          const unsigned int n_values = col_ptr - &cols[0];
-          Assert (n_values == (unsigned int)(val_ptr - &vals[0]),
+          const size_type n_values = col_ptr - &cols[0];
+          Assert (n_values == (size_type)(val_ptr - &vals[0]),
                   ExcInternalError());
           if (n_values > 0)
             global_matrix.add(row, n_values, &cols[0], &vals[0], false, true);
@@ -2480,10 +2600,10 @@ ConstraintMatrix::distribute_local_to_global (
 template <typename MatrixType>
 void
 ConstraintMatrix::distribute_local_to_global (
-  const FullMatrix<double>        &local_matrix,
-  const std::vector<unsigned int> &row_indices,
-  const std::vector<unsigned int> &col_indices,
-  MatrixType                      &global_matrix) const
+  const FullMatrix<double>     &local_matrix,
+  const std::vector<size_type> &row_indices,
+  const std::vector<size_type> &col_indices,
+  MatrixType                   &global_matrix) const
 {
   typedef double number;
 
@@ -2491,37 +2611,37 @@ ConstraintMatrix::distribute_local_to_global (
   AssertDimension (local_matrix.n(), col_indices.size());
   //Assert (sorted == true, ExcMatrixNotClosed());
 
-  const unsigned int n_local_row_dofs = row_indices.size();
-  const unsigned int n_local_col_dofs = col_indices.size();
+  const size_type n_local_row_dofs = row_indices.size();
+  const size_type n_local_col_dofs = col_indices.size();
   internals::GlobalRowsFromLocal global_rows (n_local_row_dofs);
   internals::GlobalRowsFromLocal global_cols (n_local_col_dofs);
   make_sorted_row_list (row_indices, global_rows);
   make_sorted_row_list (col_indices, global_cols);
 
-  const unsigned int n_actual_row_dofs = global_rows.size();
-  const unsigned int n_actual_col_dofs = global_cols.size();
+  const size_type n_actual_row_dofs = global_rows.size();
+  const size_type n_actual_col_dofs = global_cols.size();
 
   // create arrays for the column data
   // (indices and values) that will then be
   // written into the matrix. Shortcut for
   // deal.II sparse matrix
-  std::vector<unsigned int> cols (n_actual_col_dofs);
+  std::vector<size_type> cols (n_actual_col_dofs);
   std::vector<number>       vals (n_actual_col_dofs);
 
   // now do the actual job.
-  for (unsigned int i=0; i<n_actual_row_dofs; ++i)
+  for (size_type i=0; i<n_actual_row_dofs; ++i)
     {
-      const unsigned int row = global_rows.global_row(i);
+      const size_type row = global_rows.global_row(i);
 
       // calculate all the data that will be
       // written into the matrix row.
-      unsigned int *col_ptr = &cols[0];
+      size_type *col_ptr = &cols[0];
       number *val_ptr = &vals[0];
       internals::resolve_matrix_row (global_rows, global_cols, i, 0,
                                      n_actual_col_dofs,
                                      local_matrix, col_ptr, val_ptr);
-      const unsigned int n_values = col_ptr - &cols[0];
-      Assert (n_values == (unsigned int)(val_ptr - &vals[0]),
+      const size_type n_values = col_ptr - &cols[0];
+      Assert (n_values == (size_type)(val_ptr - &vals[0]),
               ExcInternalError());
       if (n_values > 0)
         global_matrix.add(row, n_values, &cols[0], &vals[0], false, true);
@@ -2536,12 +2656,12 @@ ConstraintMatrix::distribute_local_to_global (
 template <typename MatrixType, typename VectorType>
 void
 ConstraintMatrix::
-distribute_local_to_global (const FullMatrix<double>        &local_matrix,
-                            const Vector<double>            &local_vector,
-                            const std::vector<unsigned int> &local_dof_indices,
-                            MatrixType                      &global_matrix,
-                            VectorType                      &global_vector,
-                            bool                            use_inhomogeneities_for_rhs,
+distribute_local_to_global (const FullMatrix<double>     &local_matrix,
+                            const Vector<double>         &local_vector,
+                            const std::vector<size_type> &local_dof_indices,
+                            MatrixType                   &global_matrix,
+                            VectorType                   &global_vector,
+                            bool                          use_inhomogeneities_for_rhs,
                             internal::bool2type<true>) const
 {
   const bool use_vectors = (local_vector.size() == 0 &&
@@ -2562,26 +2682,26 @@ distribute_local_to_global (const FullMatrix<double>        &local_matrix,
     }
   Assert (sorted == true, ExcMatrixNotClosed());
 
-  const unsigned int n_local_dofs = local_dof_indices.size();
+  const size_type n_local_dofs = local_dof_indices.size();
   internals::GlobalRowsFromLocal global_rows (n_local_dofs);
   make_sorted_row_list (local_dof_indices, global_rows);
-  const unsigned int n_actual_dofs = global_rows.size();
+  const size_type n_actual_dofs = global_rows.size();
 
-  std::vector<unsigned int> global_indices;
+  std::vector<size_type> global_indices;
   if (use_vectors == true)
     {
       global_indices.resize(n_actual_dofs);
-      for (unsigned int i=0; i<n_actual_dofs; ++i)
+      for (size_type i=0; i<n_actual_dofs; ++i)
         global_indices[i] = global_rows.global_row(i);
     }
 
   // additional construct that also takes
   // care of block indices.
-  const unsigned int num_blocks   = global_matrix.n_block_rows();
-  std::vector<unsigned int> block_starts(num_blocks+1, n_actual_dofs);
+  const size_type num_blocks   = global_matrix.n_block_rows();
+  std::vector<size_type> block_starts(num_blocks+1, n_actual_dofs);
   internals::make_block_starts (global_matrix, global_rows, block_starts);
 
-  std::vector<unsigned int> cols;
+  std::vector<size_type> cols;
   std::vector<number>       vals;
   if (use_dealii_matrix == false)
     {
@@ -2594,26 +2714,26 @@ distribute_local_to_global (const FullMatrix<double>        &local_matrix,
   // through the blocks of the matrix
   // separately, which allows us to set the
   // block entries individually
-  for (unsigned int block=0; block<num_blocks; ++block)
+  for (size_type block=0; block<num_blocks; ++block)
     {
-      const unsigned int next_block = block_starts[block+1];
-      for (unsigned int i=block_starts[block]; i<next_block; ++i)
+      const size_type next_block = block_starts[block+1];
+      for (size_type i=block_starts[block]; i<next_block; ++i)
         {
-          const unsigned int row = global_rows.global_row(i);
+          const size_type row = global_rows.global_row(i);
 
-          for (unsigned int block_col=0; block_col<num_blocks; ++block_col)
+          for (size_type block_col=0; block_col<num_blocks; ++block_col)
             {
-              const unsigned int start_block = block_starts[block_col],
-                                 end_block = block_starts[block_col+1];
+              const size_type start_block = block_starts[block_col],
+                              end_block = block_starts[block_col+1];
               if (use_dealii_matrix == false)
                 {
-                  unsigned int *col_ptr = &cols[0];
+                  size_type *col_ptr = &cols[0];
                   number *val_ptr = &vals[0];
                   internals::resolve_matrix_row (global_rows, global_rows, i,
                                                  start_block, end_block,
                                                  local_matrix, col_ptr, val_ptr);
-                  const unsigned int n_values = col_ptr - &cols[0];
-                  Assert (n_values == (unsigned int)(val_ptr - &vals[0]),
+                  const size_type n_values = col_ptr - &cols[0];
+                  Assert (n_values == (size_type )(val_ptr - &vals[0]),
                           ExcInternalError());
                   if (n_values > 0)
                     global_matrix.block(block, block_col).add(row, n_values,
@@ -2655,15 +2775,15 @@ distribute_local_to_global (const FullMatrix<double>        &local_matrix,
 template <typename SparsityType>
 void
 ConstraintMatrix::
-add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
-                             SparsityType                    &sparsity_pattern,
-                             const bool                       keep_constrained_entries,
-                             const Table<2,bool>             &dof_mask,
+add_entries_local_to_global (const std::vector<size_type> &local_dof_indices,
+                             SparsityType                 &sparsity_pattern,
+                             const bool                    keep_constrained_entries,
+                             const Table<2,bool>          &dof_mask,
                              internal::bool2type<false> ) const
 {
   Assert (sparsity_pattern.n_rows() == sparsity_pattern.n_cols(), ExcNotQuadratic());
 
-  const unsigned int n_local_dofs = local_dof_indices.size();
+  const size_type n_local_dofs = local_dof_indices.size();
   bool dof_mask_is_active = false;
   if (dof_mask.n_rows() == n_local_dofs)
     {
@@ -2680,15 +2800,15 @@ add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
   // indices that come from constraints.
   if (dof_mask_is_active == false)
     {
-      std::vector<unsigned int> actual_dof_indices (n_local_dofs);
+      std::vector<size_type> actual_dof_indices (n_local_dofs);
       make_sorted_row_list (local_dof_indices, actual_dof_indices);
-      const unsigned int n_actual_dofs = actual_dof_indices.size();
+      const size_type n_actual_dofs = actual_dof_indices.size();
 
       // now add the indices we collected above
       // to the sparsity pattern. Very easy
       // here - just add the same array to all
       // the rows...
-      for (unsigned int i=0; i<n_actual_dofs; ++i)
+      for (size_type i=0; i<n_actual_dofs; ++i)
         sparsity_pattern.add_entries(actual_dof_indices[i],
                                      actual_dof_indices.begin(),
                                      actual_dof_indices.end(),
@@ -2700,11 +2820,11 @@ add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
       // the nice matrix structure we use
       // elsewhere, so manually add those
       // indices one by one.
-      for (unsigned int i=0; i<n_local_dofs; i++)
+      for (size_type i=0; i<n_local_dofs; i++)
         if (is_constrained(local_dof_indices[i]))
           {
             if (keep_constrained_entries == true)
-              for (unsigned int j=0; j<n_local_dofs; j++)
+              for (size_type j=0; j<n_local_dofs; j++)
                 {
                   sparsity_pattern.add (local_dof_indices[i], local_dof_indices[j]);
                   sparsity_pattern.add (local_dof_indices[j], local_dof_indices[i]);
@@ -2724,17 +2844,17 @@ add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
   // for additional comments.
   internals::GlobalRowsFromLocal global_rows (n_local_dofs);
   make_sorted_row_list (local_dof_indices, global_rows);
-  const unsigned int n_actual_dofs = global_rows.size();
+  const size_type n_actual_dofs = global_rows.size();
 
   // create arrays for the column indices
   // that will then be written into the
   // sparsity pattern.
-  std::vector<unsigned int> cols (n_actual_dofs);
+  std::vector<size_type> cols (n_actual_dofs);
 
-  for (unsigned int i=0; i<n_actual_dofs; ++i)
+  for (size_type i=0; i<n_actual_dofs; ++i)
     {
-      std::vector<unsigned int>::iterator col_ptr = cols.begin();
-      const unsigned int row = global_rows.global_row(i);
+      std::vector<size_type>::iterator col_ptr = cols.begin();
+      const size_type row = global_rows.global_row(i);
       internals::resolve_matrix_row (global_rows, i, 0, n_actual_dofs,
                                      dof_mask, col_ptr);
 
@@ -2757,14 +2877,14 @@ add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
 template <typename SparsityType>
 void
 ConstraintMatrix::
-add_entries_local_to_global (const std::vector<unsigned int> &row_indices,
-                             const std::vector<unsigned int> &col_indices,
+add_entries_local_to_global (const std::vector<size_type> &row_indices,
+                             const std::vector<size_type> &col_indices,
                              SparsityType                    &sparsity_pattern,
                              const bool                       keep_constrained_entries,
                              const Table<2,bool>             &dof_mask) const
 {
-  const unsigned int n_local_rows = row_indices.size();
-  const unsigned int n_local_cols = col_indices.size();
+  const size_type n_local_rows = row_indices.size();
+  const size_type n_local_cols = col_indices.size();
   bool dof_mask_is_active = false;
   if (dof_mask.n_rows() == n_local_rows && dof_mask.n_cols() == n_local_cols)
     dof_mask_is_active = true;
@@ -2778,17 +2898,17 @@ add_entries_local_to_global (const std::vector<unsigned int> &row_indices,
   // indices that come from constraints.
   if (dof_mask_is_active == false)
     {
-      std::vector<unsigned int> actual_row_indices (n_local_rows);
-      std::vector<unsigned int> actual_col_indices (n_local_cols);
+      std::vector<size_type> actual_row_indices (n_local_rows);
+      std::vector<size_type> actual_col_indices (n_local_cols);
       make_sorted_row_list (row_indices, actual_row_indices);
       make_sorted_row_list (col_indices, actual_col_indices);
-      const unsigned int n_actual_rows = actual_row_indices.size();
+      const size_type n_actual_rows = actual_row_indices.size();
 
       // now add the indices we collected above
       // to the sparsity pattern. Very easy
       // here - just add the same array to all
       // the rows...
-      for (unsigned int i=0; i<n_actual_rows; ++i)
+      for (size_type i=0; i<n_actual_rows; ++i)
         sparsity_pattern.add_entries(actual_row_indices[i],
                                      actual_col_indices.begin(),
                                      actual_col_indices.end(),
@@ -2801,13 +2921,13 @@ add_entries_local_to_global (const std::vector<unsigned int> &row_indices,
   // of those to the sparsity pattern
   if (keep_constrained_entries == true)
     {
-      for (unsigned int i=0; i<row_indices.size(); i++)
+      for (size_type i=0; i<row_indices.size(); i++)
         if (is_constrained(row_indices[i]))
-          for (unsigned int j=0; j<col_indices.size(); j++)
+          for (size_type j=0; j<col_indices.size(); j++)
             sparsity_pattern.add (row_indices[i], col_indices[j]);
-      for (unsigned int i=0; i<col_indices.size(); i++)
+      for (size_type i=0; i<col_indices.size(); i++)
         if (is_constrained(col_indices[i]))
-          for (unsigned int j=0; j<row_indices.size(); j++)
+          for (size_type j=0; j<row_indices.size(); j++)
             sparsity_pattern.add (row_indices[j], col_indices[i]);
     }
 
@@ -2822,10 +2942,10 @@ add_entries_local_to_global (const std::vector<unsigned int> &row_indices,
 template <typename SparsityType>
 void
 ConstraintMatrix::
-add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
-                             SparsityType                    &sparsity_pattern,
-                             const bool                       keep_constrained_entries,
-                             const Table<2,bool>             &dof_mask,
+add_entries_local_to_global (const std::vector<size_type> &local_dof_indices,
+                             SparsityType                 &sparsity_pattern,
+                             const bool                    keep_constrained_entries,
+                             const Table<2,bool>          &dof_mask,
                              internal::bool2type<true> ) const
 {
   // just as the other
@@ -2836,8 +2956,8 @@ add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
   Assert (sparsity_pattern.n_block_rows() == sparsity_pattern.n_block_cols(),
           ExcNotQuadratic());
 
-  const unsigned int n_local_dofs = local_dof_indices.size();
-  const unsigned int num_blocks = sparsity_pattern.n_block_rows();
+  const size_type n_local_dofs = local_dof_indices.size();
+  const size_type num_blocks = sparsity_pattern.n_block_rows();
 
   bool dof_mask_is_active = false;
   if (dof_mask.n_rows() == n_local_dofs)
@@ -2848,29 +2968,29 @@ add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
 
   if (dof_mask_is_active == false)
     {
-      std::vector<unsigned int> actual_dof_indices (n_local_dofs);
+      std::vector<size_type> actual_dof_indices (n_local_dofs);
       make_sorted_row_list (local_dof_indices, actual_dof_indices);
-      const unsigned int n_actual_dofs = actual_dof_indices.size();
+      const size_type n_actual_dofs = actual_dof_indices.size();
 
       // additional construct that also takes
       // care of block indices.
-      std::vector<unsigned int> block_starts(num_blocks+1, n_actual_dofs);
+      std::vector<size_type> block_starts(num_blocks+1, n_actual_dofs);
       internals::make_block_starts (sparsity_pattern, actual_dof_indices,
                                     block_starts);
 
-      for (unsigned int block=0; block<num_blocks; ++block)
+      for (size_type block=0; block<num_blocks; ++block)
         {
-          const unsigned int next_block = block_starts[block+1];
-          for (unsigned int i=block_starts[block]; i<next_block; ++i)
+          const size_type next_block = block_starts[block+1];
+          for (size_type i=block_starts[block]; i<next_block; ++i)
             {
               Assert (i<n_actual_dofs, ExcInternalError());
-              const unsigned int row = actual_dof_indices[i];
+              const size_type row = actual_dof_indices[i];
               Assert (row < sparsity_pattern.block(block,0).n_rows(),
                       ExcInternalError());
-              std::vector<unsigned int>::iterator index_it = actual_dof_indices.begin();
-              for (unsigned int block_col = 0; block_col<num_blocks; ++block_col)
+              std::vector<size_type>::iterator index_it = actual_dof_indices.begin();
+              for (size_type block_col = 0; block_col<num_blocks; ++block_col)
                 {
-                  const unsigned int next_block_col = block_starts[block_col+1];
+                  const size_type next_block_col = block_starts[block_col+1];
                   sparsity_pattern.block(block,block_col).
                   add_entries(row,
                               index_it,
@@ -2881,11 +3001,11 @@ add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
             }
         }
 
-      for (unsigned int i=0; i<n_local_dofs; i++)
+      for (size_type i=0; i<n_local_dofs; i++)
         if (is_constrained(local_dof_indices[i]))
           {
             if (keep_constrained_entries == true)
-              for (unsigned int j=0; j<n_local_dofs; j++)
+              for (size_type j=0; j<n_local_dofs; j++)
                 {
                   sparsity_pattern.add (local_dof_indices[i], local_dof_indices[j]);
                   sparsity_pattern.add (local_dof_indices[j], local_dof_indices[i]);
@@ -2902,31 +3022,31 @@ add_entries_local_to_global (const std::vector<unsigned int> &local_dof_indices,
   // function for block matrices
   internals::GlobalRowsFromLocal global_rows (n_local_dofs);
   make_sorted_row_list (local_dof_indices, global_rows);
-  const unsigned int n_actual_dofs = global_rows.size();
+  const size_type n_actual_dofs = global_rows.size();
 
   // additional construct that also takes
   // care of block indices.
-  std::vector<unsigned int> block_starts(num_blocks+1, n_actual_dofs);
+  std::vector<size_type> block_starts(num_blocks+1, n_actual_dofs);
   internals::make_block_starts(sparsity_pattern, global_rows,
                                block_starts);
 
-  std::vector<unsigned int> cols (n_actual_dofs);
+  std::vector<size_type> cols (n_actual_dofs);
 
   // the basic difference to the
   // non-block variant from now onwards
   // is that we go through the blocks
   // of the matrix separately.
-  for (unsigned int block=0; block<num_blocks; ++block)
+  for (size_type block=0; block<num_blocks; ++block)
     {
-      const unsigned int next_block = block_starts[block+1];
-      for (unsigned int i=block_starts[block]; i<next_block; ++i)
+      const size_type next_block = block_starts[block+1];
+      for (size_type i=block_starts[block]; i<next_block; ++i)
         {
-          const unsigned int row = global_rows.global_row(i);
-          for (unsigned int block_col=0; block_col<num_blocks; ++block_col)
+          const size_type row = global_rows.global_row(i);
+          for (size_type block_col=0; block_col<num_blocks; ++block_col)
             {
-              const unsigned int begin_block = block_starts[block_col],
-                                 end_block = block_starts[block_col+1];
-              std::vector<unsigned int>::iterator col_ptr = cols.begin();
+              const size_type begin_block = block_starts[block_col],
+                              end_block = block_starts[block_col+1];
+              std::vector<size_type>::iterator col_ptr = cols.begin();
               internals::resolve_matrix_row (global_rows, i, begin_block,
                                              end_block, dof_mask, col_ptr);
 
index f0c0ef8f0ed557e94e988b25019675ff8e81ad2c..4de78549751ab95f093dde2dd2fd1a470ed9f8f1 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__eigen_h
 #define __deal2__eigen_h
 
@@ -50,6 +55,11 @@ template <class VECTOR = Vector<double> >
 class EigenPower : private Solver<VECTOR>
 {
 public:
+  /**
+   * Declare type of container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Standardized data struct to
    * pipe additional data to the
@@ -139,6 +149,11 @@ template <class VECTOR = Vector<double> >
 class EigenInverse : private Solver<VECTOR>
 {
 public:
+  /**
+   * Declare type of container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Standardized data struct to
    * pipe additional data to the
@@ -270,7 +285,7 @@ EigenPower<VECTOR>::solve (double       &value,
       // do a little trick to compute the sign
       // with not too much effect of round-off errors.
       double entry = 0.;
-      unsigned int i = 0;
+      size_type i = 0;
       double thresh = length/x.size();
       do
         {
@@ -365,7 +380,7 @@ EigenInverse<VECTOR>::solve (double       &value,
   x.scale(1./length);
 
   // Main loop
-  for (unsigned int iter=0; conv==SolverControl::iterate; iter++)
+  for (size_type iter=0; conv==SolverControl::iterate; iter++)
     {
       solver.solve (A_s, y, x, prec);
 
@@ -375,7 +390,7 @@ EigenInverse<VECTOR>::solve (double       &value,
       // do a little trick to compute the sign
       // with not too much effect of round-off errors.
       double entry = 0.;
-      unsigned int i = 0;
+      size_type i = 0;
       double thresh = length/x.size();
       do
         {
index 160138bf0db72b37400fbe8e18ea72a5a1d8e15f..6c8a1bacca8840ea33cf437693eb4ff9fd8a19ad 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__lac_exceptions_h
 #define __deal2__lac_exceptions_h
 
index 939b77e72ea97e674eef6da211cd8d4e94b19892..074613fc5fd2e61cf510fec48319ce75417310bb 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__filtered_matrix_h
 #define __deal2__filtered_matrix_h
 
@@ -206,6 +211,11 @@ class FilteredMatrix : public Subscriptor
 public:
   class const_iterator;
 
+  /**
+   * Declare the type of container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Accessor class for iterators
    */
@@ -218,7 +228,7 @@ public:
      * pointer is sufficient.
      */
     Accessor (const FilteredMatrix<VECTOR> *matrix,
-              const unsigned int index);
+              const size_type               index);
 
   public:
     /**
@@ -226,14 +236,14 @@ public:
      * represented by this
      * object.
      */
-    unsigned int row() const;
+    size_type row() const;
 
     /**
      * Column number of the
      * element represented by
      * this object.
      */
-    unsigned int column() const;
+    size_type column() const;
 
     /**
      * Value of the right hand
@@ -255,7 +265,7 @@ public:
     /**
      * Current row number.
      */
-    unsigned int index;
+    size_type index;
     /*
      * Make enclosing class a
      * friend.
@@ -273,7 +283,7 @@ public:
      * Constructor.
      */
     const_iterator(const FilteredMatrix<VECTOR> *matrix,
-                   const unsigned int index);
+                   const size_type index);
 
     /**
      * Prefix increment.
@@ -337,7 +347,7 @@ public:
    * freedom index and the value it
    * shall have.
    */
-  typedef std::pair<unsigned int, double> IndexValuePair;
+  typedef std::pair<size_type, double> IndexValuePair;
 
   /**
    * @name Constructors and initialization
@@ -416,7 +426,7 @@ public:
    * should have the value
    * <tt>v</tt>.
    */
-  void add_constraint (const unsigned int i, const double v);
+  void add_constraint (const size_type i, const double v);
 
   /**
    * Add a list of constraints to
@@ -655,7 +665,7 @@ template<class VECTOR>
 inline
 FilteredMatrix<VECTOR>::Accessor::Accessor(
   const FilteredMatrix<VECTOR> *matrix,
-  const unsigned int index)
+  const size_type index)
   :
   matrix(matrix),
   index(index)
@@ -668,7 +678,7 @@ FilteredMatrix<VECTOR>::Accessor::Accessor(
 
 template<class VECTOR>
 inline
-unsigned int
+types::global_dof_index
 FilteredMatrix<VECTOR>::Accessor::row() const
 {
   return matrix->constraints[index].first;
@@ -678,7 +688,7 @@ FilteredMatrix<VECTOR>::Accessor::row() const
 
 template<class VECTOR>
 inline
-unsigned int
+types::global_dof_index
 FilteredMatrix<VECTOR>::Accessor::column() const
 {
   return matrix->constraints[index].first;
@@ -712,7 +722,7 @@ template<class VECTOR>
 inline
 FilteredMatrix<VECTOR>::const_iterator::const_iterator(
   const FilteredMatrix<VECTOR> *matrix,
-  const unsigned int index)
+  const size_type index)
   :
   accessor(matrix, index)
 {}
@@ -860,7 +870,7 @@ FilteredMatrix<VECTOR>::operator = (const FilteredMatrix &fm)
 template <class VECTOR>
 inline
 void
-FilteredMatrix<VECTOR>::add_constraint (const unsigned int index, const double value)
+FilteredMatrix<VECTOR>::add_constraint (const size_type index, const double value)
 {
   // add new constraint to end
   constraints.push_back(IndexValuePair(index, value));
@@ -875,7 +885,7 @@ void
 FilteredMatrix<VECTOR>::add_constraints (const ConstraintList &new_constraints)
 {
   // add new constraints to end
-  const unsigned int old_size = constraints.size();
+  const size_type old_size = constraints.size();
   constraints.reserve (old_size + new_constraints.size());
   constraints.insert (constraints.end(),
                       new_constraints.begin(),
index 7a01b5127ac799c15bc65e9afc18899565d1ae56..ad8a7fc09a039eeb9f7e94bd4063c317ea57a2a7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__full_matrix_h
 #define __deal2__full_matrix_h
 
@@ -60,6 +65,14 @@ template<typename number>
 class FullMatrix : public Table<2,number>
 {
 public:
+  /**
+   * Declare type of container size.
+   */
+  // A FullMatrix will never require to use unsigned long long int instead of
+  // unsigned but because a ConstraintMatrix can be a SparseMatrix or a
+  // FullMatrix, we need have the same interface.
+  typedef types::global_dof_index size_type;
+
   /**
    * Type of matrix entries. In analogy to
    * the STL container classes.
@@ -104,22 +117,22 @@ public:
      * pointer is sufficient.
      */
     Accessor (const FullMatrix<number> *matrix,
-              const unsigned int row,
-              const unsigned int col);
+              const size_type row,
+              const size_type col);
 
     /**
      * Row number of the element
      * represented by this
      * object.
      */
-    unsigned int row() const;
+    size_type row() const;
 
     /**
      * Column number of the
      * element represented by
      * this object.
      */
-    unsigned int column() const;
+    size_type column() const;
 
     /**
      * Value of this matrix entry.
@@ -135,7 +148,7 @@ public:
     /**
      * Current row number.
      */
-    unsigned int a_row;
+    size_type a_row;
 
     /**
      * Current column number.
@@ -159,8 +172,8 @@ public:
      * Constructor.
      */
     const_iterator(const FullMatrix<number> *matrix,
-                   const unsigned int row,
-                   const unsigned int col);
+                   const size_type row,
+                   const size_type col);
 
     /**
      * Prefix increment.
@@ -237,15 +250,15 @@ public:
    * By default, no memory is
    * allocated.
    */
-  explicit FullMatrix (const unsigned int n = 0);
+  explicit FullMatrix (const size_type n = 0);
 
   /**
    * Constructor. Initialize the
    * matrix as a rectangular
    * matrix.
    */
-  FullMatrix (const unsigned int rows,
-              const unsigned int cols);
+  FullMatrix (const size_type rows,
+              const size_type cols);
 
   /**
    * Copy constructor. This
@@ -274,8 +287,8 @@ public:
    * is arranged line by line. No
    * range checking is performed.
    */
-  FullMatrix (const unsigned int rows,
-              const unsigned int cols,
+  FullMatrix (const size_type rows,
+              const size_type cols,
               const number *entries);
 
   /**
@@ -391,12 +404,12 @@ public:
   template <int dim>
   void
   copy_from (const Tensor<2,dim> &T,
-             const unsigned int src_r_i=0,
-             const unsigned int src_r_j=dim-1,
-             const unsigned int src_c_i=0,
-             const unsigned int src_c_j=dim-1,
-             const unsigned int dst_r=0,
-             const unsigned int dst_c=0);
+             const size_type src_r_i=0,
+             const size_type src_r_j=dim-1,
+             const size_type src_c_i=0,
+             const size_type src_c_j=dim-1,
+             const size_type dst_r=0,
+             const size_type dst_c=0);
 
   /**
    * Insert a submatrix (also
@@ -414,12 +427,12 @@ public:
   template <int dim>
   void
   copy_to(Tensor<2,dim> &T,
-          const unsigned int src_r_i=0,
-          const unsigned int src_r_j=dim-1,
-          const unsigned int src_c_i=0,
-          const unsigned int src_c_j=dim-1,
-          const unsigned int dst_r=0,
-          const unsigned int dst_c=0) const;
+          const size_type src_r_i=0,
+          const size_type src_r_j=dim-1,
+          const size_type src_c_i=0,
+          const size_type src_c_j=dim-1,
+          const size_type dst_r=0,
+          const size_type dst_c=0) const;
 
   /**
    * Copy a subset of the rows and columns of another matrix into the
@@ -435,8 +448,8 @@ public:
    */
   template <typename MatrixType>
   void extract_submatrix_from (const MatrixType &matrix,
-                               const std::vector<unsigned int> &row_index_set,
-                               const std::vector<unsigned int> &column_index_set);
+                               const std::vector<size_type> &row_index_set,
+                               const std::vector<size_type> &column_index_set);
 
   /**
    * Copy the elements of the current matrix object into a specified
@@ -452,8 +465,8 @@ public:
    */
   template <typename MatrixType>
   void
-  scatter_matrix_to (const std::vector<unsigned int> &row_index_set,
-                     const std::vector<unsigned int> &column_index_set,
+  scatter_matrix_to (const std::vector<size_type> &row_index_set,
+                     const std::vector<size_type> &column_index_set,
                      MatrixType &matrix) const;
 
   /**
@@ -476,10 +489,10 @@ public:
    */
   template<typename number2>
   void fill (const FullMatrix<number2> &src,
-             const unsigned int dst_offset_i = 0,
-             const unsigned int dst_offset_j = 0,
-             const unsigned int src_offset_i = 0,
-             const unsigned int src_offset_j = 0);
+             const size_type dst_offset_i = 0,
+             const size_type dst_offset_j = 0,
+             const size_type src_offset_i = 0,
+             const size_type src_offset_j = 0);
 
 
   /**
@@ -509,8 +522,8 @@ public:
    */
   template<typename number2>
   void fill_permutation (const FullMatrix<number2>       &src,
-                         const std::vector<unsigned int> &p_rows,
-                         const std::vector<unsigned int> &p_cols);
+                         const std::vector<size_type> &p_rows,
+                         const std::vector<size_type> &p_cols);
 
   /**
    * Set a particular entry of the matrix to a value. Thus, calling
@@ -522,8 +535,8 @@ public:
    * @param j The columns index of the element to be set.
    * @param value The value to be written into the element.
    */
-  void set (const unsigned int i,
-            const unsigned int j,
+  void set (const size_type i,
+            const size_type j,
             const number value);
   /**
    * @}
@@ -551,14 +564,14 @@ public:
    * To remember: this matrix is an
    * <i>m x n</i>-matrix.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Number of columns of this matrix.
    * To remember: this matrix is an
    * <i>m x n</i>-matrix.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Return whether the matrix
@@ -777,12 +790,12 @@ public:
    * STL-like iterator with the
    * first entry of row <tt>r</tt>.
    */
-  const_iterator begin (const unsigned int r) const;
+  const_iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row <tt>r</tt>.
    */
-  const_iterator end (const unsigned int r) const;
+  const_iterator end (const size_type r) const;
 
 //@}
 ///@name Modifying operators
@@ -876,10 +889,10 @@ public:
   template<typename number2>
   void add (const FullMatrix<number2> &src,
             const number factor,
-            const unsigned int dst_offset_i = 0,
-            const unsigned int dst_offset_j = 0,
-            const unsigned int src_offset_i = 0,
-            const unsigned int src_offset_j = 0);
+            const size_type dst_offset_i = 0,
+            const size_type dst_offset_j = 0,
+            const size_type src_offset_i = 0,
+            const size_type src_offset_j = 0);
 
   /**
    * Weighted addition of the
@@ -917,17 +930,17 @@ public:
   template<typename number2>
   void Tadd (const FullMatrix<number2> &src,
              const number               factor,
-             const unsigned int dst_offset_i = 0,
-             const unsigned int dst_offset_j = 0,
-             const unsigned int src_offset_i = 0,
-             const unsigned int src_offset_j = 0);
+             const size_type dst_offset_i = 0,
+             const size_type dst_offset_j = 0,
+             const size_type src_offset_i = 0,
+             const size_type src_offset_j = 0);
 
   /**
    * Add a single element at the
    * given position.
    */
-  void add (const unsigned int row,
-            const unsigned int column,
+  void add (const size_type row,
+            const size_type column,
             const number value);
 
   /**
@@ -947,9 +960,9 @@ public:
    * implementation.
    */
   template <typename number2>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
+  void add (const size_type     row,
+            const size_type     n_cols,
+            const size_type    *col_indices,
             const number2      *values,
             const bool          elide_zero_values = true,
             const bool          col_indices_are_sorted = false);
@@ -959,51 +972,51 @@ public:
    * s*A(j,1...n)</i>.  Simple
    * addition of rows of this
    */
-  void add_row (const unsigned int i,
-                const number       s,
-                const unsigned int j);
+  void add_row (const size_type i,
+                const number    s,
+                const size_type j);
 
   /**
    * <i>A(i,1...n) += s*A(j,1...n) +
    * t*A(k,1...n)</i>.  Multiple
    * addition of rows of this.
    */
-  void add_row (const unsigned int i,
-                const number s, const unsigned int j,
-                const number t, const unsigned int k);
+  void add_row (const size_type i,
+                const number s, const size_type j,
+                const number t, const size_type k);
 
   /**
    * <i>A(1...n,i) += s*A(1...n,j)</i>.
    *  Simple addition of columns of this.
    */
-  void add_col (const unsigned int i,
-                const number       s,
-                const unsigned int j);
+  void add_col (const size_type i,
+                const number    s,
+                const size_type j);
 
   /**
    * <i>A(1...n,i) += s*A(1...n,j) +
    * t*A(1...n,k)</i>.  Multiple
    * addition of columns of this.
    */
-  void add_col (const unsigned int i,
-                const number s, const unsigned int j,
-                const number t, const unsigned int k);
+  void add_col (const size_type i,
+                const number s, const size_type j,
+                const number t, const size_type k);
 
   /**
    * Swap <i>A(i,1...n) <->
    * A(j,1...n)</i>.  Swap rows i
    * and j of this
    */
-  void swap_row (const unsigned int i,
-                 const unsigned int j);
+  void swap_row (const size_type i,
+                 const size_type j);
 
   /**
    *  Swap <i>A(1...n,i) <->
    *  A(1...n,j)</i>.  Swap columns
    *  i and j of this
    */
-  void swap_col (const unsigned int i,
-                 const unsigned int j);
+  void swap_col (const size_type i,
+                 const size_type j);
 
   /**
    * Add constant to diagonal
@@ -1446,7 +1459,7 @@ public:
    * Exception
    */
   DeclException3 (ExcInvalidDestination,
-                  int, int, int,
+                  size_type, size_type, size_type,
                   << "Target region not in matrix: size in this direction="
                   << arg1 << ", size of new matrix=" << arg2
                   << ", offset=" << arg3);
@@ -1473,7 +1486,7 @@ public:
 
 template <typename number>
 inline
-unsigned int
+typename FullMatrix<number>::size_type
 FullMatrix<number>::m() const
 {
   return this->n_rows();
@@ -1483,7 +1496,7 @@ FullMatrix<number>::m() const
 
 template <typename number>
 inline
-unsigned int
+typename FullMatrix<number>::size_type
 FullMatrix<number>::n() const
 {
   return this->n_cols();
@@ -1526,11 +1539,11 @@ FullMatrix<number>::copy_from (const MATRIX &M)
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class, and
   // copy them into the current object
-  for (unsigned int row = 0; row < M.m(); ++row)
+  for (size_type row = 0; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
-          entry != end_row; ++entry)
+           entry != end_row; ++entry)
         this->el(row, entry->column()) = entry->value();
     }
 }
@@ -1547,11 +1560,11 @@ FullMatrix<number>::copy_transposed (const MATRIX &M)
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class, and
   // copy them into the current object
-  for (unsigned int row = 0; row < M.m(); ++row)
+  for (size_type row = 0; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
-          entry != end_row; ++entry)
+           entry != end_row; ++entry)
         this->el(entry->column(), row) = entry->value();
     }
 }
@@ -1563,17 +1576,17 @@ template <typename MatrixType>
 inline
 void
 FullMatrix<number>::extract_submatrix_from (const MatrixType &matrix,
-                                            const std::vector<unsigned int> &row_index_set,
-                                            const std::vector<unsigned int> &column_index_set)
+                                            const std::vector<size_type> &row_index_set,
+                                            const std::vector<size_type> &column_index_set)
 {
   AssertDimension(row_index_set.size(), this->n_rows());
   AssertDimension(column_index_set.size(), this->n_cols());
 
-  const unsigned int n_rows_submatrix = row_index_set.size();
-  const unsigned int n_cols_submatrix = column_index_set.size();
+  const size_type n_rows_submatrix = row_index_set.size();
+  const size_type n_cols_submatrix = column_index_set.size();
 
-  for (unsigned int sub_row = 0; sub_row < n_rows_submatrix; ++sub_row)
-    for (unsigned int sub_col = 0; sub_col < n_cols_submatrix; ++sub_col)
+  for (size_type sub_row = 0; sub_row < n_rows_submatrix; ++sub_row)
+    for (size_type sub_col = 0; sub_col < n_cols_submatrix; ++sub_col)
       (*this)(sub_row, sub_col) = matrix.el(row_index_set[sub_row], column_index_set[sub_col]);
 }
 
@@ -1583,18 +1596,18 @@ template <typename number>
 template <typename MatrixType>
 inline
 void
-FullMatrix<number>::scatter_matrix_to (const std::vector<unsigned int> &row_index_set,
-                                       const std::vector<unsigned int> &column_index_set,
+FullMatrix<number>::scatter_matrix_to (const std::vector<size_type> &row_index_set,
+                                       const std::vector<size_type> &column_index_set,
                                        MatrixType &matrix) const
 {
   AssertDimension(row_index_set.size(), this->n_rows());
   AssertDimension(column_index_set.size(), this->n_cols());
 
-  const unsigned int n_rows_submatrix = row_index_set.size();
-  const unsigned int n_cols_submatrix = column_index_set.size();
+  const size_type n_rows_submatrix = row_index_set.size();
+  const size_type n_cols_submatrix = column_index_set.size();
 
-  for (unsigned int sub_row = 0; sub_row < n_rows_submatrix; ++sub_row)
-    for (unsigned int sub_col = 0; sub_col < n_cols_submatrix; ++sub_col)
+  for (size_type sub_row = 0; sub_row < n_rows_submatrix; ++sub_row)
+    for (size_type sub_col = 0; sub_col < n_cols_submatrix; ++sub_col)
       matrix.set(row_index_set[sub_row],
                  column_index_set[sub_col],
                  (*this)(sub_row, sub_col));
@@ -1604,8 +1617,8 @@ FullMatrix<number>::scatter_matrix_to (const std::vector<unsigned int> &row_inde
 template <typename number>
 inline
 void
-FullMatrix<number>::set (const unsigned int i,
-                         const unsigned int j,
+FullMatrix<number>::set (const size_type i,
+                         const size_type j,
                          const number value)
 {
   (*this)(i,j) = value;
@@ -1640,8 +1653,8 @@ template <typename number>
 inline
 FullMatrix<number>::Accessor::
 Accessor (const FullMatrix<number> *matrix,
-          const unsigned int r,
-          const unsigned int c)
+          const size_type r,
+          const size_type c)
   :
   matrix(matrix),
   a_row(r),
@@ -1651,7 +1664,7 @@ Accessor (const FullMatrix<number> *matrix,
 
 template <typename number>
 inline
-unsigned int
+typename FullMatrix<number>::size_type
 FullMatrix<number>::Accessor::row() const
 {
   return a_row;
@@ -1660,7 +1673,7 @@ FullMatrix<number>::Accessor::row() const
 
 template <typename number>
 inline
-unsigned int
+typename FullMatrix<number>::size_type
 FullMatrix<number>::Accessor::column() const
 {
   return a_col;
@@ -1681,8 +1694,8 @@ template <typename number>
 inline
 FullMatrix<number>::const_iterator::
 const_iterator(const FullMatrix<number> *matrix,
-               const unsigned int r,
-               const unsigned int c)
+               const size_type r,
+               const size_type c)
   :
   accessor(matrix, r, c)
 {}
@@ -1787,7 +1800,7 @@ FullMatrix<number>::end () const
 template <typename number>
 inline
 typename FullMatrix<number>::const_iterator
-FullMatrix<number>::begin (const unsigned int r) const
+FullMatrix<number>::begin (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   return const_iterator(this, r, 0);
@@ -1798,7 +1811,7 @@ FullMatrix<number>::begin (const unsigned int r) const
 template <typename number>
 inline
 typename FullMatrix<number>::const_iterator
-FullMatrix<number>::end (const unsigned int r) const
+FullMatrix<number>::end (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   return const_iterator(this, r+1, 0);
@@ -1809,7 +1822,7 @@ FullMatrix<number>::end (const unsigned int r) const
 template <typename number>
 inline
 void
-FullMatrix<number>::add (const unsigned int r, const unsigned int c, const number v)
+FullMatrix<number>::add (const size_type r, const size_type c, const number v)
 {
   AssertIndexRange(r, this->m());
   AssertIndexRange(c, this->n());
@@ -1823,15 +1836,15 @@ template <typename number>
 template <typename number2>
 inline
 void
-FullMatrix<number>::add (const unsigned int  row,
-                         const unsigned int  n_cols,
-                         const unsigned int *col_indices,
-                         const number2      *values,
+FullMatrix<number>::add (const size_type  row,
+                         const size_type  n_cols,
+                         const size_type *col_indices,
+                         const number2   *values,
                          const bool,
                          const bool)
 {
   AssertIndexRange(row, this->m());
-  for (unsigned int col=0; col<n_cols; ++col)
+  for (size_type col=0; col<n_cols; ++col)
     {
       AssertIndexRange(col_indices[col], this->n());
       this->operator()(row,col_indices[col]) += values[col];
@@ -1853,14 +1866,14 @@ FullMatrix<number>::print (STREAM             &s,
   const unsigned int old_precision = s.precision (p);
   const unsigned int old_width = s.width (w);
 
-  for (unsigned int i=0; i<this->m(); ++i)
+  for (size_type i=0; i<this->m(); ++i)
     {
-      for (unsigned int j=0; j<this->n(); ++j)
-       {
-         s.width(w);
-         s.precision(p);
-         s << this->el(i,j);
-       }
+      for (size_type j=0; j<this->n(); ++j)
+        {
+          s.width(w);
+          s.precision(p);
+          s << this->el(i,j);
+        }
       s << std::endl;
     }
 
index 41febef42853ac5a8980541c4f4a4018583021de..44c3bb893318045a30697282ddece7be194f62c5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__full_matrix_templates_h
 #define __deal2__full_matrix_templates_h
 
@@ -32,23 +37,23 @@ DEAL_II_NAMESPACE_OPEN
 
 
 template <typename number>
-FullMatrix<number>::FullMatrix (const unsigned int n)
+FullMatrix<number>::FullMatrix (const size_type n)
   :
   Table<2,number> (n,n)
 {}
 
 
 template <typename number>
-FullMatrix<number>::FullMatrix (const unsigned int m,
-                                const unsigned int n)
+FullMatrix<number>::FullMatrix (const size_type m,
+                                const size_type n)
   :
   Table<2,number> (m, n)
 {}
 
 
 template <typename number>
-FullMatrix<number>::FullMatrix (const unsigned int m,
-                                const unsigned int n,
+FullMatrix<number>::FullMatrix (const size_type m,
+                                const size_type n,
                                 const number *entries)
   :
   Table<2,number> (m, n)
@@ -70,7 +75,7 @@ FullMatrix<number>::FullMatrix (const IdentityMatrix &id)
   :
   Table<2,number> (id.m(), id.n())
 {
-  for (unsigned int i=0; i<id.m(); ++i)
+  for (size_type i=0; i<id.m(); ++i)
     (*this)(i,i) = 1;
 }
 
@@ -100,7 +105,7 @@ FullMatrix<number> &
 FullMatrix<number>::operator = (const IdentityMatrix &id)
 {
   this->reinit (id.m(), id.n());
-  for (unsigned int i=0; i<id.m(); ++i)
+  for (size_type i=0; i<id.m(); ++i)
     (*this)(i,i) = 1.;
 
   return *this;
@@ -115,8 +120,8 @@ FullMatrix<number>::operator = (const LAPACKFullMatrix<number2> &M)
 {
   Assert (this->m() == M.n_rows(), ExcDimensionMismatch(this->m(), M.n_rows()));
   Assert (this->n() == M.n_cols(), ExcDimensionMismatch(this->n(), M.n_rows()));
-  for (unsigned int i=0; i<this->m(); ++i)
-    for (unsigned int j=0; j<this->n(); ++j)
+  for (size_type i=0; i<this->m(); ++i)
+    for (size_type j=0; j<this->n(); ++j)
       (*this)(i,j) = M(i,j);
 
   return *this;
@@ -199,11 +204,11 @@ FullMatrix<number>::vmult (Vector<number2> &dst,
   // avoid copying it when using the ()
   // operator
   const number2 *src_ptr = &(*const_cast<Vector<number2>*>(&src))(0);
-  const unsigned int size_m = m(), size_n = n();
-  for (unsigned int i=0; i<size_m; ++i)
+  const size_type size_m = m(), size_n = n();
+  for (size_type i=0; i<size_m; ++i)
     {
       number2 s = adding ? dst(i) : 0.;
-      for (unsigned int j=0; j<size_n; ++j)
+      for (size_type j=0; j<size_n; ++j)
         s += src_ptr[j] * number2(*(e++));
       dst(i) = s;
     }
@@ -226,19 +231,19 @@ void FullMatrix<number>::Tvmult (Vector<number2>       &dst,
 
   const number *e = &this->values[0];
   number2 *dst_ptr = &dst(0);
-  const unsigned int size_m = m(), size_n = n();
+  const size_type size_m = m(), size_n = n();
 
   // zero out data if we are not adding
   if (!adding)
-    for (unsigned int j=0; j<size_n; ++j)
+    for (size_type j=0; j<size_n; ++j)
       dst_ptr[j] = 0.;
 
   // write the loop in a way that we can
   // access the data contiguously
-  for (unsigned int i=0; i<size_m; ++i)
+  for (size_type i=0; i<size_m; ++i)
     {
       const number2 d = src(i);
-      for (unsigned int j=0; j<size_n; ++j)
+      for (size_type j=0; j<size_n; ++j)
         dst_ptr[j] += d * number2(*(e++));
     };
 }
@@ -259,12 +264,12 @@ number FullMatrix<number>::residual (Vector<number2> &dst,
   Assert (&src != &dst, ExcSourceEqualsDestination());
 
   number res = 0.;
-  const unsigned int size_m = m(),
-                     size_n = n();
-  for (unsigned int i=0; i<size_n; ++i)
+  const size_type size_m = m(),
+                  size_n = n();
+  for (size_type i=0; i<size_n; ++i)
     {
       number s = number(right(i));
-      for (unsigned int j=0; j<size_m; ++j)
+      for (size_type j=0; j<size_m; ++j)
         s -= number(src(j)) * (*this)(i,j);
       dst(i) = s;
       res += s*s;
@@ -284,8 +289,8 @@ void FullMatrix<number>::forward (Vector<number2>       &dst,
   Assert (dst.size() == m(), ExcDimensionMismatch(dst.size(), m()));
   Assert (src.size() == n(), ExcDimensionMismatch(src.size(), n()));
 
-  unsigned int i,j;
-  unsigned int nu = ( (m()<n()) ? m() : n());
+  size_type i,j;
+  size_type nu = ( (m()<n()) ? m() : n());
   for (i=0; i<nu; ++i)
     {
       number s = number(src(i));
@@ -305,8 +310,8 @@ void FullMatrix<number>::backward (Vector<number2>       &dst,
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  unsigned int j;
-  unsigned int nu = (m()<n() ? m() : n());
+  size_type j;
+  size_type nu = (m()<n() ? m() : n());
   for (int i=nu-1; i>=0; --i)
     {
       number2 s = src(i);
@@ -322,10 +327,10 @@ void FullMatrix<number>::backward (Vector<number2>       &dst,
 template <typename number>
 template <typename number2>
 void FullMatrix<number>::fill (const FullMatrix<number2> &src,
-                               const unsigned int dst_offset_i,
-                               const unsigned int dst_offset_j,
-                               const unsigned int src_offset_i,
-                               const unsigned int src_offset_j)
+                               const size_type dst_offset_i,
+                               const size_type dst_offset_j,
+                               const size_type src_offset_i,
+                               const size_type src_offset_j)
 {
   Assert (dst_offset_i < m(),
           ExcIndexRange (dst_offset_i, 0, m()));
@@ -337,13 +342,13 @@ void FullMatrix<number>::fill (const FullMatrix<number2> &src,
           ExcIndexRange (src_offset_j, 0, src.n()));
 
   // Compute maximal size of copied block
-  const unsigned int rows = std::min (m() - dst_offset_i,
-                                      src.m() - src_offset_i);
-  const unsigned int cols = std::min (n() - dst_offset_j,
-                                      src.n() - src_offset_j);
+  const size_type rows = std::min (m() - dst_offset_i,
+                                   src.m() - src_offset_i);
+  const size_type cols = std::min (n() - dst_offset_j,
+                                   src.n() - src_offset_j);
 
-  for (unsigned int i=0; i<rows ; ++i)
-    for (unsigned int j=0; j<cols ; ++j)
+  for (size_type i=0; i<rows ; ++i)
+    for (size_type j=0; j<cols ; ++j)
       (*this)(dst_offset_i+i,dst_offset_j+j)
         = src(src_offset_i+i,src_offset_j+j);
 }
@@ -352,16 +357,16 @@ void FullMatrix<number>::fill (const FullMatrix<number2> &src,
 template <typename number>
 template <typename number2>
 void FullMatrix<number>::fill_permutation (const FullMatrix<number2> &src,
-                                           const std::vector<unsigned int> &p_rows,
-                                           const std::vector<unsigned int> &p_cols)
+                                           const std::vector<size_type> &p_rows,
+                                           const std::vector<size_type> &p_cols)
 {
   Assert (p_rows.size() == this->n_rows(),
           ExcDimensionMismatch (p_rows.size(), this->n_rows()));
   Assert (p_cols.size() == this->n_cols(),
           ExcDimensionMismatch (p_cols.size(), this->n_cols()));
 
-  for (unsigned int i=0; i<this->n_rows(); ++i)
-    for (unsigned int j=0; j<this->n_cols(); ++j)
+  for (size_type i=0; i<this->n_rows(); ++i)
+    for (size_type j=0; j<this->n_cols(); ++j)
       (*this)(i,j) = src(p_rows[i], p_cols[j]);
 }
 
@@ -378,75 +383,75 @@ void FullMatrix<number>::fill_permutation (const FullMatrix<number2> &src,
 
 
 template <typename number>
-void FullMatrix<number>::add_row (const unsigned int i,
+void FullMatrix<number>::add_row (const size_type i,
                                   const number s,
-                                  const unsigned int j)
+                                  const size_type j)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int k=0; k<m(); ++k)
+  for (size_type k=0; k<m(); ++k)
     (*this)(i,k) += s*(*this)(j,k);
 }
 
 
 template <typename number>
-void FullMatrix<number>::add_row (const unsigned int i,
+void FullMatrix<number>::add_row (const size_type i,
                                   const number s,
-                                  const unsigned int j,
+                                  const size_type j,
                                   const number t,
-                                  const unsigned int k)
+                                  const size_type k)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  const unsigned int size_m = m();
-  for (unsigned int l=0; l<size_m; ++l)
+  const size_type size_m = m();
+  for (size_type l=0; l<size_m; ++l)
     (*this)(i,l) += s*(*this)(j,l) + t*(*this)(k,l);
 }
 
 
 template <typename number>
-void FullMatrix<number>::add_col (const unsigned int i, const number s,
-                                  const unsigned int j)
+void FullMatrix<number>::add_col (const size_type i, const number s,
+                                  const size_type j)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int k=0; k<n(); ++k)
+  for (size_type k=0; k<n(); ++k)
     (*this)(k,i) += s*(*this)(k,j);
 }
 
 
 template <typename number>
-void FullMatrix<number>::add_col (const unsigned int i, const number s,
-                                  const unsigned int j, const number t,
-                                  const unsigned int k)
+void FullMatrix<number>::add_col (const size_type i, const number s,
+                                  const size_type j, const number t,
+                                  const size_type k)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int l=0; l<n(); ++l)
+  for (size_t l=0; l<n(); ++l)
     (*this)(l,i) += s*(*this)(l,j) + t*(*this)(l,k);
 }
 
 
 
 template <typename number>
-void FullMatrix<number>::swap_row (const unsigned int i,
-                                   const unsigned int j)
+void FullMatrix<number>::swap_row (const size_type i,
+                                   const size_type j)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int k=0; k<n(); ++k)
+  for (size_type k=0; k<n(); ++k)
     std::swap ((*this)(i,k),
                (*this)(j,k));
 }
 
 
 template <typename number>
-void FullMatrix<number>::swap_col (const unsigned int i,
-                                   const unsigned int j)
+void FullMatrix<number>::swap_col (const size_type i,
+                                   const size_type j)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int k=0; k<m(); ++k)
+  for (size_type k=0; k<m(); ++k)
     std::swap ((*this)(k,i),
                (*this)(k,j));
 }
@@ -458,7 +463,7 @@ void FullMatrix<number>::diagadd (const number src)
   Assert (!this->empty(), ExcEmptyMatrix());
   Assert (m() == n(), ExcDimensionMismatch(m(),n()));
 
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     (*this)(i,i) += src;
 }
 
@@ -473,8 +478,8 @@ void FullMatrix<number>::equ (const number               a,
   Assert (m() == A.m(), ExcDimensionMismatch(m(), A.m()));
   Assert (n() == A.n(), ExcDimensionMismatch(n(), A.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j));
 }
 
@@ -494,8 +499,8 @@ FullMatrix<number>::equ (const number               a,
   Assert (m() == B.m(), ExcDimensionMismatch(m(), B.m()));
   Assert (n() == B.n(), ExcDimensionMismatch(n(), B.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j)) + b * number(B(i,j));
 }
 
@@ -519,8 +524,8 @@ FullMatrix<number>::equ (const number               a,
   Assert (m() == C.m(), ExcDimensionMismatch(m(), C.m()));
   Assert (n() == C.n(), ExcDimensionMismatch(n(), C.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j)) +
                      b * number(B(i,j)) +
                      c * number(C(i,j));
@@ -581,16 +586,16 @@ void FullMatrix<number>::mmult (FullMatrix<number2>       &dst,
 
 #endif
 
-  const unsigned int m = this->m(), n = src.n(), l = this->n();
+  const size_type m = this->m(), n = src.n(), l = this->n();
 
   // arrange the loops in a way that we keep write operations low, (writing is
   // usually more costly than reading), even though we need to access the data
   // in src not in a contiguous way.
-  for (unsigned int i=0; i<m; i++)
-    for (unsigned int j=0; j<n; j++)
+  for (size_type i=0; i<m; i++)
+    for (size_type j=0; j<n; j++)
       {
         number2 add_value = adding ? dst(i,j) : 0.;
-        for (unsigned int k=0; k<l; k++)
+        for (size_type k=0; k<l; k++)
           add_value += (number2)(*this)(i,k) * (number2)(src(k,j));
         dst(i,j) = add_value;
       }
@@ -652,15 +657,15 @@ void FullMatrix<number>::Tmmult (FullMatrix<number2>       &dst,
 
 #endif
 
-  const unsigned int m = n(), n = src.n(), l = this->m();
+  const size_type m = n(), n = src.n(), l = this->m();
 
   // symmetric matrix if the two matrices are the same
   if (PointerComparison::equal(this, &src))
-    for (unsigned int i=0; i<m; ++i)
-      for (unsigned int j=i; j<m; ++j)
+    for (size_type i=0; i<m; ++i)
+      for (size_type j=i; j<m; ++j)
         {
           number2 add_value = 0.;
-          for (unsigned int k=0; k<l; ++k)
+          for (size_type k=0; k<l; ++k)
             add_value += (number2)(*this)(k,i) * (number2)(*this)(k,j);
           if (adding)
             {
@@ -677,11 +682,11 @@ void FullMatrix<number>::Tmmult (FullMatrix<number2>       &dst,
   // optimized gemm operation in case the matrix is big, so this shouldn't be
   // too bad.
   else
-    for (unsigned int i=0; i<m; i++)
-      for (unsigned int j=0; j<n; j++)
+    for (size_type i=0; i<m; i++)
+      for (size_type j=0; j<n; j++)
         {
           number2 add_value = adding ? dst(i,j) : 0.;
-          for (unsigned int k=0; k<l; k++)
+          for (size_type k=0; k<l; k++)
             add_value += (number2)(*this)(k,i) * (number2)(src(k,j));
           dst(i,j) = add_value;
         }
@@ -742,15 +747,15 @@ void FullMatrix<number>::mTmult (FullMatrix<number2>       &dst,
 
 #endif
 
-  const unsigned int m = this->m(), n = src.m(), l = this->n();
+  const size_type m = this->m(), n = src.m(), l = this->n();
 
   // symmetric matrix if the two matrices are the same
   if (PointerComparison::equal(this, &src))
-    for (unsigned int i=0; i<m; ++i)
-      for (unsigned int j=i; j<m; ++j)
+    for (size_type i=0; i<m; ++i)
+      for (size_type j=i; j<m; ++j)
         {
           number2 add_value = 0.;
-          for (unsigned int k=0; k<l; ++k)
+          for (size_type k=0; k<l; ++k)
             add_value += (number2)(*this)(i,k) * (number2)(*this)(j,k);
           if (adding)
             {
@@ -764,11 +769,11 @@ void FullMatrix<number>::mTmult (FullMatrix<number2>       &dst,
   else
     // arrange the loops in a way that we keep write operations low, (writing is
     // usually more costly than reading).
-    for (unsigned int i=0; i<m; i++)
-      for (unsigned int j=0; j<n; j++)
+    for (size_type i=0; i<m; i++)
+      for (size_type j=0; j<n; j++)
         {
           number2 add_value = adding ? dst(i,j) : 0.;
-          for (unsigned int k=0; k<l; k++)
+          for (size_type k=0; k<l; k++)
             add_value += (number2)(*this)(i,k) * (number2)(src(j,k));
           dst(i,j) = add_value;
         }
@@ -829,18 +834,18 @@ void FullMatrix<number>::TmTmult (FullMatrix<number2>       &dst,
 
 #endif
 
-  const unsigned int m = n(), n = src.m(), l = this->m();
+  const size_type m = n(), n = src.m(), l = this->m();
 
   // arrange the loops in a way that we keep write operations low, (writing is
   // usually more costly than reading), even though we need to access the data
   // in the calling matrix in a non-contiguous way, possibly leading to cache
   // misses. However, we should usually end up in the optimized gemm operation
   // in case the matrix is big, so this shouldn't be too bad.
-  for (unsigned int i=0; i<m; i++)
-    for (unsigned int j=0; j<n; j++)
+  for (size_type i=0; i<m; i++)
+    for (size_type j=0; j<n; j++)
       {
         number2 add_value = adding ? dst(i,j) : 0.;
-        for (unsigned int k=0; k<l; k++)
+        for (size_type k=0; k<l; k++)
           add_value += (number2)(*this)(k,i) * (number2)(src(j,k));
         dst(i,j) = add_value;
       }
@@ -880,25 +885,25 @@ FullMatrix<number>::triple_product(
 
   // For all entries of the product
   // AD
-  for (unsigned int i=0; i<A.m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<A.m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       {
         // Compute the entry
         number ADij = 0.;
         if (transpose_D)
-          for (unsigned int k=0; k<A.n(); ++k)
+          for (size_type k=0; k<A.n(); ++k)
             ADij += A(i,k)*D(j,k);
         else
-          for (unsigned int k=0; k<A.n(); ++k)
+          for (size_type k=0; k<A.n(); ++k)
             ADij += A(i,k)*D(k,j);
         // And add it to this after
         // multiplying with the right
         // factor from B
         if (transpose_B)
-          for (unsigned int k=0; k<m(); ++k)
+          for (size_type k=0; k<m(); ++k)
             this->operator()(k,j) += scaling * ADij * B(i,k);
         else
-          for (unsigned int k=0; k<m(); ++k)
+          for (size_type k=0; k<m(); ++k)
             this->operator()(k,j) += scaling * ADij * B(k,i);
       }
 }
@@ -915,11 +920,11 @@ FullMatrix<number>::matrix_norm_square (const Vector<number2> &v) const
   Assert(n() == v.size(), ExcDimensionMismatch(n(),v.size()));
 
   number2 sum = 0.;
-  const unsigned int n_rows = m();
+  const size_type n_rows = m();
   const number *val_ptr = &this->values[0];
   const number2 *v_ptr;
 
-  for (unsigned int row=0; row<n_rows; ++row)
+  for (size_type row=0; row<n_rows; ++row)
     {
       number s = 0.;
       const number *const val_end_of_row = val_ptr+n_rows;
@@ -946,12 +951,12 @@ FullMatrix<number>::matrix_scalar_product (const Vector<number2> &u,
   Assert(n() == v.size(), ExcDimensionMismatch(n(),v.size()));
 
   number2 sum = 0.;
-  const unsigned int n_rows = m();
-  const unsigned int n_cols = n();
+  const size_type n_rows = m();
+  const size_type n_cols = n();
   const number *val_ptr = &this->values[0];
   const number2 *v_ptr;
 
-  for (unsigned int row=0; row<n_rows; ++row)
+  for (size_type row=0; row<n_rows; ++row)
     {
       number s = 0.;
       const number *const val_end_of_row = val_ptr+n_cols;
@@ -973,9 +978,9 @@ FullMatrix<number>::symmetrize ()
 {
   Assert (m() == n(), ExcNotQuadratic());
 
-  const unsigned int N = m();
-  for (unsigned int i=0; i<N; ++i)
-    for (unsigned int j=i+1; j<N; ++j)
+  const size_type N = m();
+  for (size_type i=0; i<N; ++i)
+    for (size_type j=i+1; j<N; ++j)
       {
         const number t = ((*this)(i,j) + (*this)(j,i)) / number(2.);
         (*this)(i,j) = (*this)(j,i) = t;
@@ -990,12 +995,12 @@ FullMatrix<number>::l1_norm () const
   Assert (!this->empty(), ExcEmptyMatrix());
 
   real_type sum=0, max=0;
-  const unsigned int n_rows = m(), n_cols = n();
+  const size_type n_rows = m(), n_cols = n();
 
-  for (unsigned int col=0; col<n_cols; ++col)
+  for (size_type col=0; col<n_cols; ++col)
     {
       sum=0;
-      for (unsigned int row=0; row<n_rows; ++row)
+      for (size_type row=0; row<n_rows; ++row)
         sum += std::abs((*this)(row,col));
       if (sum > max)
         max = sum;
@@ -1012,12 +1017,12 @@ FullMatrix<number>::linfty_norm () const
   Assert (!this->empty(), ExcEmptyMatrix());
 
   real_type sum=0, max=0;
-  const unsigned int n_rows = m(), n_cols = n();
+  const size_type n_rows = m(), n_cols = n();
 
-  for (unsigned int row=0; row<n_rows; ++row)
+  for (size_type row=0; row<n_rows; ++row)
     {
       sum=0;
-      for (unsigned int col=0; col<n_cols; ++col)
+      for (size_type col=0; col<n_cols; ++col)
         sum += std::abs((*this)(row,col));
       if (sum > max)
         max = sum;
@@ -1038,8 +1043,8 @@ FullMatrix<number>::add (const number               a,
   Assert (m() == A.m(), ExcDimensionMismatch(m(), A.m()));
   Assert (n() == A.n(), ExcDimensionMismatch(n(), A.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j));
 }
 
@@ -1059,8 +1064,8 @@ FullMatrix<number>::add (const number               a,
   Assert (m() == B.m(), ExcDimensionMismatch(m(), B.m()));
   Assert (n() == B.n(), ExcDimensionMismatch(n(), B.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j)) + b * number(B(i,j));
 }
 
@@ -1086,8 +1091,8 @@ FullMatrix<number>::add (const number               a,
   Assert (n() == C.n(), ExcDimensionMismatch(n(), C.n()));
 
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j)) +
                       b * number(B(i,j)) +
                       c * number(C(i,j));
@@ -1099,10 +1104,10 @@ template <typename number>
 template <typename number2>
 void FullMatrix<number>::add (const FullMatrix<number2> &src,
                               const number factor,
-                              const unsigned int dst_offset_i,
-                              const unsigned int dst_offset_j,
-                              const unsigned int src_offset_i,
-                              const unsigned int src_offset_j)
+                              const size_type dst_offset_i,
+                              const size_type dst_offset_j,
+                              const size_type src_offset_i,
+                              const size_type src_offset_j)
 {
   Assert (dst_offset_i < m(),
           ExcIndexRange (dst_offset_i, 0, m()));
@@ -1114,13 +1119,11 @@ void FullMatrix<number>::add (const FullMatrix<number2> &src,
           ExcIndexRange (src_offset_j, 0, src.n()));
 
   // Compute maximal size of copied block
-  const unsigned int rows = std::min (m() - dst_offset_i,
-                                      src.m() - src_offset_i);
-  const unsigned int cols = std::min (n() - dst_offset_j,
-                                      src.n() - src_offset_j);
+  const size_type rows = std::min (m() - dst_offset_i, src.m() - src_offset_i);
+  const size_type cols = std::min (n() - dst_offset_j, src.n() - src_offset_j);
 
-  for (unsigned int i=0; i<rows ; ++i)
-    for (unsigned int j=0; j<cols ; ++j)
+  for (size_type i=0; i<rows ; ++i)
+    for (size_type j=0; j<cols ; ++j)
       (*this)(dst_offset_i+i,dst_offset_j+j)
       += factor * number(src(src_offset_i+i,src_offset_j+j));
 }
@@ -1131,10 +1134,10 @@ template <typename number>
 template <typename number2>
 void FullMatrix<number>::Tadd (const FullMatrix<number2> &src,
                                const number factor,
-                               const unsigned int dst_offset_i,
-                               const unsigned int dst_offset_j,
-                               const unsigned int src_offset_i,
-                               const unsigned int src_offset_j)
+                               const size_type dst_offset_i,
+                               const size_type dst_offset_j,
+                               const size_type src_offset_i,
+                               const size_type src_offset_j)
 {
   Assert (dst_offset_i < m(),
           ExcIndexRange (dst_offset_i, 0, m()));
@@ -1146,14 +1149,13 @@ void FullMatrix<number>::Tadd (const FullMatrix<number2> &src,
           ExcIndexRange (src_offset_j, 0, src.m()));
 
   // Compute maximal size of copied block
-  const unsigned int rows = std::min (m() - dst_offset_i,
-                                      src.n() - src_offset_j);
-  const unsigned int cols = std::min (n() - dst_offset_j,
-                                      src.m() - src_offset_i);
+  const size_type rows = std::min (m() - dst_offset_i, src.n() - src_offset_j);
+  const size_type cols = std::min (n() - dst_offset_j,
+                                   src.m() - src_offset_i);
 
 
-  for (unsigned int i=0; i<rows ; ++i)
-    for (unsigned int j=0; j<cols ; ++j)
+  for (size_type i=0; i<rows ; ++i)
+    for (size_type j=0; j<cols ; ++j)
       (*this)(dst_offset_i+i,dst_offset_j+j)
       += factor * number(src(src_offset_i+j,src_offset_j+i));
 }
@@ -1172,8 +1174,8 @@ FullMatrix<number>::Tadd (const number a,
   Assert (m() == A.m(), ExcDimensionMismatch(m(), A.m()));
   Assert (n() == A.n(), ExcDimensionMismatch(n(), A.n()));
 
-  for (unsigned int i=0; i<n(); ++i)
-    for (unsigned int j=0; j<m(); ++j)
+  for (size_type i=0; i<n(); ++i)
+    for (size_type j=0; j<m(); ++j)
       (*this)(i,j) += a * number(A(j,i));
 }
 
@@ -1227,7 +1229,7 @@ FullMatrix<number>::trace () const
           ExcDimensionMismatch(this->n_cols(), this->n_rows()));
 
   number tr = 0;
-  for (unsigned int i=0; i<this->n_rows(); ++i)
+  for (size_type i=0; i<this->n_rows(); ++i)
     tr += (*this)(i,i);
 
   return tr;
@@ -1242,7 +1244,7 @@ FullMatrix<number>::frobenius_norm () const
   Assert (!this->empty(), ExcEmptyMatrix());
 
   real_type s = 0.;
-  for (unsigned int i=0; i<this->n_rows()*this->n_cols(); ++i)
+  for (size_type i=0; i<this->n_rows()*this->n_cols(); ++i)
     s += numbers::NumberTraits<number>::abs_square(this->values[i]);
   return std::sqrt(s);
 }
@@ -1257,8 +1259,8 @@ FullMatrix<number>::relative_symmetry_norm2 () const
 
   real_type s = 0.;
   real_type a = 0.;
-  for (unsigned int i=0; i<this->n_rows(); ++i)
-    for (unsigned int j=0; j<this->n_cols(); ++j)
+  for (size_type i=0; i<this->n_rows(); ++i)
+    for (size_type j=0; j<this->n_cols(); ++j)
       {
         const number x_ij = (*this)(i,j);
         const number x_ji = (*this)(j,i);
@@ -1472,13 +1474,13 @@ FullMatrix<number>::cholesky (const FullMatrix<number2> &A)
       this->reinit(A.m(), A.n());
 
       double SLik2 = 0.0, SLikLjk = 0.0;
-      for (unsigned int i=0; i< this->n_cols(); i++)
+      for (size_type i=0; i< this->n_cols(); i++)
         {
           SLik2 = 0.0;
-          for (unsigned int j = 0; j < i; j++)
+          for (size_type j = 0; j < i; j++)
             {
               SLikLjk = 0.0;
-              for (unsigned int k =0; k<j; k++)
+              for (size_type k =0; k<j; k++)
                 {
                   SLikLjk += (*this)(i,k)*(*this)(j,k);
                 };
@@ -1503,9 +1505,9 @@ FullMatrix<number>::outer_product (const Vector<number2> &V,
   Assert (V.size() == W.size(), ExcMessage("Vectors V, W must be the same size."));
   this->reinit(V.size(), V.size());
 
-  for (unsigned int i = 0; i<this->n(); i++)
+  for (size_type i = 0; i<this->n(); i++)
     {
-      for (unsigned int j = 0; j< this->n(); j++)
+      for (size_type j = 0; j< this->n(); j++)
         {
           (*this)(i,j) = V(i)*W(j);
         }
@@ -1574,12 +1576,12 @@ template <typename number>
 template <int dim>
 void
 FullMatrix<number>::copy_from (const Tensor<2,dim> &T,
-                               const unsigned int src_r_i,
-                               const unsigned int src_r_j,
-                               const unsigned int src_c_i,
-                               const unsigned int src_c_j,
-                               const unsigned int dst_r,
-                               const unsigned int dst_c)
+                               const size_type src_r_i,
+                               const size_type src_r_j,
+                               const size_type src_c_i,
+                               const size_type src_c_j,
+                               const size_type dst_r,
+                               const size_type dst_c)
 {
 
   Assert (!this->empty(), ExcEmptyMatrix());
@@ -1592,8 +1594,8 @@ FullMatrix<number>::copy_from (const Tensor<2,dim> &T,
   Assert(src_r_j>=src_r_i, ExcIndexRange(src_r_j,0,src_r_i));
   Assert(src_c_j>=src_c_i, ExcIndexRange(src_r_j,0,src_r_i));
 
-  for (unsigned int i=0; i<src_r_j-src_r_i+1; i++)
-    for (unsigned int j=0; j<src_c_j-src_c_i+1; j++)
+  for (size_type i=0; i<src_r_j-src_r_i+1; i++)
+    for (size_type j=0; j<src_c_j-src_c_i+1; j++)
       (*this)(i+dst_r,j+dst_c) = number(T[i+src_r_i][j+src_c_i]);
 
 }
@@ -1603,12 +1605,12 @@ template <typename number>
 template <int dim>
 void
 FullMatrix<number>::copy_to (Tensor<2,dim> &T,
-                             const unsigned int src_r_i,
-                             const unsigned int src_r_j,
-                             const unsigned int src_c_i,
-                             const unsigned int src_c_j,
-                             const unsigned int dst_r,
-                             const unsigned int dst_c) const
+                             const size_type src_r_i,
+                             const size_type src_r_j,
+                             const size_type src_c_i,
+                             const size_type src_c_j,
+                             const size_type dst_r,
+                             const size_type dst_c) const
 {
   Assert (!this->empty(), ExcEmptyMatrix());
   Assert(dim-dst_r>src_r_j-src_r_i,
@@ -1621,8 +1623,8 @@ FullMatrix<number>::copy_to (Tensor<2,dim> &T,
   Assert(src_c_j>=src_c_i, ExcIndexRange(src_r_j,0,src_r_i));
 
 
-  for (unsigned int i=0; i<src_r_j-src_r_i+1; i++)
-    for (unsigned int j=0; j<src_c_j-src_c_i+1; j++)
+  for (size_type i=0; i<src_r_j-src_r_i+1; i++)
+    for (size_type j=0; j<src_c_j-src_c_i+1; j++)
       T[i+dst_r][j+dst_c] = double ((*this)(i+src_r_i,j+src_c_i));
 }
 
@@ -1639,12 +1641,12 @@ FullMatrix<number>::precondition_Jacobi (Vector<somenumber>       &dst,
   Assert (dst.size() == n(), ExcDimensionMismatch (dst.size(), n()));
   Assert (src.size() == n(), ExcDimensionMismatch (src.size(), n()));
 
-  const unsigned int n = src.size();
-  somenumber              *dst_ptr = dst.begin();
-  const somenumber        *src_ptr = src.begin();
+  const size_t n = src.size();
+  somenumber       *dst_ptr = dst.begin();
+  const somenumber *src_ptr = src.begin();
 
-  for (unsigned int i=0; i<n; ++i, ++dst_ptr, ++src_ptr)
-    *dst_ptr = somenumber(om) * *src_ptr / somenumber((*this)(i,i));
+  for (size_type i=0; i<n; ++i, ++dst_ptr, ++src_ptr)
+    *dst_ptr = somenumber(om) **src_ptr / somenumber((*this)(i,i));
 }
 
 
@@ -1683,9 +1685,9 @@ FullMatrix<number>::print_formatted (
         width = precision+2;
     }
 
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      for (unsigned int j=0; j<n(); ++j)
+      for (size_type j=0; j<n(); ++j)
         if (std::abs((*this)(i,j)) > threshold)
           out << std::setw(width)
               << (*this)(i,j) * number(denominator) << ' ';
@@ -1772,7 +1774,7 @@ FullMatrix<number>::gauss_jordan ()
   // Gauss-Jordan-Algorithmus from
   // Stoer & Bulirsch I (4th Edition)
   // p. 153
-  const unsigned int N = n();
+  const size_type N = n();
 
   // first get an estimate of the
   // size of the elements of this
@@ -1782,26 +1784,26 @@ FullMatrix<number>::gauss_jordan ()
   // fear that the matrix is not
   // regular
   double diagonal_sum = 0;
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     diagonal_sum += std::abs((*this)(i,i));
   const double typical_diagonal_element = diagonal_sum/N;
 
   // initialize the array that holds
   // the permutations that we find
   // during pivot search
-  std::vector<unsigned int> p(N);
-  for (unsigned int i=0; i<N; ++i)
+  std::vector<size_type> p(N);
+  for (size_type i=0; i<N; ++i)
     p[i] = i;
 
-  for (unsigned int j=0; j<N; ++j)
+  for (size_type j=0; j<N; ++j)
     {
       // pivot search: search that
       // part of the line on and
       // right of the diagonal for
       // the largest element
       real_type max = std::abs((*this)(j,j));
-      unsigned int r   = j;
-      for (unsigned int i=j+1; i<N; ++i)
+      size_type r   = j;
+      for (size_type i=j+1; i<N; ++i)
         {
           if (std::abs((*this)(i,j)) > max)
             {
@@ -1817,7 +1819,7 @@ FullMatrix<number>::gauss_jordan ()
       // row interchange
       if (r>j)
         {
-          for (unsigned int k=0; k<N; ++k)
+          for (size_type k=0; k<N; ++k)
             std::swap ((*this)(j,k), (*this)(r,k));
 
           std::swap (p[j], p[r]);
@@ -1826,16 +1828,16 @@ FullMatrix<number>::gauss_jordan ()
       // transformation
       const number hr = number(1.)/(*this)(j,j);
       (*this)(j,j) = hr;
-      for (unsigned int k=0; k<N; ++k)
+      for (size_type k=0; k<N; ++k)
         {
           if (k==j) continue;
-          for (unsigned int i=0; i<N; ++i)
+          for (size_type i=0; i<N; ++i)
             {
               if (i==j) continue;
               (*this)(i,k) -= (*this)(i,j)*(*this)(j,k)*hr;
             }
         }
-      for (unsigned int i=0; i<N; ++i)
+      for (size_type i=0; i<N; ++i)
         {
           (*this)(i,j) *= hr;
           (*this)(j,i) *= -hr;
@@ -1844,11 +1846,11 @@ FullMatrix<number>::gauss_jordan ()
     }
   // column interchange
   std::vector<number> hv(N);
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
-      for (unsigned int k=0; k<N; ++k)
+      for (size_type k=0; k<N; ++k)
         hv[p[k]] = (*this)(i,k);
-      for (unsigned int k=0; k<N; ++k)
+      for (size_type k=0; k<N; ++k)
         (*this)(i,k) = hv[k];
     }
 }
diff --git a/deal.II/include/deal.II/lac/generic_linear_algebra.h b/deal.II/include/deal.II/lac/generic_linear_algebra.h
new file mode 100644 (file)
index 0000000..693d1b4
--- /dev/null
@@ -0,0 +1,239 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2008 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+#ifndef __deal2__generic_linear_algebra_h
+#define __deal2__generic_linear_algebra_h
+
+#include <deal.II/base/config.h>
+
+
+#include <deal.II/lac/vector.h>
+#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/sparse_matrix.h>
+#include <deal.II/lac/precondition.h>
+DEAL_II_NAMESPACE_OPEN
+
+
+namespace LinearAlgebraDealII
+{
+  typedef Vector<double> Vector;
+  typedef BlockVector<double> BlockVector;
+
+  typedef SparseMatrix<double> SparseMatrix;
+
+  typedef PreconditionSSOR<SparseMatrix > PreconditionSSOR;
+
+}
+
+
+// Dummy class. This used to check your program
+// to make sure it is compatible with all
+// linear algebra classes. In other words,
+// this is the minimal interface.
+// TODO: should we move this into tests/ only?
+namespace LinearAlgebraDummy
+{
+  class Vector
+  {
+    void compress();
+  };
+  class BlockVector
+  {
+    void compress();
+  };
+
+  class SparseMatrix
+  {
+    void compress();
+  };
+
+  class PreconditionSSOR {};
+
+}
+
+
+DEAL_II_NAMESPACE_CLOSE
+
+
+#ifdef DEAL_II_USE_PETSC
+
+#include <deal.II/lac/block_sparsity_pattern.h>
+#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_sparse_matrix.h>
+#include <deal.II/lac/petsc_sparse_matrix.h>
+#include <deal.II/lac/petsc_parallel_block_sparse_matrix.h>
+#include <deal.II/lac/petsc_precondition.h>
+#include <deal.II/lac/petsc_solver.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+namespace LinearAlgebraPETSc
+{
+  using namespace dealii;
+
+  typedef PETScWrappers::Vector Vector;
+  typedef PETScWrappers::BlockVector BlockVector;
+
+  typedef PETScWrappers::SparseMatrix SparseMatrix;
+  typedef PETScWrappers::PreconditionSSOR PreconditionSSOR;
+
+  typedef PETScWrappers::SolverCG SolverCG;
+
+
+  namespace MPI
+  {
+
+    /**
+     * Typedef for the vector type used.
+     */
+    typedef PETScWrappers::MPI::Vector Vector;
+
+    /**
+     * Typedef for the type used to describe vectors that
+     * consist of multiple blocks.
+     */
+    typedef PETScWrappers::MPI::BlockVector BlockVector;
+
+    /**
+     * Typedef for the sparse matrix type used.
+     */
+    typedef PETScWrappers::MPI::SparseMatrix SparseMatrix;
+
+    /**
+     * Typedef for the type used to describe sparse matrices that
+     * consist of multiple blocks.
+     */
+    typedef PETScWrappers::MPI::BlockSparseMatrix BlockSparseMatrix;
+
+    typedef dealii::BlockCompressedSimpleSparsityPattern CompressedBlockSparsityPattern;
+
+    /**
+     * Typedef for the AMG preconditioner type used for the
+     * top left block of the Stokes matrix.
+     */
+    typedef PETScWrappers::PreconditionBoomerAMG PreconditionAMG;
+
+    /**
+     * Typedef for the Incomplete Cholesky preconditioner used
+     * for other blocks of the system matrix.
+     */
+    typedef PETScWrappers::PreconditionICC PreconditionIC;
+
+    /**
+     * Typedef for the Incomplete LU decomposition preconditioner used
+     * for other blocks of the system matrix.
+     */
+    typedef PETScWrappers::PreconditionILU PreconditionILU;
+
+    /**
+     * Typedef for the Incomplete Jacobi decomposition preconditioner used
+     * for other blocks of the system matrix.
+     */
+    typedef PETScWrappers::PreconditionJacobi PreconditionJacobi;
+
+  }
+
+}
+DEAL_II_NAMESPACE_CLOSE
+
+
+#endif // DEAL_II_USE_PETSC
+
+#ifdef DEAL_II_USE_TRILINOS
+
+#include <deal.II/lac/trilinos_vector.h>
+#include <deal.II/lac/trilinos_block_vector.h>
+#include <deal.II/lac/trilinos_block_sparse_matrix.h>
+#include <deal.II/lac/trilinos_sparse_matrix.h>
+#include <deal.II/lac/trilinos_precondition.h>
+#include <deal.II/lac/block_sparsity_pattern.h>
+#include <deal.II/lac/trilinos_solver.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+namespace LinearAlgebraTrilinos
+{
+  using namespace dealii;
+
+  typedef TrilinosWrappers::Vector Vector;
+
+  typedef TrilinosWrappers::SolverCG SolverCG;
+
+  namespace MPI
+  {
+
+    /**
+     * Typedef for the vector type used.
+     */
+    typedef TrilinosWrappers::MPI::Vector Vector;
+
+    /**
+     * Typedef for the type used to describe vectors that
+     * consist of multiple blocks.
+     */
+    typedef TrilinosWrappers::MPI::BlockVector BlockVector;
+
+    /**
+     * Typedef for the sparse matrix type used.
+     */
+    typedef TrilinosWrappers::SparseMatrix SparseMatrix;
+
+    /**
+     * Typedef for the type used to describe sparse matrices that
+     * consist of multiple blocks.
+     */
+    typedef TrilinosWrappers::BlockSparseMatrix BlockSparseMatrix;
+
+    typedef TrilinosWrappers::BlockSparsityPattern CompressedBlockSparsityPattern;
+
+    /**
+     * Typedef for the AMG preconditioner type used for the
+     * top left block of the Stokes matrix.
+     */
+    typedef TrilinosWrappers::PreconditionAMG PreconditionAMG;
+
+    /**
+     * Typedef for the Incomplete Cholesky preconditioner used
+     * for other blocks of the system matrix.
+     */
+    typedef TrilinosWrappers::PreconditionIC PreconditionIC;
+
+    /**
+     * Typedef for the Incomplete LU decomposition preconditioner used
+     * for other blocks of the system matrix.
+     */
+    typedef TrilinosWrappers::PreconditionILU PreconditionILU;
+
+    /**
+     * Typedef for the Incomplete Jacobi decomposition preconditioner used
+     * for other blocks of the system matrix.
+     */
+    typedef TrilinosWrappers::PreconditionJacobi PreconditionJacobi;
+
+
+  }
+
+}
+
+DEAL_II_NAMESPACE_CLOSE
+
+
+#endif // DEAL_II_USE_TRILINOS
+
+
+
+#endif
index 22a531b95c59f914689d504a071b117d73cd7423..233a48ca88e98f12270f88bc91ea1175efa93834 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__householder_h
 #define __deal2__householder_h
 
@@ -51,6 +56,11 @@ template<typename number>
 class Householder : private FullMatrix<number>
 {
 public:
+  /**
+   * Declare type of container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Create an empty object.
    */
@@ -139,7 +149,7 @@ template <typename number2>
 void
 Householder<number>::initialize(const FullMatrix<number2> &M)
 {
-  const unsigned int m = M.n_rows(), n = M.n_cols();
+  const size_type m = M.n_rows(), n = M.n_cols();
   this->reinit(m, n);
   this->fill(M);
   Assert (!this->empty(), typename FullMatrix<number2>::ExcEmptyMatrix());
@@ -149,10 +159,10 @@ Householder<number>::initialize(const FullMatrix<number2> &M)
   Assert (this->n_cols() <= this->n_rows(),
           ExcDimensionMismatch(this->n_cols(), this->n_rows()));
 
-  for (unsigned int j=0 ; j<n ; ++j)
+  for (size_type j=0 ; j<n ; ++j)
     {
       number2 sigma = 0;
-      unsigned int i;
+      size_type i;
       // sigma = ||v||^2
       for (i=j ; i<m ; ++i)
         sigma += this->el(i,j)*this->el(i,j);
@@ -176,7 +186,7 @@ Householder<number>::initialize(const FullMatrix<number2> &M)
 
       // For all subsequent columns do
       // the Householder reflexion
-      for (unsigned int k=j+1 ; k<n ; ++k)
+      for (size_type k=j+1 ; k<n ; ++k)
         {
           number2 sum = diagonal[j]*this->el(j,k);
           for (i=j+1 ; i<m ; ++i)
@@ -208,7 +218,7 @@ Householder<number>::least_squares (Vector<number2> &dst,
   AssertDimension(dst.size(), this->n());
   AssertDimension(src.size(), this->m());
 
-  const unsigned int m = this->m(), n = this->n();
+  const size_type m = this->m(), n = this->n();
 
   GrowingVectorMemory<Vector<number2> > mem;
   Vector<number2> *aux = mem.alloc();
@@ -218,20 +228,20 @@ Householder<number>::least_squares (Vector<number2> &dst,
 
   // Multiply Q_n ... Q_2 Q_1 src
   // Where Q_i = I-v_i v_i^T
-  for (unsigned int j=0; j<n; ++j)
+  for (size_type j=0; j<n; ++j)
     {
       // sum = v_i^T dst
       number2 sum = diagonal[j]* (*aux)(j);
-      for (unsigned int i=j+1 ; i<m ; ++i)
-        sum += this->el(i,j)*(*aux)(i);
+      for (size_type i=j+1 ; i<m ; ++i)
+        sum += static_cast<number2>(this->el(i,j))*(*aux)(i);
       // dst -= v * sum
       (*aux)(j) -= sum*diagonal[j];
-      for (unsigned int i=j+1 ; i<m ; ++i)
-        (*aux)(i) -= sum*this->el(i,j);
+      for (size_type i=j+1 ; i<m ; ++i)
+        (*aux)(i) -= sum*static_cast<number2>(this->el(i,j));
     }
   // Compute norm of residual
   number2 sum = 0.;
-  for (unsigned int i=n ; i<m ; ++i)
+  for (size_type i=n ; i<m ; ++i)
     sum += (*aux)(i) * (*aux)(i);
   Assert(numbers::is_finite(sum), ExcNumberNotFinite());
 
@@ -253,7 +263,7 @@ Householder<number>::least_squares (BlockVector<number2> &dst,
   AssertDimension(dst.size(), this->n());
   AssertDimension(src.size(), this->m());
 
-  const unsigned int m = this->m(), n = this->n();
+  const size_type m = this->m(), n = this->n();
 
   GrowingVectorMemory<BlockVector<number2> > mem;
   BlockVector<number2> *aux = mem.alloc();
@@ -263,20 +273,20 @@ Householder<number>::least_squares (BlockVector<number2> &dst,
 
   // Multiply Q_n ... Q_2 Q_1 src
   // Where Q_i = I-v_i v_i^T
-  for (unsigned int j=0; j<n; ++j)
+  for (size_type j=0; j<n; ++j)
     {
       // sum = v_i^T dst
       number2 sum = diagonal[j]* (*aux)(j);
-      for (unsigned int i=j+1 ; i<m ; ++i)
+      for (size_type i=j+1 ; i<m ; ++i)
         sum += this->el(i,j)*(*aux)(i);
       // dst -= v * sum
       (*aux)(j) -= sum*diagonal[j];
-      for (unsigned int i=j+1 ; i<m ; ++i)
+      for (size_type i=j+1 ; i<m ; ++i)
         (*aux)(i) -= sum*this->el(i,j);
     }
   // Compute norm of residual
   number2 sum = 0.;
-  for (unsigned int i=n ; i<m ; ++i)
+  for (size_type i=n ; i<m ; ++i)
     sum += (*aux)(i) * (*aux)(i);
   Assert(numbers::is_finite(sum), ExcNumberNotFinite());
 
index a29e08c486c9b4cf9476e989e596c41eaf8a5e9e..c54dbbc4fedc31f7866d1afcfe416cede182ae76 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__identity_matrix_h
 #define __deal2__identity_matrix_h
 
@@ -69,6 +74,11 @@ DEAL_II_NAMESPACE_OPEN
 class IdentityMatrix
 {
 public:
+  /**
+   * Declate type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Default constructor. Creates a
    * zero-sized matrix that should
@@ -81,13 +91,13 @@ public:
    * Constructor. Creates a
    * identity matrix of size #n.
    */
-  IdentityMatrix (const unsigned int n);
+  IdentityMatrix (const size_type n);
 
   /**
    * Resize the matrix to be of
    * size #n by #n.
    */
-  void reinit (const unsigned int n);
+  void reinit (const size_type n);
 
   /**
    * Number of rows of this
@@ -95,7 +105,7 @@ public:
    * matrix, the number of rows and
    * columns are equal, of course.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Number of columns of this
@@ -103,7 +113,7 @@ public:
    * matrix, the number of rows and
    * columns are equal, of course.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Matrix-vector
@@ -160,7 +170,7 @@ private:
    * Number of rows and columns of
    * this matrix.
    */
-  unsigned int size;
+  size_type size;
 };
 
 
@@ -179,7 +189,7 @@ IdentityMatrix::IdentityMatrix ()
 
 
 inline
-IdentityMatrix::IdentityMatrix (const unsigned int n)
+IdentityMatrix::IdentityMatrix (const size_type n)
   :
   size (n)
 {}
@@ -188,7 +198,7 @@ IdentityMatrix::IdentityMatrix (const unsigned int n)
 
 inline
 void
-IdentityMatrix::reinit (const unsigned int n)
+IdentityMatrix::reinit (const size_type n)
 {
   size = n;
 }
@@ -196,7 +206,7 @@ IdentityMatrix::reinit (const unsigned int n)
 
 
 inline
-unsigned int
+IdentityMatrix::size_type
 IdentityMatrix::m () const
 {
   return size;
@@ -205,7 +215,7 @@ IdentityMatrix::m () const
 
 
 inline
-unsigned int
+IdentityMatrix::size_type
 IdentityMatrix::n () const
 {
   return size;
index a93dd3369d3ea3fa8daf90cf9c76c6ab660179de..db8fdb8a13d03af2c8324b01b3f421fe3138079c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__iterative_inverse_h
 #define __deal2__iterative_inverse_h
 
index 66c415e0e5c11229ceb7c0826ce4ddd9ac166f34..b6000c48e5038e526d80aaaa9f0f6c9a86cc8632 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2008, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__lapack_full_matrix_h
 #define __deal2__lapack_full_matrix_h
 
@@ -49,6 +54,11 @@ template <typename number>
 class LAPACKFullMatrix : public TransposeTable<number>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. Initialize the
    * matrix as a square matrix with
@@ -63,15 +73,15 @@ public:
    * By default, no memory is
    * allocated.
    */
-  explicit LAPACKFullMatrix (const unsigned int n = 0);
+  explicit LAPACKFullMatrix (const size_type n = 0);
 
   /**
    * Constructor. Initialize the
    * matrix as a rectangular
    * matrix.
    */
-  LAPACKFullMatrix (const unsigned int rows,
-                    const unsigned int cols);
+  LAPACKFullMatrix (const size_type rows,
+                    const size_type cols);
 
   /**
    * Copy constructor. This
@@ -158,10 +168,10 @@ public:
    */
   template<class MATRIX>
   void fill (const MATRIX &src,
-             const unsigned int dst_offset_i = 0,
-             const unsigned int dst_offset_j = 0,
-             const unsigned int src_offset_i = 0,
-             const unsigned int src_offset_j = 0,
+             const size_type dst_offset_i = 0,
+             const size_type dst_offset_j = 0,
+             const size_type src_offset_i = 0,
+             const size_type src_offset_j = 0,
              const number factor = 1.,
              const bool transpose = false);
 
@@ -526,7 +536,7 @@ public:
    * called.
    */
   std::complex<number>
-  eigenvalue (const unsigned int i) const;
+  eigenvalue (const size_type i) const;
 
   /**
    * Retrieve singular values after
@@ -535,7 +545,7 @@ public:
    * called.
    */
   number
-  singular_value (const unsigned int i) const;
+  singular_value (const size_type i) const;
 
   /**
    * Print the matrix and allow
@@ -709,11 +719,11 @@ LAPACKFullMatrix<number>::copy_from (const MATRIX &M)
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class, and
   // copy them into the current object
-  for (unsigned int row = 0; row < M.m(); ++row)
+  for (size_type row = 0; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
-          entry != end_row; ++entry)
+           entry != end_row; ++entry)
         this->el(row, entry->column()) = entry->value();
     }
 
@@ -727,26 +737,26 @@ template <class MATRIX>
 inline void
 LAPACKFullMatrix<number>::fill (
   const MATRIX &M,
-  const unsigned int dst_offset_i,
-  const unsigned int dst_offset_j,
-  const unsigned int src_offset_i,
-  const unsigned int src_offset_j,
+  const size_type dst_offset_i,
+  const size_type dst_offset_j,
+  const size_type src_offset_i,
+  const size_type src_offset_j,
   const number factor,
   const bool transpose)
 {
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class
-  for (unsigned int row = src_offset_i; row < M.m(); ++row)
+  for (size_type row = src_offset_i; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
-          entry != end_row; ++entry)
+           entry != end_row; ++entry)
         {
-          const unsigned int i = transpose ? entry->column() : row;
-          const unsigned int j = transpose ? row : entry->column();
+          const size_type i = transpose ? entry->column() : row;
+          const size_type j = transpose ? row : entry->column();
 
-          const unsigned int dst_i=dst_offset_i+i-src_offset_i;
-          const unsigned int dst_j=dst_offset_j+j-src_offset_j;
+          const size_type dst_i=dst_offset_i+i-src_offset_i;
+          const size_type dst_j=dst_offset_j+j-src_offset_j;
           if (dst_i<this->n_rows() && dst_j<this->n_cols())
             (*this)(dst_i, dst_j) = factor * entry->value();
         }
@@ -794,7 +804,7 @@ LAPACKFullMatrix<number>::Tvmult_add(VECTOR &, const VECTOR &) const
 
 template <typename number>
 inline std::complex<number>
-LAPACKFullMatrix<number>::eigenvalue (const unsigned int i) const
+LAPACKFullMatrix<number>::eigenvalue (const size_type i) const
 {
   Assert (state & LAPACKSupport::eigenvalues, ExcInvalidState());
   Assert (wr.size() == this->n_rows(), ExcInternalError());
@@ -807,7 +817,7 @@ LAPACKFullMatrix<number>::eigenvalue (const unsigned int i) const
 
 template <typename number>
 inline number
-LAPACKFullMatrix<number>::singular_value (const unsigned int i) const
+LAPACKFullMatrix<number>::singular_value (const size_type i) const
 {
   Assert (state == LAPACKSupport::svd || state == LAPACKSupport::inverse_svd, LAPACKSupport::ExcState(state));
   AssertIndexRange(i,wr.size());
index 1208987f37a688abfed3b2d32b688603f6d12f00..a675f9820c749624951e45b94c08d46dd02a0d02 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__lapack_support_h
 #define __deal2__lapack_support_h
 
index 5f37ef6c671c652e265bd428510a141334edf6e9..ddebfbdf03a4dbf2417f6d0ae25fb9d90316e7e7 100644 (file)
@@ -1,16 +1,19 @@
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file was automatically generated from lapack_templates.h.in
-//    See blastemplates in the deal.II contrib directory
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 by the deal authors
+// This file is part of the deal.II library.
 //
-//    This file is subject to QPL and may not be distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
 //
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+
 
 #ifndef __LAPACK_TEMPLATES_H
 #define __LAPACK_TEMPLATES_H
index e2eb43ef722fa8bdfa2fc85d03beafafb81875fb..f6542c8bcf20fba5d84817279e64d04e22a7202f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__matrix_block_h
 #define __deal2__matrix_block_h
 
@@ -48,7 +53,7 @@ namespace internal
  * system. Using the add() functions of this class, it is possible to
  * use the standard assembling functions used for block matrices, but
  * only enter in one of the blocks and still avoiding the index
- * computations innvolved.
+ * computations involved.
 
  * The reason for this class is, that we may need a different number
  * of matrices for different blocks in a block system. For example, a
@@ -77,7 +82,7 @@ namespace internal
  *
  * BlockMatrixArray matrix (n_blocks, n_blocks);
  *
- * for (unsigned int i=0;i<blocks.size;++i)
+ * for (size_type i=0;i<blocks.size;++i)
  *   matrix.enter(blocks.block(i).row, blocks.block(i).column, blocks.matrix(i));
  * @endcode
  *
@@ -101,6 +106,11 @@ class MatrixBlock
   : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor rendering an
    * uninitialized object.
@@ -118,12 +128,12 @@ public:
    * initializing the matrix.
    */
 
-  MatrixBlock(unsigned int i, unsigned int j);
+  MatrixBlock(size_type i, size_type j);
 
   /**
    * Reinitialize the matrix for a
    * new BlockSparsityPattern. This
-   * adujusts the #matrix as well
+   * adjusts the #matrix as well
    * as the #row_indices and
    * #column_indices.
    *
@@ -143,8 +153,8 @@ public:
    * exist or if it is in a
    * different block.
    */
-  void add (const unsigned int i,
-            const unsigned int j,
+  void add (const size_type i,
+            const size_type j,
             const typename MATRIX::value_type value);
 
   /**
@@ -178,9 +188,9 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const std::vector<unsigned int> &indices,
-            const FullMatrix<number>        &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &indices,
+            const FullMatrix<number>     &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add all elements in a
@@ -212,8 +222,8 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
+  void add (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
             const FullMatrix<number>        &full_matrix,
             const bool                       elide_zero_values = true);
 
@@ -252,10 +262,10 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const unsigned int               row_index,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number>       &values,
-            const bool                       elide_zero_values = true);
+  void add (const size_type               row_index,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number>    &values,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add an array of values given by
@@ -275,12 +285,12 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number       *values,
-            const bool          elide_zero_values = true,
-            const bool          col_indices_are_sorted = false);
+  void add (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number    *values,
+            const bool       elide_zero_values = true,
+            const bool       col_indices_are_sorted = false);
 
   /**
    * Matrix-vector-multiplication,
@@ -338,7 +348,7 @@ public:
    * the block coordinates stored
    * in this object.
    */
-  DeclException2(ExcBlockIndexMismatch, unsigned int, unsigned int,
+  DeclException2(ExcBlockIndexMismatch, size_type, size_type,
                  << "Block index " << arg1 << " does not match " << arg2);
 
   /**
@@ -346,14 +356,14 @@ public:
    * position of the data member
    * matrix on the global matrix.
    */
-  unsigned int row;
+  size_type row;
   /**
    * Column coordinate.  This is
    * the position of the data
    * member matrix on the global
    * matrix.
    */
-  unsigned int column;
+  size_type column;
 
   /**
    * The matrix itself
@@ -397,6 +407,11 @@ class MatrixBlockVector
   private NamedData<std_cxx1x::shared_ptr<MatrixBlock<MATRIX> > >
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * The type of object stored.
    */
@@ -407,7 +422,7 @@ public:
    * position <tt>(row,column)</tt>
    * in the block system.
    */
-  void add(unsigned int row, unsigned int column, const std::string &name);
+  void add(size_type row, size_type column, const std::string &name);
 
   /**
    * For matrices using a
@@ -446,20 +461,20 @@ public:
    * Access a constant reference to
    * the block at position <i>i</i>.
    */
-  const value_type &block(unsigned int i) const;
+  const value_type &block(size_type i) const;
 
   /**
    * Access a reference to
    * the block at position <i>i</i>.
    */
-  value_type &block(unsigned int i);
+  value_type &block(size_type i);
 
   /**
    * Access the matrix at position
    * <i>i</i> for read and write
    * access.
    */
-  MATRIX &matrix(unsigned int i);
+  MATRIX &matrix(size_type i);
 
   /**
    * import functions from private base class
@@ -485,6 +500,11 @@ class MGMatrixBlockVector
   : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * The type of object stored.
    */
@@ -520,8 +540,7 @@ public:
    * matrix a name for later
    * identification.
    */
-  void add(unsigned int row, unsigned int column,
-           const std::string &name);
+  void add(size_type row, size_type column, const std::string &name);
 
   /**
    * For matrices using a
@@ -582,61 +601,61 @@ public:
    * Access a constant reference to
    * the matrix block at position <i>i</i>.
    */
-  const value_type &block(unsigned int i) const;
+  const value_type &block(size_type i) const;
 
   /**
    * Access a reference to
    * the matrix block at position <i>i</i>.
    */
-  value_type &block(unsigned int i);
+  value_type &block(size_type i);
 
   /**
    * Access a constant reference to
    * the edge matrix block at position <i>i</i>.
    */
-  const value_type &block_in(unsigned int i) const;
+  const value_type &block_in(size_type i) const;
 
   /**
    * Access a reference to
    * the edge matrix block at position <i>i</i>.
    */
-  value_type &block_in(unsigned int i);
+  value_type &block_in(size_type i);
 
   /**
    * Access a constant reference to
    * the edge matrix block at position <i>i</i>.
    */
-  const value_type &block_out(unsigned int i) const;
+  const value_type &block_out(size_type i) const;
 
   /**
    * Access a reference to
    * the edge matrix block at position <i>i</i>.
    */
-  value_type &block_out(unsigned int i);
+  value_type &block_out(size_type i);
 
   /**
    * Access a constant reference to
    * the  edge flux matrix block at position <i>i</i>.
    */
-  const value_type &block_up(unsigned int i) const;
+  const value_type &block_up(size_type i) const;
 
   /**
    * Access a reference to
    * the  edge flux matrix block at position <i>i</i>.
    */
-  value_type &block_up(unsigned int i);
+  value_type &block_up(size_type i);
 
   /**
    * Access a constant reference to
    * the  edge flux matrix block at position <i>i</i>.
    */
-  const value_type &block_down(unsigned int i) const;
+  const value_type &block_down(size_type i) const;
 
   /**
    * Access a reference to
    * the edge flux matrix block at position <i>i</i>.
    */
-  value_type &block_down(unsigned int i);
+  value_type &block_down(size_type i);
 
   /**
    * The memory used by this object.
@@ -693,8 +712,8 @@ template <class MATRIX>
 inline
 MatrixBlock<MATRIX>::MatrixBlock()
   :
-  row(deal_II_numbers::invalid_unsigned_int),
-  column(deal_II_numbers::invalid_unsigned_int)
+  row(deal_II_numbers::invalid_size_type),
+  column(deal_II_numbers::invalid_size_type)
 {}
 
 
@@ -713,7 +732,7 @@ MatrixBlock<MATRIX>::MatrixBlock(const MatrixBlock<MATRIX> &M)
 
 template <class MATRIX>
 inline
-MatrixBlock<MATRIX>::MatrixBlock(unsigned int i, unsigned int j)
+MatrixBlock<MATRIX>::MatrixBlock(size_type i, size_type j)
   :
   row(i), column(j)
 {}
@@ -747,16 +766,16 @@ MatrixBlock<MATRIX>::operator const MATRIX &() const
 template <class MATRIX>
 inline void
 MatrixBlock<MATRIX>::add (
-  const unsigned int gi,
-  const unsigned int gj,
+  const size_type gi,
+  const size_type gj,
   const typename MATRIX::value_type value)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
 
-  const std::pair<unsigned int, unsigned int> bi
+  const std::pair<unsigned int, size_type> bi
     = row_indices.global_to_local(gi);
-  const std::pair<unsigned int, unsigned int> bj
+  const std::pair<unsigned int, size_type> bj
     = column_indices.global_to_local(gj);
 
   Assert (bi.first == row, ExcBlockIndexMismatch(bi.first, row));
@@ -770,10 +789,10 @@ template <class MATRIX>
 template <typename number>
 inline
 void
-MatrixBlock<MATRIX>::add (const std::vector<unsigned int>         &r_indices,
-                          const std::vector<unsigned int> &c_indices,
-                          const FullMatrix<number>        &values,
-                          const bool                       elide_zero_values)
+MatrixBlock<MATRIX>::add (const std::vector<size_type> &r_indices,
+                          const std::vector<size_type> &c_indices,
+                          const FullMatrix<number>     &values,
+                          const bool                    elide_zero_values)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
@@ -781,7 +800,7 @@ MatrixBlock<MATRIX>::add (const std::vector<unsigned int>         &r_indices,
   AssertDimension (r_indices.size(), values.m());
   AssertDimension (c_indices.size(), values.n());
 
-  for (unsigned int i=0; i<row_indices.size(); ++i)
+  for (size_type i=0; i<row_indices.size(); ++i)
     add (r_indices[i], c_indices.size(), &c_indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -791,17 +810,17 @@ template <class MATRIX>
 template <typename number>
 inline
 void
-MatrixBlock<MATRIX>::add (const unsigned int   b_row,
-                          const unsigned int   n_cols,
-                          const unsigned int  *col_indices,
-                          const number        *values,
+MatrixBlock<MATRIX>::add (const size_type  b_row,
+                          const size_type  n_cols,
+                          const size_type *col_indices,
+                          const number    *values,
                           const bool,
                           const bool)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
 
-  const std::pair<unsigned int, unsigned int> bi
+  const std::pair<unsigned int, size_type> bi
     = row_indices.global_to_local(b_row);
 
   // In debug mode, we check whether
@@ -815,9 +834,9 @@ MatrixBlock<MATRIX>::add (const unsigned int   b_row,
 //#ifdef DEBUG
   Assert(bi.first == row, ExcBlockIndexMismatch(bi.first, row));
 
-  for (unsigned int j=0; j<n_cols; ++j)
+  for (size_type j=0; j<n_cols; ++j)
     {
-      const std::pair<unsigned int, unsigned int> bj
+      const std::pair<unsigned int, size_type> bj
         = column_indices.global_to_local(col_indices[j]);
       Assert(bj.first == column, ExcBlockIndexMismatch(bj.first, column));
 
@@ -831,9 +850,9 @@ template <class MATRIX>
 template <typename number>
 inline
 void
-MatrixBlock<MATRIX>::add (const std::vector<unsigned int> &indices,
-                          const FullMatrix<number>        &values,
-                          const bool                       elide_zero_values)
+MatrixBlock<MATRIX>::add (const std::vector<size_type> &indices,
+                          const FullMatrix<number>     &values,
+                          const bool                    elide_zero_values)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
@@ -841,7 +860,7 @@ MatrixBlock<MATRIX>::add (const std::vector<unsigned int> &indices,
   AssertDimension (indices.size(), values.m());
   Assert (values.n() == values.m(), ExcNotQuadratic());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     add (indices[i], indices.size(), &indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -852,10 +871,10 @@ template <class MATRIX>
 template <typename number>
 inline
 void
-MatrixBlock<MATRIX>::add (const unsigned int               row,
-                          const std::vector<unsigned int> &col_indices,
-                          const std::vector<number>       &values,
-                          const bool                       elide_zero_values)
+MatrixBlock<MATRIX>::add (const size_type               row,
+                          const std::vector<size_type> &col_indices,
+                          const std::vector<number>    &values,
+                          const bool                    elide_zero_values)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
@@ -921,7 +940,7 @@ MatrixBlock<MATRIX>::memory_consumption () const
 template <class MATRIX>
 inline void
 MatrixBlockVector<MATRIX>::add(
-  unsigned int row, unsigned int column,
+  size_type row, size_type column,
   const std::string &name)
 {
   std_cxx1x::shared_ptr<value_type> p(new value_type(row, column));
@@ -933,7 +952,7 @@ template <class MATRIX>
 inline void
 MatrixBlockVector<MATRIX>::reinit(const BlockSparsityPattern &sparsity)
 {
-  for (unsigned int i=0; i<this->size(); ++i)
+  for (size_type i=0; i<this->size(); ++i)
     {
       block(i).reinit(sparsity);
     }
@@ -950,7 +969,7 @@ MatrixBlockVector<MATRIX>::clear(bool really_clean)
     }
   else
     {
-      for (unsigned int i=0; i<this->size(); ++i)
+      for (size_type i=0; i<this->size(); ++i)
         matrix(i).clear();
     }
 }
@@ -959,7 +978,7 @@ MatrixBlockVector<MATRIX>::clear(bool really_clean)
 
 template <class MATRIX>
 inline const MatrixBlock<MATRIX> &
-MatrixBlockVector<MATRIX>::block(unsigned int i) const
+MatrixBlockVector<MATRIX>::block(size_type i) const
 {
   return *this->read(i);
 }
@@ -967,7 +986,7 @@ MatrixBlockVector<MATRIX>::block(unsigned int i) const
 
 template <class MATRIX>
 inline MatrixBlock<MATRIX> &
-MatrixBlockVector<MATRIX>::block(unsigned int i)
+MatrixBlockVector<MATRIX>::block(size_type i)
 {
   return *(*this)(i);
 }
@@ -975,7 +994,7 @@ MatrixBlockVector<MATRIX>::block(unsigned int i)
 
 template <class MATRIX>
 inline MATRIX &
-MatrixBlockVector<MATRIX>::matrix(unsigned int i)
+MatrixBlockVector<MATRIX>::matrix(size_type i)
 {
   return (*this)(i)->matrix;
 }
@@ -1006,7 +1025,7 @@ MGMatrixBlockVector<MATRIX>::size () const
 template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::add(
-  unsigned int row, unsigned int column,
+  size_type row, size_type column,
   const std::string &name)
 {
   MGLevelObject<MatrixBlock<MATRIX> > p(0, 1);
@@ -1029,7 +1048,7 @@ MGMatrixBlockVector<MATRIX>::add(
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block(size_type i) const
 {
   return matrices.read(i);
 }
@@ -1037,7 +1056,7 @@ MGMatrixBlockVector<MATRIX>::block(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block(size_type i)
 {
   return matrices(i);
 }
@@ -1045,7 +1064,7 @@ MGMatrixBlockVector<MATRIX>::block(unsigned int i)
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_in(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block_in(size_type i) const
 {
   return matrices_in.read(i);
 }
@@ -1053,7 +1072,7 @@ MGMatrixBlockVector<MATRIX>::block_in(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_in(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block_in(size_type i)
 {
   return matrices_in(i);
 }
@@ -1061,7 +1080,7 @@ MGMatrixBlockVector<MATRIX>::block_in(unsigned int i)
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_out(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block_out(size_type i) const
 {
   return matrices_out.read(i);
 }
@@ -1069,7 +1088,7 @@ MGMatrixBlockVector<MATRIX>::block_out(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_out(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block_out(size_type i)
 {
   return matrices_out(i);
 }
@@ -1077,7 +1096,7 @@ MGMatrixBlockVector<MATRIX>::block_out(unsigned int i)
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_up(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block_up(size_type i) const
 {
   return flux_matrices_up.read(i);
 }
@@ -1085,7 +1104,7 @@ MGMatrixBlockVector<MATRIX>::block_up(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_up(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block_up(size_type i)
 {
   return flux_matrices_up(i);
 }
@@ -1093,7 +1112,7 @@ MGMatrixBlockVector<MATRIX>::block_up(unsigned int i)
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_down(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block_down(size_type i) const
 {
   return flux_matrices_down.read(i);
 }
@@ -1101,7 +1120,7 @@ MGMatrixBlockVector<MATRIX>::block_down(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_down(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block_down(size_type i)
 {
   return flux_matrices_down(i);
 }
@@ -1111,14 +1130,14 @@ template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::reinit_matrix(const MGLevelObject<BlockSparsityPattern> &sparsity)
 {
-  for (unsigned int i=0; i<this->size(); ++i)
+  for (size_type i=0; i<this->size(); ++i)
     {
       MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
-      const unsigned int row = o[o.min_level()].row;
-      const unsigned int col = o[o.min_level()].column;
+      const size_type row = o[o.min_level()].row;
+      const size_type col = o[o.min_level()].column;
 
       o.resize(sparsity.min_level(), sparsity.max_level());
-      for (unsigned int level = o.min_level(); level <= o.max_level(); ++level)
+      for (size_type level = o.min_level(); level <= o.max_level(); ++level)
         {
           o[level].row = row;
           o[level].column = col;
@@ -1132,15 +1151,15 @@ template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::reinit_edge(const MGLevelObject<BlockSparsityPattern> &sparsity)
 {
-  for (unsigned int i=0; i<this->size(); ++i)
+  for (size_type i=0; i<this->size(); ++i)
     {
       MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
-      const unsigned int row = o[o.min_level()].row;
-      const unsigned int col = o[o.min_level()].column;
+      const size_type row = o[o.min_level()].row;
+      const size_type col = o[o.min_level()].column;
 
       block_in(i).resize(sparsity.min_level(), sparsity.max_level());
       block_out(i).resize(sparsity.min_level(), sparsity.max_level());
-      for (unsigned int level = o.min_level(); level <= o.max_level(); ++level)
+      for (size_type level = o.min_level(); level <= o.max_level(); ++level)
         {
           block_in(i)[level].row = row;
           block_in(i)[level].column = col;
@@ -1157,15 +1176,15 @@ template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::reinit_edge_flux(const MGLevelObject<BlockSparsityPattern> &sparsity)
 {
-  for (unsigned int i=0; i<this->size(); ++i)
+  for (size_type i=0; i<this->size(); ++i)
     {
       MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
-      const unsigned int row = o[o.min_level()].row;
-      const unsigned int col = o[o.min_level()].column;
+      const size_type row = o[o.min_level()].row;
+      const size_type col = o[o.min_level()].column;
 
       block_up(i).resize(sparsity.min_level(), sparsity.max_level());
       block_down(i).resize(sparsity.min_level(), sparsity.max_level());
-      for (unsigned int level = o.min_level(); level <= o.max_level(); ++level)
+      for (size_type level = o.min_level(); level <= o.max_level(); ++level)
         {
           block_up(i)[level].row = row;
           block_up(i)[level].column = col;
@@ -1183,10 +1202,10 @@ template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::clear_object(NamedData<MGLevelObject<MatrixBlock<MATRIX> > > &mo)
 {
-  for (unsigned int i=0; i<mo.size(); ++i)
+  for (size_type i=0; i<mo.size(); ++i)
     {
       MGLevelObject<MatrixBlock<MATRIX> > &o = mo(i);
-      for (unsigned int level = o.min_level(); level <= o.max_level(); ++level)
+      for (size_type level = o.min_level(); level <= o.max_level(); ++level)
         o[level].matrix.clear();
     }
 }
index 03e67432cdafbb29be2d66f29b7df155db15c864..4e6f02d36713c0c9b7d9fd70bf8be4c8acf12f77 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__matrix_iterator_h
 #define __deal2__matrix_iterator_h
 
@@ -33,6 +38,11 @@ template <class ACCESSOR>
 class MatrixIterator
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Typedef for the matrix type
    * (including constness) we are to
@@ -47,9 +57,9 @@ public:
    * <tt>row</tt> and the
    * <tt>index</tt> within it.
    */
-  MatrixIterator (MatrixType        *matrix,
-                  const unsigned int row = 0,
-                  const unsigned int index = 0);
+  MatrixIterator (MatrixType      *matrix,
+                  const size_type  row = 0,
+                  const size_type  index = 0);
 
   /**
    * Copy from another matrix
@@ -136,9 +146,9 @@ private:
 template <class ACCESSOR>
 inline
 MatrixIterator<ACCESSOR>::
-MatrixIterator (MatrixType        *matrix,
-                const unsigned int r,
-                const unsigned int i)
+MatrixIterator (MatrixType      *matrix,
+                const size_type  r,
+                const size_type  i)
   :
   accessor(matrix, r, i)
 {}
index 1990056b09557a4e70a63c694fdbd045b73daa71..2a438f027169dd03324191c740014720d3484eb2 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2012, 2013 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__matrix_lib_h
 #define __deal2__matrix_lib_h
 
@@ -326,11 +331,16 @@ private:
 class MeanValueFilter : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor, optionally
    * selecting a component.
    */
-  MeanValueFilter(unsigned int component = numbers::invalid_unsigned_int);
+  MeanValueFilter(size_type component = numbers::invalid_size_type);
 
   /**
    * Subtract mean value from @p v.
@@ -395,7 +405,7 @@ private:
   /**
    * Component for filtering block vectors.
    */
-  unsigned int component;
+  size_type component;
 };
 
 
index 63fd1d83c826a3d30a35404ea72c4408b17f8368..81e0a09157467adb68151553d290b2ca0ab2465a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__matrix_lib_templates_h
 #define __deal2__matrix_lib_templates_h
 
@@ -24,7 +29,7 @@ MeanValueFilter::filter(Vector<number> &v) const
 {
   number mean = v.mean_value();
 
-  for (unsigned int i=0; i<v.size(); ++i)
+  for (size_type i=0; i<v.size(); ++i)
     v(i) -= mean;
 }
 
@@ -40,7 +45,7 @@ MeanValueFilter::vmult(Vector<number> &dst,
 
   number mean = src.mean_value();
 
-  for (unsigned int i=0; i<dst.size(); ++i)
+  for (size_type i=0; i<dst.size(); ++i)
     dst(i) = src(i) - mean;
 }
 
@@ -56,7 +61,7 @@ MeanValueFilter::vmult_add(Vector<number> &dst,
 
   number mean = src.mean_value();
 
-  for (unsigned int i=0; i<dst.size(); ++i)
+  for (size_type i=0; i<dst.size(); ++i)
     dst(i) += src(i) - mean;
 }
 
index 7284f9b0f1b46bff19a2ad639b43985938eb1c5d..55c84522178bb8fb9dc2f598a95e9426edcf07c2 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__matrix_out_h
 #define __deal2__matrix_out_h
 
@@ -88,6 +93,11 @@ DEAL_II_NAMESPACE_OPEN
 class MatrixOut : public DataOutInterface<2,2>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Class holding various
    * variables which are used to
@@ -124,7 +134,7 @@ public:
      *
      * Default value is one.
      */
-    unsigned int block_size;
+    size_type block_size;
 
     /**
      * If true, plot
@@ -139,9 +149,9 @@ public:
      * structure to their default
      * values.
      */
-    Options (const bool         show_absolute_values = false,
-             const unsigned int block_size           = 1,
-             const bool         discontinuous        = false);
+    Options (const bool      show_absolute_values = false,
+             const size_type block_size           = 1,
+             const bool      discontinuous        = false);
   };
 
   /**
@@ -250,8 +260,8 @@ private:
    */
   template <typename number>
   static double get_element (const SparseMatrix<number> &matrix,
-                             const unsigned int          i,
-                             const unsigned int          j);
+                             const size_type             i,
+                             const size_type             j);
 
   /**
    * Return the element with given
@@ -260,8 +270,8 @@ private:
    */
   template <typename number>
   static double get_element (const BlockSparseMatrix<number> &matrix,
-                             const unsigned int               i,
-                             const unsigned int               j);
+                             const size_type                  i,
+                             const size_type                  j);
 
   /**
    * Return the element with given
@@ -273,8 +283,8 @@ private:
    */
   template <class Matrix>
   static double get_element (const Matrix       &matrix,
-                             const unsigned int  i,
-                             const unsigned int  j);
+                             const size_type     i,
+                             const size_type     j);
 
   /**
    * Get the value of the matrix at
@@ -291,8 +301,8 @@ private:
    */
   template <class Matrix>
   static double get_gridpoint_value (const Matrix       &matrix,
-                                     const unsigned int  i,
-                                     const unsigned int  j,
+                                     const size_type     i,
+                                     const size_type     j,
                                      const Options      &options);
 };
 
@@ -304,8 +314,8 @@ template <typename number>
 inline
 double
 MatrixOut::get_element (const SparseMatrix<number> &matrix,
-                        const unsigned int          i,
-                        const unsigned int          j)
+                        const size_type             i,
+                        const size_type             j)
 {
   return matrix.el(i,j);
 }
@@ -317,8 +327,8 @@ template <typename number>
 inline
 double
 MatrixOut::get_element (const BlockSparseMatrix<number> &matrix,
-                        const unsigned int               i,
-                        const unsigned int               j)
+                        const size_type                  i,
+                        const size_type                  j)
 {
   return matrix.el(i,j);
 }
@@ -329,9 +339,9 @@ MatrixOut::get_element (const BlockSparseMatrix<number> &matrix,
 template <class Matrix>
 inline
 double
-MatrixOut::get_element (const Matrix       &matrix,
-                        const unsigned int  i,
-                        const unsigned int  j)
+MatrixOut::get_element (const Matrix   &matrix,
+                        const size_type i,
+                        const size_type j)
 {
   return matrix(i,j);
 }
@@ -341,10 +351,10 @@ MatrixOut::get_element (const Matrix       &matrix,
 template <class Matrix>
 inline
 double
-MatrixOut::get_gridpoint_value (const Matrix       &matrix,
-                                const unsigned int  i,
-                                const unsigned int  j,
-                                const Options      &options)
+MatrixOut::get_gridpoint_value (const Matrix   &matrix,
+                                const size_type i,
+                                const size_type j,
+                                const Options  &options)
 {
   // special case if block size is
   // one since we then don't need all
@@ -360,10 +370,10 @@ MatrixOut::get_gridpoint_value (const Matrix       &matrix,
   // if blocksize greater than one,
   // then compute average of elements
   double average = 0;
-  unsigned int n_elements = 0;
-  for (unsigned int row=i*options.block_size;
+  size_type n_elements = 0;
+  for (size_type row=i*options.block_size;
        row < std::min(matrix.m(), (i+1)*options.block_size); ++row)
-    for (unsigned int col=j*options.block_size;
+    for (size_type col=j*options.block_size;
          col < std::min(matrix.m(), (j+1)*options.block_size); ++col, ++n_elements)
       if (options.show_absolute_values == true)
         average += std::fabs(get_element (matrix, row, col));
@@ -381,7 +391,7 @@ MatrixOut::build_patches (const Matrix      &matrix,
                           const std::string &name,
                           const Options      options)
 {
-  unsigned int
+  size_type
   gridpoints_x = (matrix.n() / options.block_size
                   +
                   (matrix.n() % options.block_size != 0 ? 1 : 0)),
@@ -403,9 +413,9 @@ MatrixOut::build_patches (const Matrix      &matrix,
   patches.resize ((gridpoints_x) * (gridpoints_y));
 
   // now build the patches
-  unsigned int index=0;
-  for (unsigned int i=0; i<gridpoints_y; ++i)
-    for (unsigned int j=0; j<gridpoints_x; ++j, ++index)
+  size_type index=0;
+  for (size_type i=0; i<gridpoints_y; ++i)
+    for (size_type j=0; j<gridpoints_x; ++j, ++index)
       {
         // within each patch, order
         // the points in such a way
index 63b2395979b8296ca6cedc9447476b4e52749d8f..d0f538785167c006a337b38decebe52cd9f87344 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__parallel_block_vector_h
 #define __deal2__parallel_block_vector_h
 
@@ -86,8 +91,8 @@ namespace parallel
        *  Confer the other constructor further down if you intend to use
        *  blocks of different sizes.
        */
-      explicit BlockVector (const unsigned int num_blocks = 0,
-                            const unsigned int block_size = 0);
+      explicit BlockVector (const size_type num_blocks = 0,
+                            const size_type block_size = 0);
 
       /**
        * Copy-Constructor. Dimension set to that of V, all components are
@@ -118,7 +123,7 @@ namespace parallel
        * Constructor. Set the number of blocks to <tt>block_sizes.size()</tt>
        * and initialize each block with <tt>block_sizes[i]</tt> zero elements.
        */
-      BlockVector (const std::vector<unsigned int> &block_sizes);
+      BlockVector (const std::vector<size_type> &block_sizes);
 
       /**
        * Destructor. Clears memory.
@@ -164,8 +169,8 @@ namespace parallel
        *
        * If <tt>fast==false</tt>, the vector is filled with zeros.
        */
-      void reinit (const unsigned int num_blocks,
-                   const unsigned int block_size = 0,
+      void reinit (const size_type num_blocks,
+                   const size_type block_size = 0,
                    const bool fast = false);
 
       /**
@@ -186,8 +191,8 @@ namespace parallel
        * actions on this object may yield unpredictable results since they may
        * be routed to the wrong block.
        */
-      void reinit (const std::vector<unsigned int> &N,
-                   const bool                       fast=false);
+      void reinit (const std::vector<size_type> &N,
+                   const bool                    fast=false);
 
       /**
        * Change the dimension to that of the vector <tt>V</tt>. The same
@@ -335,8 +340,8 @@ namespace parallel
 
     template <typename Number>
     inline
-    BlockVector<Number>::BlockVector (const unsigned int n_blocks,
-                                      const unsigned int block_size)
+    BlockVector<Number>::BlockVector (const size_type n_blocks,
+                                      const size_type block_size)
     {
       reinit (n_blocks, block_size);
     }
@@ -345,7 +350,7 @@ namespace parallel
 
     template <typename Number>
     inline
-    BlockVector<Number>::BlockVector (const std::vector<unsigned int> &n)
+    BlockVector<Number>::BlockVector (const std::vector<size_type> &n)
     {
       reinit (n, false);
     }
@@ -361,7 +366,7 @@ namespace parallel
       this->components.resize (v.n_blocks());
       this->block_indices = v.block_indices;
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         this->components[i] = v.components[i];
     }
 
@@ -383,25 +388,25 @@ namespace parallel
 
     template <typename Number>
     inline
-    void BlockVector<Number>::reinit (const unsigned int n_bl,
-                                      const unsigned int bl_sz,
+    void BlockVector<Number>::reinit (const size_type n_bl,
+                                      const size_type bl_sz,
                                       const bool         fast)
     {
-      std::vector<unsigned int> n(n_bl, bl_sz);
+      std::vector<size_type> n(n_bl, bl_sz);
       reinit(n, fast);
     }
 
 
     template <typename Number>
     inline
-    void BlockVector<Number>::reinit (const std::vector<unsigned int> &n,
-                                      const bool                       fast)
+    void BlockVector<Number>::reinit (const std::vector<size_type> &n,
+                                      const bool                    fast)
     {
       this->block_indices.reinit (n);
       if (this->components.size() != this->n_blocks())
         this->components.resize(this->n_blocks());
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         this->components[i].reinit(n[i], fast);
     }
 
@@ -617,7 +622,7 @@ namespace parallel
       if (this->block(0).partitioner->n_mpi_processes() > 1)
         return Utilities::MPI::sum (local_result,
                                     this->block(0).partitioner->get_communicator())/
-          (real_type)this->size();
+               (real_type)this->size();
       else
         return local_result/(real_type)this->size();
     }
@@ -702,7 +707,7 @@ namespace parallel
       Assert (this->n_blocks() == v.n_blocks(),
               ExcDimensionMismatch(this->n_blocks(), v.n_blocks()));
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         dealii::swap (this->components[i], v.components[i]);
       dealii::swap (this->block_indices, v.block_indices);
     }
@@ -715,7 +720,7 @@ namespace parallel
 
       Assert (numbers::is_finite(factor), ExcNumberNotFinite());
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         this->components[i].scale(factor);
     }
 
index 29d0b864b6b1273b459fd0e9fc5fdce252bd117b..613fb61ab4c2048aa3f19c9723792ccfe1bc1db9 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012, 2013 by deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__parallel_vector_h
 #define __deal2__parallel_vector_h
 
@@ -97,7 +101,7 @@ namespace parallel
       typedef const value_type                                 *const_iterator;
       typedef value_type                                       &reference;
       typedef const value_type                                 &const_reference;
-      typedef size_t                                            size_type;
+      typedef types::global_dof_index                           size_type;
       typedef typename numbers::NumberTraits<Number>::real_type real_type;
 
       /**
@@ -131,7 +135,7 @@ namespace parallel
        * Constructs a parallel vector of the given global size without any
        * actual parallel distribution.
        */
-      Vector (const unsigned int size);
+      Vector (const size_type size);
 
       /**
        * Constructs a parallel vector. The local range is specified by @p
@@ -167,8 +171,8 @@ namespace parallel
        * Sets the global size of the vector to @p size without any actual
        * parallel distribution.
        */
-      void reinit (const unsigned int size,
-                   const bool         fast = false);
+      void reinit (const size_type size,
+                   const bool      fast = false);
 
       /**
        * Uses the parallel layout of the input vector @p in_vector and
@@ -437,26 +441,26 @@ namespace parallel
        * Returns the global size of the vector, equal to the sum of the number
        * of locally owned indices among all the processors.
        */
-      types::global_dof_index size () const;
+      size_type size () const;
 
       /**
        * Returns the local size of the vector, i.e., the number of indices
        * owned locally.
        */
-      unsigned int local_size() const;
+      size_type local_size() const;
 
       /**
        * Returns the half-open interval that specifies the locally owned range
        * of the vector. Note that <code>local_size() == local_range().second -
        * local_range().first</code>.
        */
-      std::pair<types::global_dof_index, types::global_dof_index> local_range () const;
+      std::pair<size_type, size_type> local_range () const;
 
       /**
        * Returns true if the given global index is in the local range of this
        * processor.
        */
-      bool in_local_range (const types::global_dof_index global_index) const;
+      bool in_local_range (const size_type global_index) const;
 
       /**
        * Return an index set that describes which elements of this vector
@@ -477,7 +481,14 @@ namespace parallel
       /**
        * Returns the number of ghost elements present on the vector.
        */
-      unsigned int n_ghost_entries () const;
+      size_type n_ghost_entries () const;
+
+      /**
+       * Return an index set that describes which elements of this vector are
+       * not owned by the current processor but can be written into or read
+       * from locally (ghost elements).
+       */
+      const IndexSet &ghost_elements() const;
 
       /**
        * Returns whether the given global index is a ghost index on the
@@ -529,7 +540,7 @@ namespace parallel
        * a contiguous range and <tt>O(log(n<sub>ranges</sub>))</tt> for ghost
        * elements (quite fast, but slower than local_element()).
        */
-      Number operator () (const types::global_dof_index global_index) const;
+      Number operator () (const size_type global_index) const;
 
       /**
        * Read and write access to the data in the position corresponding to @p
@@ -540,7 +551,7 @@ namespace parallel
        * a contiguous range and <tt>O(log(n<sub>ranges</sub>))</tt> for ghost
        * elements (quite fast, but slower than local_element()).
        */
-      Number &operator () (const types::global_dof_index global_index);
+      Number &operator () (const size_type global_index);
 
       /**
        * Read access to the data in the position corresponding to @p
@@ -549,7 +560,7 @@ namespace parallel
        *
        * This function does the same thing as operator().
        */
-      Number operator [] (const types::global_dof_index global_index) const;
+      Number operator [] (const size_type global_index) const;
 
       /**
        * Read and write access to the data in the position corresponding to @p
@@ -558,7 +569,7 @@ namespace parallel
        *
        * This function does the same thing as operator().
        */
-      Number &operator [] (const types::global_dof_index global_index);
+      Number &operator [] (const size_type global_index);
 
       /**
        * Read access to the data field specified by @p local_index. Locally
@@ -568,7 +579,7 @@ namespace parallel
        *
        * Performance: Direct array access (fast).
        */
-      Number local_element (const unsigned int local_index) const;
+      Number local_element (const size_type local_index) const;
 
       /**
        * Read and write access to the data field specified by @p
@@ -578,7 +589,7 @@ namespace parallel
        *
        * Performance: Direct array access (fast).
        */
-      Number &local_element (const unsigned int local_index);
+      Number &local_element (const size_type local_index);
       //@}
 
 
@@ -602,7 +613,7 @@ namespace parallel
        * stored in @p values to the vector components specified by @p indices.
        */
       template <typename OtherNumber>
-      void add (const std::vector<unsigned int> &indices,
+      void add (const std::vector<size_type>   &indices,
                 const std::vector<OtherNumber>  &values);
 
       /**
@@ -610,7 +621,7 @@ namespace parallel
        * function takes a deal.II vector of values.
        */
       template <typename OtherNumber>
-      void add (const std::vector<unsigned int>     &indices,
+      void add (const std::vector<size_type>        &indices,
                 const ::dealii::Vector<OtherNumber> &values);
 
       /**
@@ -619,8 +630,8 @@ namespace parallel
        * the other two <tt>add()</tt> functions above.
        */
       template <typename OtherNumber>
-      void add (const unsigned int  n_elements,
-                const unsigned int *indices,
+      void add (const size_type    n_elements,
+                const size_type   *indices,
                 const OtherNumber  *values);
 
       /**
@@ -763,7 +774,7 @@ namespace parallel
        * vector.
        */
       const MPI_Comm &get_mpi_communicator () const;
-      
+
       /**
        * Checks whether the given partitioner is compatible with the
        * partitioner used for this vector. Two partitioners are compatible if
@@ -849,7 +860,7 @@ namespace parallel
       /**
        * The size that is currently allocated in the val array.
        */
-      unsigned int    allocated_size;
+      size_type allocated_size;
 
       /**
        * Pointer to the array of local elements of this vector.
@@ -903,7 +914,7 @@ namespace parallel
       /**
        * A helper function that is used to resize the val array.
        */
-      void resize_val (const unsigned int new_allocated_size);
+      void resize_val (const size_type new_allocated_size);
 
       /*
        * Make all other vector types friends.
@@ -970,7 +981,7 @@ namespace parallel
 
     template <typename Number>
     inline
-    Vector<Number>::Vector (const unsigned int size)
+    Vector<Number>::Vector (const size_type size)
       :
       allocated_size (0),
       val (0),
@@ -1030,8 +1041,8 @@ namespace parallel
         reinit (c, true);
       else if (partitioner.get() != c.partitioner.get())
         {
-          unsigned int local_ranges_different_loc = (local_range() !=
-                                                     c.local_range());
+          size_type local_ranges_different_loc = (local_range() !=
+                                                  c.local_range());
           if ((partitioner->n_mpi_processes() > 1 &&
                Utilities::MPI::max(local_ranges_different_loc,
                                    partitioner->get_communicator()) != 0)
@@ -1062,8 +1073,8 @@ namespace parallel
         reinit (c, true);
       else if (partitioner.get() != c.partitioner.get())
         {
-          unsigned int local_ranges_different_loc = (local_range() !=
-                                                     c.local_range());
+          size_type local_ranges_different_loc = (local_range() !=
+                                                  c.local_range());
           if ((partitioner->n_mpi_processes() > 1 &&
                Utilities::MPI::max(local_ranges_different_loc,
                                    partitioner->get_communicator()) != 0)
@@ -1198,8 +1209,8 @@ namespace parallel
     Vector<Number>::vectors_equal_local (const Vector<Number2> &v) const
     {
       return partitioner->local_size()>0 ?
-        vector_view.template operator == <Number2>(v.vector_view)
-        : true;
+             vector_view.template operator == <Number2>(v.vector_view)
+             : true;
     }
 
 
@@ -1314,7 +1325,7 @@ namespace parallel
         return Utilities::MPI::sum (local_result *
                                     (real_type)partitioner->local_size(),
                                     partitioner->get_communicator())
-          /(real_type)partitioner->size();
+               /(real_type)partitioner->size();
       else
         return local_result;
     }
@@ -1409,7 +1420,8 @@ namespace parallel
 
     template <typename Number>
     inline
-    types::global_dof_index Vector<Number>::size () const
+    typename Vector<Number>::size_type
+    Vector<Number>::size () const
     {
       return partitioner->size();
     }
@@ -1418,7 +1430,8 @@ namespace parallel
 
     template <typename Number>
     inline
-    unsigned int Vector<Number>::local_size () const
+    typename Vector<Number>::size_type
+    Vector<Number>::local_size () const
     {
       return partitioner->local_size();
     }
@@ -1427,8 +1440,9 @@ namespace parallel
 
     template <typename Number>
     inline
-    std::pair<types::global_dof_index, types::global_dof_index>
-    Vector<Number>::local_range () const
+    std::pair<typename Vector<Number>::size_type,
+        typename Vector<Number>::size_type>
+        Vector<Number>::local_range () const
     {
       return partitioner->local_range();
     }
@@ -1439,12 +1453,13 @@ namespace parallel
     inline
     bool
     Vector<Number>::in_local_range
-    (const types::global_dof_index global_index) const
+    (const size_type global_index) const
     {
       return partitioner->in_local_range (global_index);
     }
 
 
+
     template <typename Number>
     inline
     IndexSet
@@ -1462,7 +1477,7 @@ namespace parallel
 
     template <typename Number>
     inline
-    unsigned int
+    typename Vector<Number>::size_type
     Vector<Number>::n_ghost_entries () const
     {
       return partitioner->n_ghost_indices();
@@ -1470,10 +1485,20 @@ namespace parallel
 
 
 
+    template <typename Number>
+    inline
+    const IndexSet &
+    Vector<Number>::ghost_elements() const
+    {
+      return partitioner->ghost_indices();
+    }
+
+
+
     template <typename Number>
     inline
     bool
-    Vector<Number>::is_ghost_entry (const types::global_dof_index global_index) const
+    Vector<Number>::is_ghost_entry (const size_type global_index) const
     {
       return partitioner->is_ghost_entry (global_index);
     }
@@ -1523,7 +1548,7 @@ namespace parallel
     template <typename Number>
     inline
     Number
-    Vector<Number>::operator() (const types::global_dof_index global_index) const
+    Vector<Number>::operator() (const size_type global_index) const
     {
       return val[partitioner->global_to_local(global_index)];
     }
@@ -1533,7 +1558,7 @@ namespace parallel
     template <typename Number>
     inline
     Number &
-    Vector<Number>::operator() (const types::global_dof_index global_index)
+    Vector<Number>::operator() (const size_type global_index)
     {
       return val[partitioner->global_to_local (global_index)];
     }
@@ -1543,7 +1568,7 @@ namespace parallel
     template <typename Number>
     inline
     Number
-    Vector<Number>::operator[] (const types::global_dof_index global_index) const
+    Vector<Number>::operator[] (const size_type global_index) const
     {
       return operator()(global_index);
     }
@@ -1553,7 +1578,7 @@ namespace parallel
     template <typename Number>
     inline
     Number &
-    Vector<Number>::operator[] (const types::global_dof_index global_index)
+    Vector<Number>::operator[] (const size_type global_index)
     {
       return operator()(global_index);
     }
@@ -1563,7 +1588,7 @@ namespace parallel
     template <typename Number>
     inline
     Number
-    Vector<Number>::local_element (const unsigned int local_index) const
+    Vector<Number>::local_element (const size_type local_index) const
     {
       AssertIndexRange (local_index,
                         partitioner->local_size()+
@@ -1576,7 +1601,7 @@ namespace parallel
     template <typename Number>
     inline
     Number &
-    Vector<Number>::local_element (const unsigned int local_index)
+    Vector<Number>::local_element (const size_type local_index)
     {
       AssertIndexRange (local_index,
                         partitioner->local_size()+
@@ -1639,7 +1664,7 @@ namespace parallel
     template <typename OtherNumber>
     inline
     void
-    Vector<Number>::add (const std::vector<unsigned int> &indices,
+    Vector<Number>::add (const std::vector<size_type> &indices,
                          const std::vector<OtherNumber>  &values)
     {
       AssertDimension (indices.size(), values.size());
@@ -1652,7 +1677,7 @@ namespace parallel
     template <typename OtherNumber>
     inline
     void
-    Vector<Number>::add (const std::vector<unsigned int>    &indices,
+    Vector<Number>::add (const std::vector<size_type>    &indices,
                          const ::dealii::Vector<OtherNumber> &values)
     {
       AssertDimension (indices.size(), values.size());
@@ -1665,11 +1690,11 @@ namespace parallel
     template <typename OtherNumber>
     inline
     void
-    Vector<Number>::add (const unsigned int  n_indices,
-                         const unsigned int *indices,
+    Vector<Number>::add (const size_type    n_indices,
+                         const size_type   *indices,
                          const OtherNumber  *values)
     {
-      for (unsigned int i=0; i<n_indices; ++i)
+      for (size_type i=0; i<n_indices; ++i)
         {
           Assert (numbers::is_finite(values[i]),
                   ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
@@ -1983,7 +2008,7 @@ namespace parallel
 
     template <typename Number>
     inline
-    const MPI_Comm&
+    const MPI_Comm &
     Vector<Number>::get_mpi_communicator() const
     {
       return partitioner->get_communicator();
index d71c786ea6d21b70ecefa0695f7ff7647556ff06..23f0734d0329f17ea3829a14f380e336803d21cd 100644 (file)
@@ -1,14 +1,19 @@
-//----------%-----------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__parallel_vector_templates_h
 #define __deal2__parallel_vector_templates_h
 
@@ -29,10 +34,10 @@ namespace parallel
     Vector<Number>::clear_mpi_requests ()
     {
 #ifdef DEAL_II_WITH_MPI
-      for (unsigned int j=0; j<compress_requests.size(); j++)
+      for (size_type j=0; j<compress_requests.size(); j++)
         MPI_Request_free(&compress_requests[j]);
       compress_requests.clear();
-      for (unsigned int j=0; j<update_ghost_values_requests.size(); j++)
+      for (size_type j=0; j<update_ghost_values_requests.size(); j++)
         MPI_Request_free(&update_ghost_values_requests[j]);
       update_ghost_values_requests.clear();
 #endif
@@ -42,7 +47,7 @@ namespace parallel
 
     template <typename Number>
     void
-    Vector<Number>::resize_val (const unsigned int new_alloc_size)
+    Vector<Number>::resize_val (const size_type new_alloc_size)
     {
       if (new_alloc_size > allocated_size)
         {
@@ -66,8 +71,8 @@ namespace parallel
 
     template <typename Number>
     void
-    Vector<Number>::reinit (const unsigned int size,
-                            const bool         fast)
+    Vector<Number>::reinit (const size_type size,
+                            const bool      fast)
     {
       clear_mpi_requests();
       // check whether we need to reallocate
@@ -107,8 +112,8 @@ namespace parallel
       if (partitioner.get() != v.partitioner.get())
         {
           partitioner = v.partitioner;
-          const unsigned int new_allocated_size = partitioner->local_size() +
-                                                  partitioner->n_ghost_indices();
+          const size_type new_allocated_size = partitioner->local_size() +
+                                               partitioner->n_ghost_indices();
           resize_val (new_allocated_size);
           vector_view.reinit (partitioner->local_size(), val);
         }
@@ -157,8 +162,8 @@ namespace parallel
       partitioner = partitioner_in;
 
       // set vector size and allocate memory
-      const unsigned int new_allocated_size = partitioner->local_size() +
-                                              partitioner->n_ghost_indices();
+      const size_type new_allocated_size = partitioner->local_size() +
+                                           partitioner->n_ghost_indices();
       resize_val (new_allocated_size);
       vector_view.reinit (partitioner->local_size(), val);
 
@@ -204,7 +209,9 @@ namespace parallel
       // nothing to do for insert (only need to zero ghost entries in
       // compress_finish(). in debug mode we still want to check consistency
       // of the inserted data, therefore the communication is still
-      // initialized
+      // initialized. Having different code in debug and optimized mode is
+      // somewhat dangerous, but it really saves communication so it seems
+      // still worthwhile.
 #ifndef DEBUG
       if (operation == VectorOperation::insert)
         return;
@@ -220,8 +227,8 @@ namespace parallel
       // make this function thread safe
       Threads::Mutex::ScopedLock lock (mutex);
 
-      const unsigned int n_import_targets = part.import_targets().size();
-      const unsigned int n_ghost_targets  = part.ghost_targets().size();
+      const size_type n_import_targets = part.import_targets().size();
+      const size_type n_ghost_targets  = part.ghost_targets().size();
 
       // Need to send and receive the data. Use
       // non-blocking communication, where it is
@@ -239,7 +246,7 @@ namespace parallel
           // up yet
           if (import_data == 0)
             import_data = new Number[part.n_import_indices()];
-          for (unsigned int i=0; i<n_import_targets; i++)
+          for (size_type i=0; i<n_import_targets; i++)
             {
               MPI_Recv_init (&import_data[current_index_start],
                              part.import_targets()[i].second*sizeof(Number),
@@ -255,7 +262,7 @@ namespace parallel
 
           Assert (part.local_size() == vector_view.size(), ExcInternalError());
           current_index_start = part.local_size();
-          for (unsigned int i=0; i<n_ghost_targets; i++)
+          for (size_type i=0; i<n_ghost_targets; i++)
             {
               MPI_Send_init (&this->val[current_index_start],
                              part.ghost_targets()[i].second*sizeof(Number),
@@ -295,6 +302,16 @@ namespace parallel
     {
 #ifdef DEAL_II_WITH_MPI
 
+      // in optimized mode, no communication was started, so leave the
+      // function directly (and only clear ghosts)
+#ifndef DEBUG
+      if (operation == VectorOperation::insert)
+        {
+          zero_out_ghosts();
+          return;
+        }
+#endif
+
       const Utilities::MPI::Partitioner &part = *partitioner;
 
       // nothing to do when we neither have import
@@ -305,8 +322,8 @@ namespace parallel
       // make this function thread safe
       Threads::Mutex::ScopedLock lock (mutex);
 
-      const unsigned int n_import_targets = part.import_targets().size();
-      const unsigned int n_ghost_targets  = part.ghost_targets().size();
+      const size_type n_import_targets = part.import_targets().size();
+      const size_type n_ghost_targets  = part.ghost_targets().size();
 
       if (operation != dealii::VectorOperation::insert)
         AssertDimension (n_ghost_targets+n_import_targets,
@@ -321,7 +338,7 @@ namespace parallel
           Assert (ierr == MPI_SUCCESS, ExcInternalError());
 
           Number *read_position = import_data;
-          std::vector<std::pair<unsigned int, unsigned int> >::const_iterator
+          std::vector<std::pair<size_type, size_type> >::const_iterator
           my_imports = part.import_indices().begin();
 
           // If the operation is no insertion, add the imported data to the
@@ -330,15 +347,15 @@ namespace parallel
           // the ones already present
           if (operation != dealii::VectorOperation::insert)
             for ( ; my_imports!=part.import_indices().end(); ++my_imports)
-              for (unsigned int j=my_imports->first; j<my_imports->second; j++)
+              for (size_type j=my_imports->first; j<my_imports->second; j++)
                 local_element(j) += *read_position++;
           else
             for ( ; my_imports!=part.import_indices().end(); ++my_imports)
-              for (unsigned int j=my_imports->first; j<my_imports->second;
+              for (size_type j=my_imports->first; j<my_imports->second;
                    j++, read_position++)
                 Assert(*read_position == 0. ||
                        std::abs(local_element(j) - *read_position) <
-                       std::abs(local_element(j)) * 100. *
+                       std::abs(local_element(j)) * 1000. *
                        std::numeric_limits<Number>::epsilon(),
                        ExcMessage("Inserted elements do not match."));
           AssertDimension(read_position-import_data,part.n_import_indices());
@@ -378,8 +395,8 @@ namespace parallel
       // make this function thread safe
       Threads::Mutex::ScopedLock lock (mutex);
 
-      const unsigned int n_import_targets = part.import_targets().size();
-      const unsigned int n_ghost_targets = part.ghost_targets().size();
+      const size_type n_import_targets = part.import_targets().size();
+      const size_type n_ghost_targets = part.ghost_targets().size();
 
       // Need to send and receive the data. Use
       // non-blocking communication, where it is
@@ -389,9 +406,9 @@ namespace parallel
         {
           Assert (part.local_size() == vector_view.size(),
                   ExcInternalError());
-          unsigned int current_index_start = part.local_size();
+          size_type current_index_start = part.local_size();
           update_ghost_values_requests.resize (n_import_targets+n_ghost_targets);
-          for (unsigned int i=0; i<n_ghost_targets; i++)
+          for (size_type i=0; i<n_ghost_targets; i++)
             {
               // allow writing into ghost indices even
               // though we are in a const function
@@ -413,7 +430,7 @@ namespace parallel
           if (import_data == 0 && part.n_import_indices() > 0)
             import_data = new Number[part.n_import_indices()];
           current_index_start = 0;
-          for (unsigned int i=0; i<n_import_targets; i++)
+          for (size_type i=0; i<n_import_targets; i++)
             {
               MPI_Send_init (&import_data[current_index_start],
                              part.import_targets()[i].second*sizeof(Number),
@@ -433,10 +450,10 @@ namespace parallel
         {
           Assert (import_data != 0, ExcInternalError());
           Number *write_position = import_data;
-          std::vector<std::pair<unsigned int, unsigned int> >::const_iterator
+          std::vector<std::pair<size_type, size_type> >::const_iterator
           my_imports = part.import_indices().begin();
           for ( ; my_imports!=part.import_indices().end(); ++my_imports)
-            for (unsigned int j=my_imports->first; j<my_imports->second; j++)
+            for (size_type j=my_imports->first; j<my_imports->second; j++)
               *write_position++ = local_element(j);
         }
 
@@ -561,40 +578,44 @@ namespace parallel
       // as there are processors and start writing
       // when it's our turn
 #ifdef DEAL_II_WITH_MPI
-      for (unsigned int i=0; i<partitioner->this_mpi_process(); i++)
-        MPI_Barrier (partitioner->get_communicator());
+      if (partitioner->n_mpi_processes() > 1)
+        for (unsigned int i=0; i<partitioner->this_mpi_process(); i++)
+          MPI_Barrier (partitioner->get_communicator());
 #endif
 
       out << "Process #" << partitioner->this_mpi_process() << std::endl
-          << "Local range: [" << partitioner->local_range().first << "/"
-          << partitioner->local_range().second << "], global size: "
+          << "Local range: [" << partitioner->local_range().first << ""
+          << partitioner->local_range().second << "), global size: "
           << partitioner->size() << std::endl
           << "Vector data:" << std::endl;
       if (across)
-        for (unsigned int i=0; i<partitioner->local_size(); ++i)
+        for (size_type i=0; i<partitioner->local_size(); ++i)
           out << local_element(i) << ' ';
       else
-        for (unsigned int i=0; i<partitioner->local_size(); ++i)
+        for (size_type i=0; i<partitioner->local_size(); ++i)
           out << local_element(i) << std::endl;
       out << std::endl;
       out << "Ghost entries (global index / value):" << std::endl;
       if (across)
-        for (unsigned int i=0; i<partitioner->n_ghost_indices(); ++i)
+        for (size_type i=0; i<partitioner->n_ghost_indices(); ++i)
           out << '(' << partitioner->ghost_indices().nth_index_in_set(i)
               << '/' << local_element(partitioner->local_size()+i) << ") ";
       else
-        for (unsigned int i=0; i<partitioner->n_ghost_indices(); ++i)
+        for (size_type i=0; i<partitioner->n_ghost_indices(); ++i)
           out << '(' << partitioner->ghost_indices().nth_index_in_set(i)
               << '/' << local_element(partitioner->local_size()+i) << ")"
               << std::endl;
       out << std::endl << std::flush;
 
 #ifdef DEAL_II_WITH_MPI
-      MPI_Barrier (partitioner->get_communicator());
+      if (partitioner->n_mpi_processes() > 1)
+        {
+          MPI_Barrier (partitioner->get_communicator());
 
-      for (unsigned int i=partitioner->this_mpi_process()+1;
-           i<partitioner->n_mpi_processes(); i++)
-        MPI_Barrier (partitioner->get_communicator());
+          for (unsigned int i=partitioner->this_mpi_process()+1;
+               i<partitioner->n_mpi_processes(); i++)
+            MPI_Barrier (partitioner->get_communicator());
+        }
 #endif
 
       AssertThrow (out, ExcIO());
index 22e19d22c41b9176e661ac5c387206f7cb252b47..393de8adb70fa6c3681fe3019a74ea5293059475 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_block_sparse_matrix_h
 #define __deal2__petsc_block_sparse_matrix_h
 
@@ -166,8 +171,8 @@ namespace PETScWrappers
      * user call whatever function
      * she desires.
      */
-    void reinit (const unsigned int n_block_rows,
-                 const unsigned int n_block_columns);
+    void reinit (const size_type n_block_rows,
+                 const size_type n_block_columns);
 
     /**
      * This function collects the
@@ -302,8 +307,8 @@ namespace PETScWrappers
   {
     Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
 
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         this->block(r,c) = d;
 
     return *this;
index 788d8872b29a8f0899ca73d865f6d7ba9921418c..bc40036c98a9ed6b1feae24dcb449fb4d366da91 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_block_vector_h
 #define __deal2__petsc_block_vector_h
 
@@ -91,7 +96,7 @@ namespace PETScWrappers
      *  sizes.
      */
     explicit BlockVector (const unsigned int num_blocks = 0,
-                          const unsigned int block_size = 0);
+                          const size_type    block_size = 0);
 
     /**
      * Copy-Constructor. Dimension set to
@@ -123,7 +128,7 @@ namespace PETScWrappers
      * initialize each block with
      * <tt>n[i]</tt> zero elements.
      */
-    BlockVector (const std::vector<unsigned int> &n);
+    BlockVector (const std::vector<size_type> &n);
 
     /**
      * Constructor. Set the number of
@@ -144,9 +149,9 @@ namespace PETScWrappers
      * different blocks.
      */
     template <typename InputIterator>
-    BlockVector (const std::vector<unsigned int> &n,
-                 const InputIterator              first,
-                 const InputIterator              end);
+    BlockVector (const std::vector<size_type> &n,
+                 const InputIterator           first,
+                 const InputIterator           end);
 
     /**
      * Destructor. Clears memory
@@ -192,7 +197,7 @@ namespace PETScWrappers
      * is filled with zeros.
      */
     void reinit (const unsigned int num_blocks,
-                 const unsigned int block_size,
+                 const size_type    block_size,
                  const bool fast = false);
 
     /**
@@ -227,8 +232,8 @@ namespace PETScWrappers
      * since they may be routed to
      * the wrong block.
      */
-    void reinit (const std::vector<unsigned int> &N,
-                 const bool                       fast=false);
+    void reinit (const std::vector<size_type> &N,
+                 const bool                   fast=false);
 
     /**
      * Change the dimension to that
@@ -259,6 +264,19 @@ namespace PETScWrappers
     void reinit (const BlockVector &V,
                  const bool         fast=false);
 
+    /**
+     * Change the number of blocks to
+     * <tt>num_blocks</tt>. The individual
+     * blocks will get initialized with
+     * zero size, so it is assumed that
+     * the user resizes the
+     * individual blocks by herself
+     * in an appropriate way, and
+     * calls <tt>collect_sizes</tt>
+     * afterwards.
+     */
+    void reinit (const unsigned int num_blocks);
+
     /**
      * Swap the contents of this
      * vector and the other vector
@@ -317,7 +335,7 @@ namespace PETScWrappers
 
   inline
   BlockVector::BlockVector (const unsigned int n_blocks,
-                            const unsigned int block_size)
+                            const size_type    block_size)
   {
     reinit (n_blocks, block_size);
   }
@@ -325,7 +343,7 @@ namespace PETScWrappers
 
 
   inline
-  BlockVector::BlockVector (const std::vector<unsigned int> &n)
+  BlockVector::BlockVector (const std::vector<size_type> &n)
   {
     reinit (n, false);
   }
@@ -360,9 +378,9 @@ namespace PETScWrappers
 
 
   template <typename InputIterator>
-  BlockVector::BlockVector (const std::vector<unsigned int> &n,
-                            const InputIterator              first,
-                            const InputIterator              end)
+  BlockVector::BlockVector (const std::vector<size_type> &n,
+                            const InputIterator           first,
+                            const InputIterator           end)
   {
     // first set sizes of blocks, but
     // don't initialize them as we will
@@ -374,7 +392,7 @@ namespace PETScWrappers
         InputIterator end = start;
         std::advance (end, static_cast<signed int>(n[b]));
 
-        for (unsigned int i=0; i<n[b]; ++i, ++start)
+        for (size_type i=0; i<n[b]; ++i, ++start)
           this->block(b)(i) = *start;
       }
     Assert (start == end, ExcIteratorRangeDoesNotMatchVectorSize());
@@ -420,10 +438,10 @@ namespace PETScWrappers
   inline
   void
   BlockVector::reinit (const unsigned int n_bl,
-                       const unsigned int bl_sz,
+                       const size_type    bl_sz,
                        const bool         fast)
   {
-    std::vector<unsigned int> n(n_bl, bl_sz);
+    std::vector<size_type> n(n_bl, bl_sz);
     reinit(n, fast);
   }
 
@@ -431,8 +449,8 @@ namespace PETScWrappers
 
   inline
   void
-  BlockVector::reinit (const std::vector<unsigned int> &n,
-                       const bool                       fast)
+  BlockVector::reinit (const std::vector<size_type> &n,
+                       const bool                    fast)
   {
     block_indices.reinit (n);
     if (this->components.size() != this->n_blocks())
@@ -458,6 +476,15 @@ namespace PETScWrappers
 
 
 
+  inline
+  void
+  BlockVector::reinit (const unsigned int num_blocks)
+  {
+    reinit (num_blocks, 0, true);
+  }
+
+
+
   inline
   void
   BlockVector::swap (BlockVector &v)
index d9752523d00e814f81b0c831f6ad7336fae7767f..176e9d5fc34673dd79b28e38e65737e04c899a1c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_full_matrix_h
 #define __deal2__petsc_full_matrix_h
 
@@ -45,12 +50,17 @@ namespace PETScWrappers
   class FullMatrix : public MatrixBase
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * Create a full matrix of dimensions
      * @p m times @p n.
      */
-    FullMatrix (const unsigned int m,
-                const unsigned int n);
+    FullMatrix (const size_type m,
+                const size_type n);
 
     /**
      * Return a reference to the MPI
index c5eafdb4d7dc2fb2c559e9be51a48986433f23e2..6ef2b515961bb3cdc3ee9ea6b4e97e9a4a1f3984 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_matrix_base_h
 #define __deal2__petsc_matrix_base_h
 
@@ -64,36 +69,41 @@ namespace PETScWrappers
       class Accessor
       {
       public:
+        /**
+         * Declare type for container size.
+         */
+        typedef types::global_dof_index size_type;
+
         /**
          * Constructor. Since we use
          * accessors only for read
          * access, a const matrix
          * pointer is sufficient.
          */
-        Accessor (const MatrixBase    *matrix,
-                  const unsigned int   row,
-                  const unsigned int   index);
+        Accessor (const MatrixBase *matrix,
+                  const size_type   row,
+                  const size_type   index);
 
         /**
          * Row number of the element
          * represented by this
          * object.
          */
-        unsigned int row() const;
+        size_type row() const;
 
         /**
          * Index in row of the element
          * represented by this
          * object.
          */
-        unsigned int index() const;
+        size_type index() const;
 
         /**
          * Column number of the
          * element represented by
          * this object.
          */
-        unsigned int column() const;
+        size_type column() const;
 
         /**
          * Value of this matrix entry.
@@ -123,12 +133,12 @@ namespace PETScWrappers
         /**
          * Current row number.
          */
-        unsigned int a_row;
+        size_type a_row;
 
         /**
          * Current index in row.
          */
-        unsigned int a_index;
+        size_type a_index;
 
         /**
          * Cache where we store the
@@ -154,7 +164,7 @@ namespace PETScWrappers
          * accessor can access this data
          * if necessary.
          */
-        std_cxx1x::shared_ptr<const std::vector<unsigned int> > colnum_cache;
+        std_cxx1x::shared_ptr<const std::vector<size_type> > colnum_cache;
 
         /**
          * Similar cache for the values
@@ -179,15 +189,19 @@ namespace PETScWrappers
       };
 
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
 
       /**
        * Constructor. Create an iterator
        * into the matrix @p matrix for the
        * given row and the index within it.
        */
-      const_iterator (const MatrixBase   *matrix,
-                      const unsigned int  row,
-                      const unsigned int  index);
+      const_iterator (const MatrixBase *matrix,
+                      const size_type   row,
+                      const size_type   index);
 
       /**
        * Prefix increment.
@@ -293,6 +307,11 @@ namespace PETScWrappers
      */
     typedef MatrixIterators::const_iterator const_iterator;
 
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * Declare a typedef in analogy to all
      * the other container classes.
@@ -350,8 +369,8 @@ namespace PETScWrappers
      * If <tt>value</tt> is not a finite
      * number an exception is thrown.
      */
-    void set (const unsigned int i,
-              const unsigned int j,
+    void set (const size_type   i,
+              const size_type   j,
               const PetscScalar value);
 
     /**
@@ -389,9 +408,9 @@ namespace PETScWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const std::vector<unsigned int> &indices,
-              const FullMatrix<PetscScalar>   &full_matrix,
-              const bool                       elide_zero_values = false);
+    void set (const std::vector<size_type>  &indices,
+              const FullMatrix<PetscScalar> &full_matrix,
+              const bool                     elide_zero_values = false);
 
     /**
      * Same function as before, but now
@@ -400,10 +419,10 @@ namespace PETScWrappers
      * different local-to-global indexing
      * on rows and columns, respectively.
      */
-    void set (const std::vector<unsigned int> &row_indices,
-              const std::vector<unsigned int> &col_indices,
-              const FullMatrix<PetscScalar>   &full_matrix,
-              const bool                       elide_zero_values = false);
+    void set (const std::vector<size_type>  &row_indices,
+              const std::vector<size_type>  &col_indices,
+              const FullMatrix<PetscScalar> &full_matrix,
+              const bool                     elide_zero_values = false);
 
     /**
      * Set several elements in the
@@ -431,10 +450,10 @@ namespace PETScWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const unsigned int               row,
-              const std::vector<unsigned int> &col_indices,
+    void set (const size_type                 row,
+              const std::vector<size_type >  &col_indices,
               const std::vector<PetscScalar>  &values,
-              const bool                       elide_zero_values = false);
+              const bool                      elide_zero_values = false);
 
     /**
      * Set several elements to values
@@ -462,11 +481,11 @@ namespace PETScWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const unsigned int  row,
-              const unsigned int  n_cols,
-              const unsigned int *col_indices,
+    void set (const size_type    row,
+              const size_type    n_cols,
+              const size_type   *col_indices,
               const PetscScalar  *values,
-              const bool          elide_zero_values = false);
+              const bool         elide_zero_values = false);
 
     /**
      * Add @p value to the element
@@ -483,8 +502,8 @@ namespace PETScWrappers
      * If <tt>value</tt> is not a finite
      * number an exception is thrown.
      */
-    void add (const unsigned int i,
-              const unsigned int j,
+    void add (const size_type   i,
+              const size_type   j,
               const PetscScalar value);
 
     /**
@@ -524,9 +543,9 @@ namespace PETScWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const std::vector<unsigned int> &indices,
-              const FullMatrix<PetscScalar>   &full_matrix,
-              const bool                       elide_zero_values = true);
+    void add (const std::vector<size_type>  &indices,
+              const FullMatrix<PetscScalar> &full_matrix,
+              const bool                     elide_zero_values = true);
 
     /**
      * Same function as before, but now
@@ -535,10 +554,10 @@ namespace PETScWrappers
      * different local-to-global indexing
      * on rows and columns, respectively.
      */
-    void add (const std::vector<unsigned int> &row_indices,
-              const std::vector<unsigned int> &col_indices,
-              const FullMatrix<PetscScalar>   &full_matrix,
-              const bool                       elide_zero_values = true);
+    void add (const std::vector<size_type>  &row_indices,
+              const std::vector<size_type>  &col_indices,
+              const FullMatrix<PetscScalar> &full_matrix,
+              const bool                     elide_zero_values = true);
 
     /**
      * Set several elements in the
@@ -567,10 +586,10 @@ namespace PETScWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const unsigned int               row,
-              const std::vector<unsigned int> &col_indices,
+    void add (const size_type                 row,
+              const std::vector<size_type>   &col_indices,
               const std::vector<PetscScalar>  &values,
-              const bool                       elide_zero_values = true);
+              const bool                      elide_zero_values = true);
 
     /**
      * Add an array of values given by
@@ -599,12 +618,12 @@ namespace PETScWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const unsigned int  row,
-              const unsigned int  n_cols,
-              const unsigned int *col_indices,
+    void add (const size_type    row,
+              const size_type    n_cols,
+              const size_type   *col_indices,
               const PetscScalar  *values,
-              const bool          elide_zero_values = true,
-              const bool          col_indices_are_sorted = false);
+              const bool         elide_zero_values = true,
+              const bool         col_indices_are_sorted = false);
 
     /**
      * Remove all elements from
@@ -636,8 +655,8 @@ namespace PETScWrappers
      * to a value different from zero. The
      * default is to set it to zero.
      */
-    void clear_row (const unsigned int row,
-                    const PetscScalar  new_diag_value = 0);
+    void clear_row (const size_type   row,
+                    const PetscScalar new_diag_value = 0);
 
     /**
      * Same as clear_row(), except that it
@@ -652,8 +671,8 @@ namespace PETScWrappers
      * the diagonal entries, you have to
      * set them by hand.
      */
-    void clear_rows (const std::vector<unsigned int> &rows,
-                     const PetscScalar                new_diag_value = 0);
+    void clear_rows (const std::vector<size_type> &rows,
+                     const PetscScalar             new_diag_value = 0);
 
     /**
      * PETSc matrices store their own
@@ -695,8 +714,8 @@ namespace PETScWrappers
      * This function is therefore exactly
      * equivalent to the <tt>el()</tt> function.
      */
-    PetscScalar operator () (const unsigned int i,
-                             const unsigned int j) const;
+    PetscScalar operator () (const size_type i,
+                             const size_type j) const;
 
     /**
      * Return the value of the matrix entry
@@ -709,8 +728,8 @@ namespace PETScWrappers
      * solution, since the sparsity of the
      * matrix is not used.
      */
-    PetscScalar el (const unsigned int i,
-                    const unsigned int j) const;
+    PetscScalar el (const size_type i,
+                    const size_type j) const;
 
     /**
      * Return the main diagonal
@@ -727,19 +746,19 @@ namespace PETScWrappers
      * function for compatibility with the
      * SparseMatrix class.
      */
-    PetscScalar diag_element (const unsigned int i) const;
+    PetscScalar diag_element (const size_type i) const;
 
     /**
      * Return the number of rows in this
      * matrix.
      */
-    unsigned int m () const;
+    size_type m () const;
 
     /**
      * Return the number of columns in this
      * matrix.
      */
-    unsigned int n () const;
+    size_type n () const;
 
     /**
      * Return the local dimension of the
@@ -754,7 +773,7 @@ namespace PETScWrappers
      * exactly are stored locally,
      * use local_range().
      */
-    unsigned int local_size () const;
+    size_type local_size () const;
 
     /**
      * Return a pair of indices
@@ -772,7 +791,7 @@ namespace PETScWrappers
      * a pair (i,i+n), where
      * <tt>n=local_size()</tt>.
      */
-    std::pair<unsigned int, unsigned int>
+    std::pair<size_type, size_type>
     local_range () const;
 
     /**
@@ -780,7 +799,7 @@ namespace PETScWrappers
      * in the local range or not,
      * see also local_range().
      */
-    bool in_local_range (const unsigned int index) const;
+    bool in_local_range (const size_type index) const;
 
     /**
      * Return a reference to the MPI
@@ -799,12 +818,12 @@ namespace PETScWrappers
      * the entries should happen to
      * be zero, it is counted anyway.
      */
-    unsigned int n_nonzero_elements () const;
+    size_type n_nonzero_elements () const;
 
     /**
      * Number of entries in a specific row.
      */
-    unsigned int row_length (const unsigned int row) const;
+    size_type row_length (const size_type row) const;
 
     /**
      * Return the l1-norm of the matrix, that is
@@ -916,7 +935,7 @@ namespace PETScWrappers
      * diagonal entries in the
      * matrix.
      */
-    PetscReal trace () const;
+    PetscScalar trace () const;
 #endif
 
     /**
@@ -935,8 +954,8 @@ namespace PETScWrappers
      * Add the matrix @p other scaled by the factor @p factor to the current
      * matrix.
      */
-    MatrixBase & add (const MatrixBase &other,
-                     const PetscScalar factor);
+    MatrixBase &add (const MatrixBase &other,
+                     const PetscScalar factor);
 
     /**
      * Matrix-vector multiplication:
@@ -1084,7 +1103,7 @@ namespace PETScWrappers
      * iterator may not be dereferencable in
      * that case.
      */
-    const_iterator begin (const unsigned int r) const;
+    const_iterator begin (const size_type r) const;
 
     /**
      * Final iterator of row <tt>r</tt>. It
@@ -1097,7 +1116,7 @@ namespace PETScWrappers
      * particular the case if it is the end
      * iterator for the last row of a matrix.
      */
-    const_iterator end (const unsigned int r) const;
+    const_iterator end (const size_type r) const;
 
     /**
      * Conversion operator to gain access
@@ -1158,6 +1177,13 @@ namespace PETScWrappers
      */
     void write_ascii (const PetscViewerFormat format = PETSC_VIEWER_DEFAULT);
 
+    /**
+     * print command, similar to write_ascii, but the same format as
+     * produced by Trilinos
+     */
+    void print (std::ostream &out,
+                const bool    alternative_output = false) const;
+
     /**
      *  Returns the number bytes consumed
      *  by this matrix on this CPU.
@@ -1278,6 +1304,16 @@ namespace PETScWrappers
 
 
   private:
+
+    /**
+     * purposefully not implemented
+     */
+    MatrixBase(const MatrixBase &);
+    /**
+     * purposefully not implemented
+     */
+    MatrixBase &operator=(const MatrixBase &);
+
     /**
      * An internal array of integer
      * values that is used to store the
@@ -1316,9 +1352,9 @@ namespace PETScWrappers
 
     inline
     const_iterator::Accessor::
-    Accessor (const MatrixBase   *matrix,
-              const unsigned int  row,
-              const unsigned int  index)
+    Accessor (const MatrixBase *matrix,
+              const size_type   row,
+              const size_type   index)
       :
       matrix(const_cast<MatrixBase *>(matrix)),
       a_row(row),
@@ -1329,7 +1365,7 @@ namespace PETScWrappers
 
 
     inline
-    unsigned int
+    const_iterator::Accessor::size_type
     const_iterator::Accessor::row() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -1338,7 +1374,7 @@ namespace PETScWrappers
 
 
     inline
-    unsigned int
+    const_iterator::Accessor::size_type
     const_iterator::Accessor::column() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -1347,7 +1383,7 @@ namespace PETScWrappers
 
 
     inline
-    unsigned int
+    const_iterator::Accessor::size_type
     const_iterator::Accessor::index() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -1366,9 +1402,9 @@ namespace PETScWrappers
 
     inline
     const_iterator::
-    const_iterator(const MatrixBase   *matrix,
-                   const unsigned int  row,
-                   const unsigned int  index)
+    const_iterator(const MatrixBase *matrix,
+                   const size_type   row,
+                   const size_type   index)
       :
       accessor(matrix, row, index)
     {}
@@ -1470,9 +1506,9 @@ namespace PETScWrappers
   // compile time.
   inline
   void
-  MatrixBase::set (const unsigned int i,
-                   const unsigned int j,
-                   const PetscScalar  value)
+  MatrixBase::set (const size_type   i,
+                   const size_type   j,
+                   const PetscScalar value)
   {
     Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
@@ -1483,15 +1519,15 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::set (const std::vector<unsigned int> &indices,
-                   const FullMatrix<PetscScalar>   &values,
-                   const bool                       elide_zero_values)
+  MatrixBase::set (const std::vector<size_type>  &indices,
+                   const FullMatrix<PetscScalar> &values,
+                   const bool                     elide_zero_values)
   {
     Assert (indices.size() == values.m(),
             ExcDimensionMismatch(indices.size(), values.m()));
     Assert (values.m() == values.n(), ExcNotQuadratic());
 
-    for (unsigned int i=0; i<indices.size(); ++i)
+    for (size_type i=0; i<indices.size(); ++i)
       set (indices[i], indices.size(), &indices[0], &values(i,0),
            elide_zero_values);
   }
@@ -1500,17 +1536,17 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::set (const std::vector<unsigned int> &row_indices,
-                   const std::vector<unsigned int> &col_indices,
-                   const FullMatrix<PetscScalar>   &values,
-                   const bool                       elide_zero_values)
+  MatrixBase::set (const std::vector<size_type>  &row_indices,
+                   const std::vector<size_type>  &col_indices,
+                   const FullMatrix<PetscScalar> &values,
+                   const bool                     elide_zero_values)
   {
     Assert (row_indices.size() == values.m(),
             ExcDimensionMismatch(row_indices.size(), values.m()));
     Assert (col_indices.size() == values.n(),
             ExcDimensionMismatch(col_indices.size(), values.n()));
 
-    for (unsigned int i=0; i<row_indices.size(); ++i)
+    for (size_type i=0; i<row_indices.size(); ++i)
       set (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
            elide_zero_values);
   }
@@ -1519,10 +1555,10 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::set (const unsigned int               row,
-                   const std::vector<unsigned int> &col_indices,
+  MatrixBase::set (const size_type                 row,
+                   const std::vector<size_type>   &col_indices,
                    const std::vector<PetscScalar>  &values,
-                   const bool                       elide_zero_values)
+                   const bool                      elide_zero_values)
   {
     Assert (col_indices.size() == values.size(),
             ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1535,11 +1571,11 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::set (const unsigned int  row,
-                   const unsigned int  n_cols,
-                   const unsigned int *col_indices,
+  MatrixBase::set (const size_type    row,
+                   const size_type    n_cols,
+                   const size_type   *col_indices,
                    const PetscScalar  *values,
-                   const bool          elide_zero_values)
+                   const bool         elide_zero_values)
   {
     prepare_action(LastAction::insert);
 
@@ -1570,7 +1606,7 @@ namespace PETScWrappers
           }
 
         n_columns = 0;
-        for (unsigned int j=0; j<n_cols; ++j)
+        for (size_type j=0; j<n_cols; ++j)
           {
             const PetscScalar value = values[j];
             Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -1597,9 +1633,9 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const unsigned int i,
-                   const unsigned int j,
-                   const PetscScalar  value)
+  MatrixBase::add (const size_type   i,
+                   const size_type   j,
+                   const PetscScalar value)
   {
 
     Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -1628,15 +1664,15 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const std::vector<unsigned int> &indices,
-                   const FullMatrix<PetscScalar>   &values,
-                   const bool                       elide_zero_values)
+  MatrixBase::add (const std::vector<size_type>  &indices,
+                   const FullMatrix<PetscScalar> &values,
+                   const bool                     elide_zero_values)
   {
     Assert (indices.size() == values.m(),
             ExcDimensionMismatch(indices.size(), values.m()));
     Assert (values.m() == values.n(), ExcNotQuadratic());
 
-    for (unsigned int i=0; i<indices.size(); ++i)
+    for (size_type i=0; i<indices.size(); ++i)
       add (indices[i], indices.size(), &indices[0], &values(i,0),
            elide_zero_values);
   }
@@ -1645,17 +1681,17 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const std::vector<unsigned int> &row_indices,
-                   const std::vector<unsigned int> &col_indices,
-                   const FullMatrix<PetscScalar>   &values,
-                   const bool                       elide_zero_values)
+  MatrixBase::add (const std::vector<size_type>  &row_indices,
+                   const std::vector<size_type>  &col_indices,
+                   const FullMatrix<PetscScalar> &values,
+                   const bool                     elide_zero_values)
   {
     Assert (row_indices.size() == values.m(),
             ExcDimensionMismatch(row_indices.size(), values.m()));
     Assert (col_indices.size() == values.n(),
             ExcDimensionMismatch(col_indices.size(), values.n()));
 
-    for (unsigned int i=0; i<row_indices.size(); ++i)
+    for (size_type i=0; i<row_indices.size(); ++i)
       add (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
            elide_zero_values);
   }
@@ -1664,10 +1700,10 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const unsigned int               row,
-                   const std::vector<unsigned int> &col_indices,
+  MatrixBase::add (const size_type                 row,
+                   const std::vector<size_type>   &col_indices,
                    const std::vector<PetscScalar>  &values,
-                   const bool                       elide_zero_values)
+                   const bool                      elide_zero_values)
   {
     Assert (col_indices.size() == values.size(),
             ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1680,11 +1716,11 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const unsigned int  row,
-                   const unsigned int  n_cols,
-                   const unsigned int *col_indices,
+  MatrixBase::add (const size_type    row,
+                   const size_type    n_cols,
+                   const size_type   *col_indices,
                    const PetscScalar  *values,
-                   const bool          elide_zero_values,
+                   const bool         elide_zero_values,
                    const bool          /*col_indices_are_sorted*/)
   {
     prepare_action(LastAction::add);
@@ -1716,7 +1752,7 @@ namespace PETScWrappers
           }
 
         n_columns = 0;
-        for (unsigned int j=0; j<n_cols; ++j)
+        for (size_type j=0; j<n_cols; ++j)
           {
             const PetscScalar value = values[j];
             Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -1746,8 +1782,8 @@ namespace PETScWrappers
 
   inline
   PetscScalar
-  MatrixBase::operator() (const unsigned int i,
-                          const unsigned int j) const
+  MatrixBase::operator() (const size_type i,
+                          const size_type j) const
   {
     return el(i,j);
   }
@@ -1772,7 +1808,7 @@ namespace PETScWrappers
 
   inline
   MatrixBase::const_iterator
-  MatrixBase::begin(const unsigned int r) const
+  MatrixBase::begin(const size_type r) const
   {
     Assert (r < m(), ExcIndexRange(r, 0, m()));
     if (row_length(r) > 0)
@@ -1784,14 +1820,14 @@ namespace PETScWrappers
 
   inline
   MatrixBase::const_iterator
-  MatrixBase::end(const unsigned int r) const
+  MatrixBase::end(const size_type r) const
   {
     Assert (r < m(), ExcIndexRange(r, 0, m()));
 
     // place the iterator on the first entry
     // past this line, or at the end of the
     // matrix
-    for (unsigned int i=r+1; i<m(); ++i)
+    for (size_type i=r+1; i<m(); ++i)
       if (row_length(i) > 0)
         return const_iterator(this, i, 0);
 
@@ -1804,7 +1840,7 @@ namespace PETScWrappers
 
   inline
   bool
-  MatrixBase::in_local_range (const unsigned int index) const
+  MatrixBase::in_local_range (const size_type index) const
   {
     PetscInt begin, end;
 
@@ -1812,8 +1848,8 @@ namespace PETScWrappers
                                            &begin, &end);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-    return ((index >= static_cast<unsigned int>(begin)) &&
-            (index < static_cast<unsigned int>(end)));
+    return ((index >= static_cast<size_type>(begin)) &&
+            (index < static_cast<size_type>(end)));
   }
 
 
index c7217178d3066b5c0bc0a107e259d5b0516fdd53..1c64f15c6d102c08ced844c0c6938bde904fbd05 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #ifndef __deal2__petsc_matrix_free_h
 #define __deal2__petsc_matrix_free_h
@@ -34,14 +36,14 @@ namespace PETScWrappers
    * Implementation of a parallel matrix class based on PETSc <tt>MatShell</tt> matrix-type.
    * This base class implements only the interface to the PETSc matrix object,
    * while all the functionality is contained in the matrix-vector
-   * multiplication which must be reimplmented in derived classes.
+   * multiplication which must be reimplemented in derived classes.
    *
    * This interface is an addition to the dealii::MatrixFree class to realize
    * user-defined matrix-classes together with PETSc solvers and functionalities.
    * See also the documentation of dealii::MatrixFree class and step-37 and step-48.
    *
    * Similar to other matrix classes in namespaces PETScWrappers and PETScWrappers::MPI,
-   * the MatrxiFree class provides the usual matrix-vector multiplication
+   * the MatrixFree class provides the usual matrix-vector multiplication
    *   <tt>vmult(VectorBase &dst, const VectorBase &src)</tt>
    * which is pure virtual and must be reimplemented in derived classes.
    * Besides the usual interface, this class has a matrix-vector multiplication
index ac317b1fc09f168a46235d3421cb037a7218d025..f52a9a5f307340d07e94fcab35abb88ab88af42e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_parallel_block_sparse_matrix_h
 #define __deal2__petsc_parallel_block_sparse_matrix_h
 
@@ -19,6 +24,7 @@
 
 #  include <deal.II/base/table.h>
 #  include <deal.II/lac/block_matrix_base.h>
+#  include <deal.II/lac/block_sparsity_pattern.h>
 #  include <deal.II/lac/petsc_parallel_sparse_matrix.h>
 #  include <deal.II/lac/petsc_parallel_block_vector.h>
 #  include <deal.II/lac/exceptions.h>
@@ -169,8 +175,33 @@ namespace PETScWrappers
        * user call whatever function
        * she desires.
        */
-      void reinit (const unsigned int n_block_rows,
-                   const unsigned int n_block_columns);
+      void reinit (const size_type n_block_rows,
+                   const size_type n_block_columns);
+
+
+      /**
+       * Efficiently reinit the block matrix for a parallel computation.
+       * Only the BlockSparsityPattern of the Simple type can efficiently
+       * store large sparsity patterns in parallel, so this is the only
+       * supported argument.
+       * The IndexSets describe the locally owned range of DoFs for each block.
+       * Note that each IndexSet needs to be contiguous. For a symmetric structure
+       * hand in the same vector for the first two arguments.
+       */
+      void reinit(const std::vector<IndexSet> &rows,
+                  const std::vector<IndexSet> &cols,
+                  const BlockCompressedSimpleSparsityPattern &bcsp,
+                  const MPI_Comm &com);
+
+
+      /**
+       * Same as above but for a symmetric structure only.
+       */
+      void reinit(const std::vector<IndexSet> &sizes,
+                  const BlockCompressedSimpleSparsityPattern &bcsp,
+                  const MPI_Comm &com);
+
+
 
       /**
        * Matrix-vector multiplication:
@@ -292,8 +323,8 @@ namespace PETScWrappers
     {
       Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
 
-      for (unsigned int r=0; r<this->n_block_rows(); ++r)
-        for (unsigned int c=0; c<this->n_block_cols(); ++c)
+      for (size_type r=0; r<this->n_block_rows(); ++r)
+        for (size_type c=0; c<this->n_block_cols(); ++c)
           this->block(r,c) = d;
 
       return *this;
index 33482381d21fe4c46b3c11cf964b765ac061de9a..7d52ee379216f3843d6a890e18fb82b3cb4f548d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_parallel_block_vector_h
 #define __deal2__petsc_parallel_block_vector_h
 
@@ -99,8 +104,8 @@ namespace PETScWrappers
        */
       explicit BlockVector (const unsigned int  n_blocks,
                             const MPI_Comm     &communicator,
-                            const unsigned int  block_size,
-                            const unsigned int  local_size);
+                            const size_type     block_size,
+                            const size_type     local_size);
 
       /**
        * Copy-Constructor. Set all the
@@ -122,9 +127,9 @@ namespace PETScWrappers
        * <tt>local_elements[i]</tt>
        * elements on the present process.
        */
-      BlockVector (const std::vector<unsigned int> &block_sizes,
-                   const MPI_Comm                  &communicator,
-                   const std::vector<unsigned int> &local_elements);
+      BlockVector (const std::vector<size_type> &block_sizes,
+                   const MPI_Comm               &communicator,
+                   const std::vector<size_type> &local_elements);
 
       /**
        * Create a BlockVector with parallel_partitioning.size() blocks,
@@ -133,6 +138,15 @@ namespace PETScWrappers
       explicit BlockVector (const std::vector<IndexSet> &parallel_partitioning,
                             const MPI_Comm &communicator = MPI_COMM_WORLD);
 
+      /**
+       * Same as above, but include ghost elements
+       */
+      BlockVector (const std::vector<IndexSet> &parallel_partitioning,
+                   const std::vector<IndexSet> &ghost_indices,
+                   const MPI_Comm &communicator);
+
+
+
       /**
        * Destructor. Clears memory
        */
@@ -199,8 +213,8 @@ namespace PETScWrappers
        */
       void reinit (const unsigned int  n_blocks,
                    const MPI_Comm     &communicator,
-                   const unsigned int  block_size,
-                   const unsigned int  local_size,
+                   const size_type     block_size,
+                   const size_type     local_size,
                    const bool fast = false);
 
       /**
@@ -238,10 +252,10 @@ namespace PETScWrappers
        * since they may be routed to
        * the wrong block.
        */
-      void reinit (const std::vector<unsigned int> &block_sizes,
-                   const MPI_Comm                  &communicator,
-                   const std::vector<unsigned int> &local_sizes,
-                   const bool                       fast=false);
+      void reinit (const std::vector<size_type> &block_sizes,
+                   const MPI_Comm               &communicator,
+                   const std::vector<size_type> &local_sizes,
+                   const bool                    fast=false);
 
       /**
        * Change the dimension to that
@@ -279,6 +293,26 @@ namespace PETScWrappers
       void reinit (const std::vector<IndexSet> &parallel_partitioning,
                    const MPI_Comm              &communicator);
 
+      /**
+       * Same as above but include ghost entries.
+       */
+      void reinit (const std::vector<IndexSet> &parallel_partitioning,
+                   const std::vector<IndexSet> &ghost_entries,
+                   const MPI_Comm              &communicator);
+
+      /**
+       * Change the number of blocks to
+       * <tt>num_blocks</tt>. The individual
+       * blocks will get initialized with
+       * zero size, so it is assumed that
+       * the user resizes the
+       * individual blocks by herself
+       * in an appropriate way, and
+       * calls <tt>collect_sizes</tt>
+       * afterwards.
+       */
+      void reinit (const unsigned int num_blocks);
+
       /**
        * Return a reference to the MPI
        * communicator object in use with
@@ -350,8 +384,8 @@ namespace PETScWrappers
     inline
     BlockVector::BlockVector (const unsigned int  n_blocks,
                               const MPI_Comm     &communicator,
-                              const unsigned int  block_size,
-                              const unsigned int  local_size)
+                              const size_type     block_size,
+                              const size_type     local_size)
     {
       reinit (n_blocks, communicator, block_size, local_size);
     }
@@ -359,9 +393,9 @@ namespace PETScWrappers
 
 
     inline
-    BlockVector::BlockVector (const std::vector<unsigned int> &block_sizes,
+    BlockVector::BlockVector (const std::vector<size_type> &block_sizes,
                               const MPI_Comm     &communicator,
-                              const std::vector<unsigned int> &local_elements)
+                              const std::vector<size_type> &local_elements)
     {
       reinit (block_sizes, communicator, local_elements, false);
     }
@@ -381,11 +415,18 @@ namespace PETScWrappers
 
     inline
     BlockVector::BlockVector (const std::vector<IndexSet> &parallel_partitioning,
-                 const MPI_Comm              &communicator)
+                              const MPI_Comm              &communicator)
     {
       reinit(parallel_partitioning, communicator);
     }
 
+    inline
+    BlockVector::BlockVector (const std::vector<IndexSet> &parallel_partitioning,
+                              const std::vector<IndexSet> &ghost_indices,
+                              const MPI_Comm &communicator)
+    {
+      reinit(parallel_partitioning, ghost_indices, communicator);
+    }
 
     inline
     BlockVector &
@@ -416,13 +457,13 @@ namespace PETScWrappers
     void
     BlockVector::reinit (const unsigned int  n_blocks,
                          const MPI_Comm     &communicator,
-                         const unsigned int  block_size,
-                         const unsigned int  local_size,
+                         const size_type     block_size,
+                         const size_type     local_size,
                          const bool fast)
     {
-      reinit(std::vector<unsigned int>(n_blocks, block_size),
+      reinit(std::vector<size_type>(n_blocks, block_size),
              communicator,
-             std::vector<unsigned int>(n_blocks, local_size),
+             std::vector<size_type>(n_blocks, local_size),
              fast);
     }
 
@@ -430,10 +471,10 @@ namespace PETScWrappers
 
     inline
     void
-    BlockVector::reinit (const std::vector<unsigned int> &block_sizes,
-                         const MPI_Comm                  &communicator,
-                         const std::vector<unsigned int> &local_sizes,
-                         const bool                       fast)
+    BlockVector::reinit (const std::vector<size_type> &block_sizes,
+                         const MPI_Comm               &communicator,
+                         const std::vector<size_type> &local_sizes,
+                         const bool                    fast)
     {
       this->block_indices.reinit (block_sizes);
       if (this->components.size() != this->n_blocks())
@@ -461,9 +502,9 @@ namespace PETScWrappers
     inline
     void
     BlockVector::reinit (const std::vector<IndexSet> &parallel_partitioning,
-                 const MPI_Comm              &communicator)
+                         const MPI_Comm              &communicator)
     {
-      std::vector<unsigned int> sizes(parallel_partitioning.size());
+      std::vector<size_type> sizes(parallel_partitioning.size());
       for (unsigned int i=0; i<parallel_partitioning.size(); ++i)
         sizes[i] = parallel_partitioning[i].size();
 
@@ -472,9 +513,28 @@ namespace PETScWrappers
         this->components.resize(this->n_blocks());
 
       for (unsigned int i=0; i<this->n_blocks(); ++i)
-        block(i).reinit(communicator, parallel_partitioning[i]);
+        block(i).reinit(parallel_partitioning[i], communicator);
     }
 
+    inline
+    void
+    BlockVector::reinit (const std::vector<IndexSet> &parallel_partitioning,
+                         const std::vector<IndexSet> &ghost_entries,
+                         const MPI_Comm              &communicator)
+    {
+      std::vector<types::global_dof_index> sizes(parallel_partitioning.size());
+      for (unsigned int i=0; i<parallel_partitioning.size(); ++i)
+        sizes[i] = parallel_partitioning[i].size();
+
+      this->block_indices.reinit(sizes);
+      if (this->components.size() != this->n_blocks())
+        this->components.resize(this->n_blocks());
+
+      for (unsigned int i=0; i<this->n_blocks(); ++i)
+        block(i).reinit(parallel_partitioning[i], ghost_entries[i], communicator);
+    }
+
+
 
     inline
     const MPI_Comm &
index 29dded85910ed00dd69071d21199e1e7c7e1e212..6bfa4df7dd3e8df3dc77bace4b5c1043d90ef185 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_parallel_sparse_matrix_h
 #define __deal2__petsc_parallel_sparse_matrix_h
 
@@ -112,6 +117,10 @@ namespace PETScWrappers
     class SparseMatrix : public MatrixBase
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
 
       /**
        * A structure that describes some of
@@ -179,13 +188,13 @@ namespace PETScWrappers
        * ICC. The default value of this flag
        * is @p false.
        */
-      SparseMatrix (const MPI_Comm     &communicator,
-                    const unsigned int  m,
-                    const unsigned int  n,
-                    const unsigned int  local_rows,
-                    const unsigned int  local_columns,
-                    const unsigned int  n_nonzero_per_row,
-                    const bool          is_symmetric = false);
+      SparseMatrix (const MPI_Comm  &communicator,
+                    const size_type  m,
+                    const size_type  n,
+                    const size_type  local_rows,
+                    const size_type  local_columns,
+                    const size_type  n_nonzero_per_row,
+                    const bool       is_symmetric = false);
 
       /**
        * Initialize a rectangular matrix
@@ -220,13 +229,13 @@ namespace PETScWrappers
        * true, only an ICC. The default
        * value of this flag is @p false.
        */
-      SparseMatrix (const MPI_Comm                  &communicator,
-                    const unsigned int               m,
-                    const unsigned int               n,
-                    const unsigned int               local_rows,
-                    const unsigned int               local_columns,
-                    const std::vector<unsigned int> &row_lengths,
-                    const bool                       is_symmetric = false);
+      SparseMatrix (const MPI_Comm               &communicator,
+                    const size_type               m,
+                    const size_type               n,
+                    const size_type               local_rows,
+                    const size_type               local_columns,
+                    const std::vector<size_type> &row_lengths,
+                    const bool                    is_symmetric = false);
 
       /**
        * Initialize using the given
@@ -269,12 +278,12 @@ namespace PETScWrappers
        * the start.
        */
       template <typename SparsityType>
-      SparseMatrix (const MPI_Comm                  &communicator,
-                    const SparsityType              &sparsity_pattern,
-                    const std::vector<unsigned int> &local_rows_per_process,
-                    const std::vector<unsigned int> &local_columns_per_process,
-                    const unsigned int               this_process,
-                    const bool                       preset_nonzero_locations = true);
+      SparseMatrix (const MPI_Comm               &communicator,
+                    const SparsityType           &sparsity_pattern,
+                    const std::vector<size_type> &local_rows_per_process,
+                    const std::vector<size_type> &local_columns_per_process,
+                    const unsigned int            this_process,
+                    const bool                    preset_nonzero_locations = true);
 
       /**
        * This operator assigns a scalar to
@@ -294,6 +303,13 @@ namespace PETScWrappers
        */
       SparseMatrix &operator = (const value_type d);
 
+
+      /**
+       * Make a copy of the PETSc matrix @p other. It is assumed that both matrices have
+       * the same SparsityPattern.
+       */
+      void copy_from(const SparseMatrix &other);
+
       /**
        * Throw away the present matrix and
        * generate one that has the same
@@ -303,12 +319,12 @@ namespace PETScWrappers
        * present function.
        */
       void reinit (const MPI_Comm     &communicator,
-                   const unsigned int  m,
-                   const unsigned int  n,
-                   const unsigned int  local_rows,
-                   const unsigned int  local_columns,
-                   const unsigned int  n_nonzero_per_row,
-                   const bool          is_symmetric = false);
+                   const size_type m,
+                   const size_type n,
+                   const size_type local_rows,
+                   const size_type local_columns,
+                   const size_type n_nonzero_per_row,
+                   const bool      is_symmetric = false);
 
       /**
        * Throw away the present matrix and
@@ -318,13 +334,13 @@ namespace PETScWrappers
        * the same argument list as the
        * present function.
        */
-      void reinit (const MPI_Comm                  &communicator,
-                   const unsigned int               m,
-                   const unsigned int               n,
-                   const unsigned int               local_rows,
-                   const unsigned int               local_columns,
-                   const std::vector<unsigned int> &row_lengths,
-                   const bool                       is_symmetric = false);
+      void reinit (const MPI_Comm               &communicator,
+                   const size_type               m,
+                   const size_type               n,
+                   const size_type               local_rows,
+                   const size_type               local_columns,
+                   const std::vector<size_type> &row_lengths,
+                   const bool                    is_symmetric = false);
 
       /**
        * Initialize using the given
@@ -361,12 +377,24 @@ namespace PETScWrappers
        * the start.
        */
       template <typename SparsityType>
-      void reinit (const MPI_Comm                  &communicator,
-                   const SparsityType              &sparsity_pattern,
-                   const std::vector<unsigned int> &local_rows_per_process,
-                   const std::vector<unsigned int> &local_columns_per_process,
-                   const unsigned int               this_process,
-                   const bool                       preset_nonzero_locations = true);
+      void reinit (const MPI_Comm               &communicator,
+                   const SparsityType           &sparsity_pattern,
+                   const std::vector<size_type> &local_rows_per_process,
+                   const std::vector<size_type> &local_columns_per_process,
+                   const unsigned int            this_process,
+                   const bool                    preset_nonzero_locations = true);
+
+      /**
+       * Create a matrix where the size() of the IndexSets determine the global
+       * number of rows and columns and the entries of the IndexSet give
+       * the rows and columns for the calling processor.
+       * Note that only contiguous IndexSets are supported.
+       */
+      template <typename SparsityType>
+      void reinit (const IndexSet &local_rows,
+                   const IndexSet &local_columns,
+                   const SparsityType         &sparsity_pattern,
+                   const MPI_Comm                  &communicator);
 
       /**
        * Return a reference to the MPI
@@ -445,32 +473,40 @@ namespace PETScWrappers
        * of the previous matrix is left to
        * the caller.
        */
-      void do_reinit (const unsigned int m,
-                      const unsigned int n,
-                      const unsigned int local_rows,
-                      const unsigned int local_columns,
-                      const unsigned int n_nonzero_per_row,
-                      const bool         is_symmetric = false);
+      void do_reinit (const size_type m,
+                      const size_type n,
+                      const size_type local_rows,
+                      const size_type local_columns,
+                      const size_type n_nonzero_per_row,
+                      const bool      is_symmetric = false);
 
       /**
        * Same as previous function.
        */
-      void do_reinit (const unsigned int               m,
-                      const unsigned int               n,
-                      const unsigned int               local_rows,
-                      const unsigned int               local_columns,
-                      const std::vector<unsigned int> &row_lengths,
-                      const bool                       is_symmetric = false);
+      void do_reinit (const size_type               m,
+                      const size_type               n,
+                      const size_type               local_rows,
+                      const size_type               local_columns,
+                      const std::vector<size_type> &row_lengths,
+                      const bool                    is_symmetric = false);
+
+      /**
+       * Same as previous functions.
+       */
+      template <typename SparsityType>
+      void do_reinit (const SparsityType           &sparsity_pattern,
+                      const std::vector<size_type> &local_rows_per_process,
+                      const std::vector<size_type> &local_columns_per_process,
+                      const unsigned int            this_process,
+                      const bool                    preset_nonzero_locations);
 
       /**
        * Same as previous functions.
        */
       template <typename SparsityType>
-      void do_reinit (const SparsityType              &sparsity_pattern,
-                      const std::vector<unsigned int> &local_rows_per_process,
-                      const std::vector<unsigned int> &local_columns_per_process,
-                      const unsigned int               this_process,
-                      const bool                       preset_nonzero_locations);
+      void do_reinit (const IndexSet &local_rows,
+                      const IndexSet &local_columns,
+                      const SparsityType         &sparsity_pattern);
 
       /**
        *  To allow calling protected
index 0ace1893568a4537e520c52e11843b5d7d1e8792..95cdddc2145cdd955649f50d3c831b1b7932c940 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_parallel_vector_h
 #define __deal2__petsc_parallel_vector_h
 
@@ -153,6 +158,11 @@ namespace PETScWrappers
     class Vector : public VectorBase
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
+
       /**
        * A variable that indicates whether this vector
        * supports distributed data storage. If true, then
@@ -166,10 +176,10 @@ namespace PETScWrappers
        */
       static const bool supports_distributed_data = true;
 
-         /**
-       * Default constructor. Initialize the
-       * vector as empty.
-       */
+      /**
+      * Default constructor. Initialize the
+      * vector as empty.
+      */
       Vector ();
 
       /**
@@ -196,9 +206,9 @@ namespace PETScWrappers
        * vector is replaced by one of
        * length zero.
        */
-      explicit Vector (const MPI_Comm     &communicator,
-                       const unsigned int  n,
-                       const unsigned int  local_size);
+      explicit Vector (const MPI_Comm  &communicator,
+                       const size_type  n,
+                       const size_type  local_size);
 
 
       /**
@@ -217,9 +227,9 @@ namespace PETScWrappers
        * shall communicate
        */
       template <typename Number>
-      explicit Vector (const MPI_Comm         &communicator,
+      explicit Vector (const MPI_Comm               &communicator,
                        const dealii::Vector<Number> &v,
-                       const unsigned int      local_size);
+                       const size_type               local_size);
 
 
       /**
@@ -238,7 +248,7 @@ namespace PETScWrappers
        */
       explicit Vector (const MPI_Comm     &communicator,
                        const VectorBase   &v,
-                       const unsigned int  local_size);
+                       const size_type     local_size);
 
 
       /**
@@ -264,15 +274,47 @@ namespace PETScWrappers
        */
       explicit Vector (const MPI_Comm     &communicator,
                        const IndexSet   &local,
-                       const IndexSet &ghost);
+                       const IndexSet &ghost) DEAL_II_DEPRECATED;
+
+      /**
+       * Constructs a new parallel ghosted PETSc
+       * vector from an Indexset. Note that
+       * @p local must be contiguous and
+       * the global size of the vector is
+       * determined by local.size(). The
+       * global indices in @p ghost are
+       * supplied as ghost indices that can
+       * also be read locally.
+       *
+       * Note that the @p ghost IndexSet
+       * may be empty and that any indices
+       * already contained in @p local are
+       * ignored during construction. That
+       * way, the ghost parameter can equal
+       * the set of locally relevant
+       * degrees of freedom, see step-32.
+       *
+       * @note This operation always creates a ghosted
+       * vector.
+       */
+      Vector (const IndexSet &local,
+              const IndexSet &ghost,
+              const MPI_Comm &communicator);
 
       /**
        * Constructs a new parallel PETSc
        * vector from an Indexset. This creates a non
        * ghosted vector.
        */
-      explicit Vector (const MPI_Comm     &communicator,
-                       const IndexSet   &local);
+      explicit Vector (const MPI_Comm &communicator,
+                       const IndexSet &local) DEAL_II_DEPRECATED;
+      /**
+       * Constructs a new parallel PETSc
+       * vector from an Indexset. This creates a non
+       * ghosted vector.
+       */
+      explicit Vector (const IndexSet &local,
+                       const MPI_Comm &communicator);
 
       /**
        * Copy the given vector. Resize the
@@ -375,10 +417,10 @@ namespace PETScWrappers
        * elements are left an unspecified
        * state.
        */
-      void reinit (const MPI_Comm     &communicator,
-                   const unsigned int  N,
-                   const unsigned int  local_size,
-                   const bool          fast = false);
+      void reinit (const MPI_Comm  &communicator,
+                   const size_type  N,
+                   const size_type  local_size,
+                   const bool       fast = false);
 
       /**
        * Change the dimension to that of
@@ -404,7 +446,15 @@ namespace PETScWrappers
        */
       void reinit (const MPI_Comm     &communicator,
                    const IndexSet   &local,
-                   const IndexSet &ghost);
+                   const IndexSet &ghost) DEAL_II_DEPRECATED;
+      /**
+       * Reinit as a vector without ghost elements. See
+       * constructor with same signature
+       * for more detais.
+       */
+      void reinit (const IndexSet &local,
+                   const IndexSet &ghost,
+                   const MPI_Comm &communicator);
 
       /**
        * Reinit as a vector without ghost elements. See
@@ -412,7 +462,14 @@ namespace PETScWrappers
        * for more detais.
        */
       void reinit (const MPI_Comm     &communicator,
-                   const IndexSet   &local);
+                   const IndexSet   &local) DEAL_II_DEPRECATED;
+      /**
+       * Reinit as a vector without ghost elements. See
+       * constructor with same signature
+       * for more detais.
+       */
+      void reinit (const IndexSet &local,
+                   const MPI_Comm &communicator);
 
       /**
        * Return a reference to the MPI
@@ -455,8 +512,8 @@ namespace PETScWrappers
        * how many of these elements shall
        * be stored locally.
        */
-      virtual void create_vector (const unsigned int n,
-                                  const unsigned int local_size);
+      virtual void create_vector (const size_type n,
+                                  const size_type local_size);
 
 
 
@@ -468,8 +525,8 @@ namespace PETScWrappers
        * call update_ghost_values() before
        * accessing those.
        */
-      virtual void create_vector (const unsigned int  n,
-                                  const unsigned int  local_size,
+      virtual void create_vector (const size_type n,
+                                  const size_type local_size,
                                   const IndexSet &ghostnodes);
 
 
@@ -505,7 +562,7 @@ namespace PETScWrappers
     template <typename number>
     Vector::Vector (const MPI_Comm         &communicator,
                     const dealii::Vector<number> &v,
-                    const unsigned int      local_size)
+                    const size_type         local_size)
       :
       communicator (communicator)
     {
@@ -603,7 +660,7 @@ namespace PETScWrappers
       // that would take a pointer to an array
       // of PetscScalar values and simply copy
       // n elements verbatim into the vector...
-      for (unsigned int i=0; i<v.size(); ++i)
+      for (size_type i=0; i<v.size(); ++i)
         (*this)(i) = v(i);
 
       compress (::dealii::VectorOperation::insert);
index 2c2a51dc28331bc76f23de7dbcb319a40a701c6b..ec0384986704640a5db2ce2b65d33ae891f5a72a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_precondition_h
 #define __deal2__petsc_precondition_h
 
@@ -899,13 +904,8 @@ namespace PETScWrappers
       unsigned int symmetric;
 
       /**
-       * Patterns of powers of sparsified
-       * matrices can be approximate the
-       * pattern of large entries in the
-       * inverse of a matrix. Powers of a
-       *
        * The sparsity pattern used for the
-       * apprximate inverse is the pattern
+       * approximate inverse is the pattern
        * of a power <tt>B^m</tt> where <tt>B</tt>
        * has been sparsified from the given
        * matrix <tt>A</tt>, <tt>n_level</tt>
index 0e3cc61d1f04b89cbf1f7479e0f1570607284dd4..b3c9ac5c841e223c1f34bb6bdfe680a796f6673a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_solver_h
 #define __deal2__petsc_solver_h
 
@@ -219,11 +224,11 @@ namespace PETScWrappers
      * convergence has been reached.
      */
     static
-      PetscErrorCode convergence_test (KSP                 ksp,
-                                      const PetscInt      iteration,
-                                      const PetscReal     residual_norm,
-                                      KSPConvergedReason *reason,
-                                      void               *solver_control);
+    PetscErrorCode convergence_test (KSP                 ksp,
+                                     const PetscInt      iteration,
+                                     const PetscReal     residual_norm,
+                                     KSPConvergedReason *reason,
+                                     void               *solver_control);
 
     /**
      * A structure that contains the PETSc
@@ -1211,11 +1216,11 @@ namespace PETScWrappers
      * to see if convergence has been reached.
      */
     static
-      PetscErrorCode convergence_test (KSP                ksp,
-                                      const PetscInt     iteration,
-                                      const PetscReal    residual_norm,
-                                      KSPConvergedReason *reason,
-                                      void               *solver_control);
+    PetscErrorCode convergence_test (KSP                ksp,
+                                     const PetscInt     iteration,
+                                     const PetscReal    residual_norm,
+                                     KSPConvergedReason *reason,
+                                     void               *solver_control);
 
     /**
      * A structure that contains the
index bd5e41fcaef2bc685f2b954b7db32f117e07cc35..cd12e0c2d5cc8fb968247ce94478190bf00095a9 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_sparse_matrix_h
 #define __deal2__petsc_sparse_matrix_h
 
@@ -97,10 +102,10 @@ namespace PETScWrappers
      * ICC. The default value of this flag
      * is @p false.
      */
-    SparseMatrix (const unsigned int m,
-                  const unsigned int n,
-                  const unsigned int n_nonzero_per_row,
-                  const bool         is_symmetric = false);
+    SparseMatrix (const size_type m,
+                  const size_type n,
+                  const size_type n_nonzero_per_row,
+                  const bool      is_symmetric = false);
 
     /**
      * Initialize a rectangular matrix with
@@ -130,10 +135,10 @@ namespace PETScWrappers
      * ICC. The default value of this flag
      * is @p false.
      */
-    SparseMatrix (const unsigned int               m,
-                  const unsigned int               n,
-                  const std::vector<unsigned int> &row_lengths,
-                  const bool                       is_symmetric = false);
+    SparseMatrix (const size_type               m,
+                  const size_type               n,
+                  const std::vector<size_type> &row_lengths,
+                  const bool                    is_symmetric = false);
 
     /**
      * Initialize a sparse matrix using the
@@ -168,8 +173,8 @@ namespace PETScWrappers
      * the start.
      */
     template <typename SparsityType>
-    SparseMatrix (const SparsityType &sparsity_pattern,
-                  const bool          preset_nonzero_locations = true);
+    explicit SparseMatrix (const SparsityType &sparsity_pattern,
+                           const bool          preset_nonzero_locations = true);
 
     /**
      * This operator assigns a scalar to
@@ -197,10 +202,10 @@ namespace PETScWrappers
      * the same argument list as the
      * present function.
      */
-    void reinit (const unsigned int m,
-                 const unsigned int n,
-                 const unsigned int n_nonzero_per_row,
-                 const bool         is_symmetric = false);
+    void reinit (const size_type m,
+                 const size_type n,
+                 const size_type n_nonzero_per_row,
+                 const bool      is_symmetric = false);
 
     /**
      * Throw away the present matrix and
@@ -210,10 +215,10 @@ namespace PETScWrappers
      * the same argument list as the
      * present function.
      */
-    void reinit (const unsigned int               m,
-                 const unsigned int               n,
-                 const std::vector<unsigned int> &row_lengths,
-                 const bool                       is_symmetric = false);
+    void reinit (const size_type               m,
+                 const size_type               n,
+                 const std::vector<size_type> &row_lengths,
+                 const bool                    is_symmetric = false);
 
     /**
      * Initialize a sparse matrix using the
@@ -321,6 +326,15 @@ namespace PETScWrappers
 
   private:
 
+    /**
+     * Purposefully not implemented
+     */
+    SparseMatrix(const SparseMatrix &);
+    /**
+     * Purposefully not implemented
+     */
+    SparseMatrix &operator= (const SparseMatrix &);
+
     /**
      * Do the actual work for the
      * respective reinit() function and the
@@ -328,18 +342,18 @@ namespace PETScWrappers
      * matrix. Getting rid of the previous
      * matrix is left to the caller.
      */
-    void do_reinit (const unsigned int m,
-                    const unsigned int n,
-                    const unsigned int n_nonzero_per_row,
-                    const bool         is_symmetric = false);
+    void do_reinit (const size_type m,
+                    const size_type n,
+                    const size_type n_nonzero_per_row,
+                    const bool      is_symmetric = false);
 
     /**
      * Same as previous function.
      */
-    void do_reinit (const unsigned int               m,
-                    const unsigned int               n,
-                    const std::vector<unsigned int> &row_lengths,
-                    const bool                       is_symmetric = false);
+    void do_reinit (const size_type               m,
+                    const size_type               n,
+                    const std::vector<size_type> &row_lengths,
+                    const bool                    is_symmetric = false);
 
     /**
      * Same as previous function.
index 7193166e27d25ac30217f08e39e2e91c06b8c9f2..6eed2e9472efdf1cda7384377b514b1f1884c998 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_vector_h
 #define __deal2__petsc_vector_h
 
@@ -47,6 +52,11 @@ namespace PETScWrappers
   class Vector : public VectorBase
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * A variable that indicates whether this vector
      * supports distributed data storage. If true, then
@@ -82,7 +92,7 @@ namespace PETScWrappers
      * i.e. the vector is replaced by one of
      * length zero.
      */
-    explicit Vector (const unsigned int n);
+    explicit Vector (const size_type n);
 
     /**
      * Copy-constructor from deal.II
@@ -195,8 +205,8 @@ namespace PETScWrappers
      * elements are left an unspecified
      * state.
      */
-    void reinit (const unsigned int N,
-                 const bool         fast = false);
+    void reinit (const size_type N,
+                 const bool      fast = false);
 
     /**
      * Change the dimension to that of the
@@ -219,7 +229,7 @@ namespace PETScWrappers
      * size of the vector to be
      * created.
      */
-    void create_vector (const unsigned int n);
+    void create_vector (const size_type n);
   };
 
   /*@}*/
@@ -411,7 +421,7 @@ namespace PETScWrappers
     // that would take a pointer to an array
     // of PetscScalar values and simply copy
     // n elements verbatim into the vector...
-    for (unsigned int i=0; i<v.size(); ++i)
+    for (size_type i=0; i<v.size(); ++i)
       (*this)(i) = v(i);
 
     compress (::dealii::VectorOperation::insert);
index 4222be10e12efe1abbe92b6a50bf4fec5aac7286..8d0f7e056f166af8f17470d952eb69b948b32e2a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__petsc_vector_base_h
 #define __deal2__petsc_vector_base_h
 
@@ -77,6 +82,12 @@ namespace PETScWrappers
      */
     class VectorReference
     {
+    public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
+
     private:
       /**
        * Constructor. It is made private so
@@ -84,9 +95,11 @@ namespace PETScWrappers
        * class to create it.
        */
       VectorReference (const VectorBase  &vector,
-                       const unsigned int index);
+                       const size_type   index);
+
 
     public:
+
       /**
        * This looks like a copy operator,
        * but does something different than
@@ -201,7 +214,7 @@ namespace PETScWrappers
        * Index of the referenced element of
        * the vector.
        */
-      const unsigned int  index;
+      const size_type index;
 
       /**
        * Make the vector class a friend, so
@@ -252,7 +265,7 @@ namespace PETScWrappers
      */
     typedef PetscScalar               value_type;
     typedef PetscReal                 real_type;
-    typedef std::size_t               size_type;
+    typedef types::global_dof_index   size_type;
     typedef internal::VectorReference reference;
     typedef const internal::VectorReference const_reference;
 
@@ -349,7 +362,7 @@ namespace PETScWrappers
      * Return the global dimension of the
      * vector.
      */
-    unsigned int size () const;
+    size_type size () const;
 
     /**
      * Return the local dimension of the
@@ -364,7 +377,7 @@ namespace PETScWrappers
      * exactly are stored locally,
      * use local_range().
      */
-    unsigned int local_size () const;
+    size_type local_size () const;
 
     /**
      * Return a pair of indices
@@ -382,7 +395,7 @@ namespace PETScWrappers
      * a pair (i,i+n), where
      * <tt>n=local_size()</tt>.
      */
-    std::pair<unsigned int, unsigned int>
+    std::pair<size_type, size_type>
     local_range () const;
 
     /**
@@ -390,7 +403,7 @@ namespace PETScWrappers
      * in the local range or not,
      * see also local_range().
      */
-    bool in_local_range (const unsigned int index) const;
+    bool in_local_range (const size_type index) const;
 
     /**
      * Return an index set that describes which elements of this vector
@@ -419,14 +432,14 @@ namespace PETScWrappers
      * both read and write.
      */
     reference
-    operator () (const unsigned int index);
+    operator () (const size_type index);
 
     /**
      * Provide read-only access to an
      * element.
      */
     PetscScalar
-    operator () (const unsigned int index) const;
+    operator () (const size_type index) const;
 
     /**
      * Provide access to a given
@@ -435,7 +448,7 @@ namespace PETScWrappers
      * Exactly the same as operator().
      */
     reference
-    operator [] (const unsigned int index);
+    operator [] (const size_type index);
 
     /**
      * Provide read-only access to an
@@ -445,7 +458,7 @@ namespace PETScWrappers
      * Exactly the same as operator().
      */
     PetscScalar
-    operator [] (const unsigned int index) const;
+    operator [] (const size_type index) const;
 
     /**
      * A collective set operation: instead
@@ -457,7 +470,7 @@ namespace PETScWrappers
      * the corresponding values in the
      * second.
      */
-    void set (const std::vector<unsigned int> &indices,
+    void set (const std::vector<size_type>   &indices,
               const std::vector<PetscScalar>  &values);
 
     /**
@@ -466,7 +479,7 @@ namespace PETScWrappers
      * stored in @p values to the vector
      * components specified by @p indices.
      */
-    void add (const std::vector<unsigned int> &indices,
+    void add (const std::vector<size_type> &indices,
               const std::vector<PetscScalar>  &values);
 
     /**
@@ -476,7 +489,7 @@ namespace PETScWrappers
      * takes a deal.II vector of
      * values.
      */
-    void add (const std::vector<unsigned int>     &indices,
+    void add (const std::vector<size_type>        &indices,
               const ::dealii::Vector<PetscScalar> &values);
 
     /**
@@ -488,8 +501,8 @@ namespace PETScWrappers
      * other two <tt>add()</tt>
      * functions above.
      */
-    void add (const unsigned int  n_elements,
-              const unsigned int *indices,
+    void add (const size_type    n_elements,
+              const size_type   *indices,
               const PetscScalar  *values);
 
     /**
@@ -505,8 +518,7 @@ namespace PETScWrappers
     real_type norm_sqr () const;
 
     /**
-     * Mean value of the elements of
-     * this vector.
+     * Return the mean value of the elements of this vector.
      */
     PetscScalar mean_value () const;
 
@@ -889,10 +901,10 @@ namespace PETScWrappers
      * @p add_values flag set to the
      * corresponding value.
      */
-    void do_set_add_operation (const unsigned int  n_elements,
-                               const unsigned int *indices,
+    void do_set_add_operation (const size_type    n_elements,
+                               const size_type   *indices,
                                const PetscScalar  *values,
-                               const bool add_values);
+                               const bool         add_values);
 
 
   };
@@ -920,7 +932,7 @@ namespace PETScWrappers
   {
     inline
     VectorReference::VectorReference (const VectorBase  &vector,
-                                      const unsigned int index)
+                                      const size_type   index)
       :
       vector (vector),
       index (index)
@@ -1132,15 +1144,15 @@ namespace PETScWrappers
 
   inline
   bool
-  VectorBase::in_local_range (const unsigned int index) const
+  VectorBase::in_local_range (const size_type index) const
   {
     PetscInt begin, end;
     const int ierr = VecGetOwnershipRange (static_cast<const Vec &>(vector),
                                            &begin, &end);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-    return ((index >= static_cast<unsigned int>(begin)) &&
-            (index < static_cast<unsigned int>(end)));
+    return ((index >= static_cast<size_type>(begin)) &&
+            (index < static_cast<size_type>(end)));
   }
 
 
@@ -1151,7 +1163,7 @@ namespace PETScWrappers
     IndexSet is (size());
 
     // PETSc only allows for contiguous local ranges, so this is simple
-    const std::pair<unsigned int, unsigned int> x = local_range();
+    const std::pair<size_type, size_type> x = local_range();
     is.add_range (x.first, x.second);
     return is;
   }
@@ -1169,7 +1181,7 @@ namespace PETScWrappers
 
   inline
   internal::VectorReference
-  VectorBase::operator () (const unsigned int index)
+  VectorBase::operator () (const size_type index)
   {
     return internal::VectorReference (*this, index);
   }
@@ -1178,7 +1190,7 @@ namespace PETScWrappers
 
   inline
   PetscScalar
-  VectorBase::operator () (const unsigned int index) const
+  VectorBase::operator () (const size_type index) const
   {
     return static_cast<PetscScalar>(internal::VectorReference (*this, index));
   }
@@ -1187,7 +1199,7 @@ namespace PETScWrappers
 
   inline
   internal::VectorReference
-  VectorBase::operator [] (const unsigned int index)
+  VectorBase::operator [] (const size_type index)
   {
     return operator()(index);
   }
@@ -1196,7 +1208,7 @@ namespace PETScWrappers
 
   inline
   PetscScalar
-  VectorBase::operator [] (const unsigned int index) const
+  VectorBase::operator [] (const size_type index) const
   {
     return operator()(index);
   }
index 0a193b2c7886e06c4d90ce95abac211a848ee418..9235de13b00d62223237226103d57811606edf49 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__pointer_matrix_h
 #define __deal2__pointer_matrix_h
 
index 9d34b5958a49f7c074a151697485b1e3ee8bfcbb..0667794d06c755f41c6cfa22c6c5ad2cc99d10b5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__precondition_h
 #define __deal2__precondition_h
 
@@ -69,7 +74,6 @@ template <typename> class SolverCG;
 class PreconditionIdentity : public Subscriptor
 {
 public:
-
   /**
    * This function is only
    * present to
@@ -574,6 +578,10 @@ template <class MATRIX = SparseMatrix<double> >
 class PreconditionSSOR : public PreconditionRelaxation<MATRIX>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
 
   /**
    * A typedef to the base class.
@@ -672,6 +680,11 @@ template <class MATRIX = SparseMatrix<double> >
 class PreconditionPSOR : public PreconditionRelaxation<MATRIX>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Initialize matrix and
    * relaxation parameter. The
@@ -692,8 +705,8 @@ public:
    * reasons. It defaults to 1.
    */
   void initialize (const MATRIX &A,
-                   const std::vector<unsigned int> &permutation,
-                   const std::vector<unsigned int> &inverse_permutation,
+                   const std::vector<size_type> &permutation,
+                   const std::vector<size_type> &inverse_permutation,
                    const typename PreconditionRelaxation<MATRIX>::AdditionalData &
                    parameters = typename PreconditionRelaxation<MATRIX>::AdditionalData());
 
@@ -713,12 +726,12 @@ private:
   /**
    * Storage for the permutation vector.
    */
-  const std::vector<unsigned int> *permutation;
+  const std::vector<size_type> *permutation;
   /**
    * Storage for the inverse
    * permutation vector.
    */
-  const std::vector<unsigned int> *inverse_permutation;
+  const std::vector<size_type> *inverse_permutation;
 };
 
 
@@ -898,6 +911,11 @@ template <class MATRIX=SparseMatrix<double>, class VECTOR=Vector<double> >
 class PreconditionChebyshev : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Standardized data struct to pipe additional parameters to the
    * preconditioner.
@@ -1294,16 +1312,16 @@ PreconditionSSOR<MATRIX>::initialize (const MATRIX &rA,
   // calculate the positions first after the diagonal.
   if (mat != 0)
     {
-      const unsigned int n = this->A->n();
+      const size_type n = this->A->n();
       pos_right_of_diagonal.resize(n, static_cast<std::size_t>(-1));
-      for (unsigned int row=0; row<n; ++row)
+      for (size_type row=0; row<n; ++row)
         {
           // find the first element in this line which is on the right of the
           // diagonal.  we need to precondition with the elements on the left
           // only. note: the first entry in each line denotes the diagonal
           // element, which we need not check.
           typename SparseMatrix<typename MATRIX::value_type>::const_iterator
-            it = mat->begin(row)+1;
+          it = mat->begin(row)+1;
           for ( ; it < mat->end(row); ++it)
             if (it->column() > row)
               break;
@@ -1362,8 +1380,8 @@ template <class MATRIX>
 inline void
 PreconditionPSOR<MATRIX>::initialize (
   const MATRIX &rA,
-  const std::vector<unsigned int> &p,
-  const std::vector<unsigned int> &ip,
+  const std::vector<size_type> &p,
+  const std::vector<size_type> &ip,
   const typename PreconditionRelaxation<MATRIX>::AdditionalData &parameters)
 {
   permutation = &p;
@@ -1569,6 +1587,8 @@ namespace internal
     template <typename Number>
     struct VectorUpdatesRange : public parallel::ParallelForInteger
     {
+      typedef types::global_dof_index size_type;
+
       VectorUpdatesRange (const size_t  size,
                           const Number *src,
                           const Number *matrix_diagonal_inverse,
@@ -1605,13 +1625,13 @@ namespace internal
         if (factor1 == Number())
           {
             if (start_zero)
-              for (unsigned int i=begin; i<end; ++i)
+              for (size_type i=begin; i<end; ++i)
                 {
                   dst[i] = factor2 * src[i] * matrix_diagonal_inverse[i];
                   update1[i] = -dst[i];
                 }
             else
-              for (unsigned int i=begin; i<end; ++i)
+              for (size_type i=begin; i<end; ++i)
                 {
                   update1[i] = ((update2[i]-src[i]) *
                                 factor2*matrix_diagonal_inverse[i]);
@@ -1619,7 +1639,7 @@ namespace internal
                 }
           }
         else
-          for (unsigned int i=begin; i<end; ++i)
+          for (size_type i=begin; i<end; ++i)
             {
               const Number update2i = ((update2[i] - src[i]) *
                                        matrix_diagonal_inverse[i]);
@@ -1756,7 +1776,7 @@ PreconditionChebyshev<MATRIX,VECTOR>::initialize (const MATRIX &matrix,
 
       // attach stream to SolverCG, run it with log report for eigenvalues
       std::ostream *old_stream = deallog.has_file() ? &deallog.get_file_stream() :
-        static_cast<std::ostream *>(0);
+                                 static_cast<std::ostream *>(0);
       if (old_stream)
         deallog.detach();
 
@@ -1776,7 +1796,7 @@ PreconditionChebyshev<MATRIX,VECTOR>::initialize (const MATRIX &matrix,
       cg_data.compute_eigenvalues = true;
       SolverCG<VECTOR> solver (control, memory, cg_data);
       internal::PreconditionChebyshev::DiagonalPreconditioner<VECTOR>
-        preconditioner(data.matrix_diagonal_inverse);
+      preconditioner(data.matrix_diagonal_inverse);
       try
         {
           solver.solve(matrix, *dummy, *rhs, preconditioner);
@@ -1793,19 +1813,24 @@ PreconditionChebyshev<MATRIX,VECTOR>::initialize (const MATRIX &matrix,
       // read the log stream: grab the first and last eigenvalue
       std::string cg_message = log_msg.str();
       const std::size_t pos = cg_message.find("cg:: ");
-      Assert(pos < std::string::npos, ExcInternalError());
-      cg_message.erase(0, pos+5);
-      std::istringstream os1(cg_message);
-      os1 >> min_eigenvalue;
-      for (unsigned int i=0; i<control.last_step()-1; ++i)
-        cg_message.erase(0, cg_message.find_first_of(" ")+1);
-      std::istringstream os2(cg_message);
-      os2 >> max_eigenvalue;
+      if (pos != std::string::npos)
+        {
+          cg_message.erase(0, pos+5);
+          std::string first = cg_message;
+
+          first.erase(cg_message.find_first_of(" "), std::string::npos);
+          std::istringstream(first)      >> min_eigenvalue;
+
+          cg_message.erase(0, cg_message.find_last_of(" ")+1);
+          std::istringstream(cg_message) >> max_eigenvalue;
+        }
+      else
+        min_eigenvalue = max_eigenvalue = 1;
 
       // reset deal.II stream
       deallog.detach();
       if (old_stream)
-        deallog.attach(*old_stream, false);
+        deallog.attach(*old_stream);
 
       // include a safety factor since the CG method will in general not be
       // converged
@@ -1817,9 +1842,9 @@ PreconditionChebyshev<MATRIX,VECTOR>::initialize (const MATRIX &matrix,
       min_eigenvalue = data.max_eigenvalue/data.smoothing_range;
     }
 
-  const double alpha = (data.smoothing_range > 0 ?
+  const double alpha = (data.smoothing_range > 1. ?
                         max_eigenvalue / data.smoothing_range :
-                        max_eigenvalue / min_eigenvalue);
+                        std::min(0.9*max_eigenvalue, min_eigenvalue));
   delta = (max_eigenvalue-alpha)*0.5;
   theta = (max_eigenvalue+alpha)*0.5;
 
index d3d7feb3edf4bbf9ffb4f9920617ea4bd3123923..a2d4e1cded3e253913bdba7858f89f756ad1ea01 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__precondition_block_h
 #define __deal2__precondition_block_h
 
@@ -95,6 +100,11 @@ private:
   typedef inverse_type value_type;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Parameters for block preconditioners.
    */
@@ -107,7 +117,7 @@ public:
      * is no reasonable default
      * parameter.
      */
-    AdditionalData (const unsigned int block_size,
+    AdditionalData (const size_type block_size,
                     const double relaxation = 1.,
                     const bool invert_diagonal = true,
                     const bool same_diagonal = false);
@@ -120,7 +130,7 @@ public:
     /**
      * Block size.
      */
-    unsigned int block_size;
+    size_type block_size;
 
     /**
      * Invert diagonal during initialization.
@@ -200,8 +210,8 @@ protected:
    * may be provided.
    */
   void initialize (const MATRIX &A,
-                   const std::vector<unsigned int> &permutation,
-                   const std::vector<unsigned int> &inverse_permutation,
+                   const std::vector<size_type> &permutation,
+                   const std::vector<size_type> &inverse_permutation,
                    const AdditionalData parameters);
 
   /**
@@ -250,8 +260,8 @@ protected:
    * order is only admissible for
    * block permutation.
    */
-  void set_permutation(const std::vector<unsigned int> &permutation,
-                       const std::vector<unsigned int> &inverse_permutation);
+  void set_permutation(const std::vector<size_type> &permutation,
+                       const std::vector<size_type> &inverse_permutation);
 
   /**
    * Replacement of
@@ -259,8 +269,8 @@ protected:
    * permuted preconditioning.
    */
   void invert_permuted_diagblocks(
-    const std::vector<unsigned int> &permutation,
-    const std::vector<unsigned int> &inverse_permutation);
+    const std::vector<size_type> &permutation,
+    const std::vector<size_type> &inverse_permutation);
 public:
   /**
    * Deletes the inverse diagonal
@@ -283,8 +293,8 @@ public:
    * if the inverse diagonal blocks
    * are stored.
    */
-  value_type el(unsigned int i,
-                unsigned int j) const;
+  value_type el(size_type i,
+                size_type j) const;
 
   /**
    * Stores the inverse of the
@@ -367,7 +377,7 @@ public:
   /**
    * Return the size of the blocks.
    */
-  unsigned int block_size () const;
+  size_type block_size () const;
 
   /**
    * @deprecated Use size()
@@ -414,7 +424,7 @@ protected:
    * diagonal block is assumed to
    * be of the same size.
    */
-  unsigned int blocksize;
+  size_type blocksize;
 
   /**
    * Pointer to the matrix. Make
@@ -438,12 +448,12 @@ protected:
   /**
    * The permutation vector
    */
-  std::vector<unsigned int> permutation;
+  std::vector<size_type> permutation;
 
   /**
    * The inverse permutation vector
    */
-  std::vector<unsigned int> inverse_permutation;
+  std::vector<size_type> inverse_permutation;
 
   /**
    * Flag for diagonal compression.
@@ -474,6 +484,11 @@ private:
   typedef typename MATRIX::value_type number;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * STL conforming iterator.
    */
@@ -493,21 +508,21 @@ public:
        * pointer is sufficient.
        */
       Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
-                const unsigned int row);
+                const size_type row);
 
       /**
        * Row number of the element
        * represented by this
        * object.
        */
-      unsigned int row() const;
+      size_type row() const;
 
       /**
        * Column number of the
        * element represented by
        * this object.
        */
-      unsigned int column() const;
+      size_type column() const;
 
       /**
        * Value of this matrix entry.
@@ -524,12 +539,12 @@ public:
        * Save block size here
        * for further reference.
        */
-      unsigned int bs;
+      size_type bs;
 
       /**
        * Current block number.
        */
-      unsigned int a_block;
+      size_type a_block;
 
       /**
        * Iterator inside block.
@@ -553,7 +568,7 @@ public:
      * Constructor.
      */
     const_iterator(const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
-                   const unsigned int row);
+                   const size_type row);
 
     /**
      * Prefix increment.
@@ -698,12 +713,12 @@ public:
    * STL-like iterator with the
    * first entry of row @p r.
    */
-  const_iterator begin (const unsigned int r) const;
+  const_iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row @p r.
    */
-  const_iterator end (const unsigned int r) const;
+  const_iterator end (const size_type r) const;
 
 
 private:
@@ -767,6 +782,11 @@ class PreconditionBlockSOR : public virtual Subscriptor,
   protected PreconditionBlock<MATRIX, inverse_type>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Default constructor.
    */
@@ -955,6 +975,11 @@ class PreconditionBlockSSOR : public virtual Subscriptor,
   private PreconditionBlockSOR<MATRIX, inverse_type>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Define number type of matrix.
    */
@@ -1051,16 +1076,16 @@ PreconditionBlock<MATRIX, inverse_type>::n_blocks () const
 template<class MATRIX, typename inverse_type>
 inline inverse_type
 PreconditionBlock<MATRIX, inverse_type>::el (
-  unsigned int i,
-  unsigned int j) const
+  size_type i,
+  size_type j) const
 {
-  const unsigned int bs = blocksize;
+  const size_type bs = blocksize;
   const unsigned int nb = i/bs;
 
   const FullMatrix<inverse_type> &B = this->inverse(nb);
 
-  const unsigned int ib = i % bs;
-  const unsigned int jb = j % bs;
+  const size_type ib = i % bs;
+  const size_type jb = j % bs;
 
   if (jb + nb*bs != j)
     {
@@ -1076,7 +1101,7 @@ template<class MATRIX, typename inverse_type>
 inline
 PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::
 Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
-          const unsigned int row)
+          const size_type row)
   :
   matrix(matrix),
   b_iterator(&matrix->inverse(0), 0, 0),
@@ -1090,7 +1115,7 @@ Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
   if (a_block == matrix->size())
     return;
 
-  const unsigned int r = row % bs;
+  const size_type r = row % bs;
 
   b_iterator = matrix->inverse(a_block).begin(r);
   b_end = matrix->inverse(a_block).end();
@@ -1102,7 +1127,7 @@ Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
 
 template<class MATRIX, typename inverse_type>
 inline
-unsigned int
+typename PreconditionBlockJacobi<MATRIX, inverse_type>::size_type
 PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::row() const
 {
   Assert (a_block < matrix->size(),
@@ -1114,7 +1139,7 @@ PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::row() c
 
 template<class MATRIX, typename inverse_type>
 inline
-unsigned int
+typename PreconditionBlockJacobi<MATRIX, inverse_type>::size_type
 PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::column() const
 {
   Assert (a_block < matrix->size(),
@@ -1140,7 +1165,7 @@ template<class MATRIX, typename inverse_type>
 inline
 PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::
 const_iterator(const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
-               const unsigned int row)
+               const size_type row)
   :
   accessor(matrix, row)
 {}
@@ -1248,7 +1273,7 @@ template<class MATRIX, typename inverse_type>
 inline
 typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
 PreconditionBlockJacobi<MATRIX, inverse_type>::begin (
-  const unsigned int r) const
+  const size_type r) const
 {
   Assert (r < this->A->m(), ExcIndexRange(r, 0, this->A->m()));
   return const_iterator(this, r);
@@ -1260,7 +1285,7 @@ template<class MATRIX, typename inverse_type>
 inline
 typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
 PreconditionBlockJacobi<MATRIX, inverse_type>::end (
-  const unsigned int r) const
+  const size_type r) const
 {
   Assert (r < this->A->m(), ExcIndexRange(r, 0, this->A->m()));
   return const_iterator(this, r+1);
index 41fc24ad955b791abc6a3db75c9c282effae7145..17dfe41f861c9015bb537db26bff5503b14830c9 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__precondition_block_templates_h
 #define __deal2__precondition_block_templates_h
 
@@ -27,7 +32,7 @@ DEAL_II_NAMESPACE_OPEN
 
 template<class MATRIX, typename inverse_type>
 PreconditionBlock<MATRIX, inverse_type>::AdditionalData::
-AdditionalData (const unsigned int block_size,
+AdditionalData (const size_type block_size,
                 const double relaxation,
                 const bool invert_diagonal,
                 const bool same_diagonal)
@@ -73,7 +78,7 @@ void PreconditionBlock<MATRIX,inverse_type>::initialize (
   const MATRIX &M,
   const AdditionalData parameters)
 {
-  const unsigned int bsize = parameters.block_size;
+  const size_type bsize = parameters.block_size;
 
   clear();
   Assert (M.m() == M.n(), ExcNotQuadratic());
@@ -99,8 +104,8 @@ void PreconditionBlock<MATRIX,inverse_type>::initialize (
 template <class MATRIX, typename inverse_type>
 void PreconditionBlock<MATRIX,inverse_type>::initialize (
   const MATRIX &M,
-  const std::vector<unsigned int> &permutation,
-  const std::vector<unsigned int> &inverse_permutation,
+  const std::vector<size_type> &permutation,
+  const std::vector<size_type> &inverse_permutation,
   const AdditionalData parameters)
 {
   set_permutation(permutation, inverse_permutation);
@@ -109,8 +114,8 @@ void PreconditionBlock<MATRIX,inverse_type>::initialize (
 
 template <class MATRIX, typename inverse_type>
 void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
-  const std::vector<unsigned int> &permutation,
-  const std::vector<unsigned int> &inverse_permutation)
+  const std::vector<size_type> &permutation,
+  const std::vector<size_type> &inverse_permutation)
 {
   Assert (A!=0, ExcNotInitialized());
   Assert (blocksize!=0, ExcNotInitialized());
@@ -126,7 +131,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
     {
       deallog << "PreconditionBlock uses only one diagonal block" << std::endl;
 
-      for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
         {
           typename MATRIX::const_iterator entry = M.begin(row_cell);
           const typename MATRIX::const_iterator row_end = M.end(row_cell);
@@ -169,12 +174,12 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
 
       for (unsigned int cell=0; cell<this->size(); ++cell)
         {
-          const unsigned int cell_start = cell*blocksize;
-          for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+          const size_type cell_start = cell*blocksize;
+          for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
             {
-              const unsigned int urow = row_cell + cell_start;
+              const size_type urow = row_cell + cell_start;
 
-              const unsigned int row = permutation[urow];
+              const size_type row = permutation[urow];
 
               typename MATRIX::const_iterator entry = M.begin(row);
               const typename MATRIX::const_iterator row_end = M.end(row);
@@ -185,7 +190,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
                   if (inverse_permutation[entry->column()]<cell_start)
                     continue;
 
-                  const unsigned int column_cell = inverse_permutation[entry->column()]-cell_start;
+                  const size_type column_cell = inverse_permutation[entry->column()]-cell_start;
                   if (column_cell >= blocksize)
                     continue;
                   M_cell(row_cell, column_cell) = entry->value();
@@ -250,7 +255,7 @@ void PreconditionBlock<MATRIX,inverse_type>::forward_step (
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell;
+  size_type row, row_cell;
   number2 b_cell_row;
   // The diagonal block if the
   // inverses were not precomputed
@@ -260,10 +265,10 @@ void PreconditionBlock<MATRIX,inverse_type>::forward_step (
   for (unsigned int rawcell=0; rawcell < this->size(); ++rawcell)
     {
       const unsigned int cell = cell_permuted ? permutation[rawcell] : rawcell;
-      const unsigned int block_start = cell*this->blocksize;
-      const unsigned int permuted_block_start = permuted
-                                                ? permutation[block_start]
-                                                : block_start;
+      const size_type block_start = cell*this->blocksize;
+      const size_type permuted_block_start = permuted
+                                             ? permutation[block_start]
+                                             : block_start;
 
 //       deallog << std::endl << cell << '-' << block_start
 //            << '-' << permuted_block_start << (permuted ? 't' : 'f') << '\t';
@@ -279,17 +284,17 @@ void PreconditionBlock<MATRIX,inverse_type>::forward_step (
           b_cell_row=src(row);
           for (; entry != row_end; ++entry)
             {
-              const unsigned int column = entry->column();
-              const unsigned int inverse_permuted_column = permuted
-                                                           ? inverse_permutation[column]
-                                                           : column;
+              const size_type column = entry->column();
+              const size_type inverse_permuted_column = permuted
+                                                        ? inverse_permutation[column]
+                                                        : column;
               b_cell_row -= entry->value() * prev(column);
 //TODO:[GK] Find out if this is really once column and once permuted
               if (!this->inverses_ready()
                   && inverse_permuted_column >= block_start
                   && inverse_permuted_column < block_start + this->blocksize)
                 {
-                  const unsigned int column_cell = column - block_start;
+                  const size_type column_cell = column - block_start;
                   if (transpose_diagonal)
                     M_cell(column_cell, row_cell) = entry->value();
                   else
@@ -348,7 +353,7 @@ void PreconditionBlock<MATRIX,inverse_type>::backward_step (
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell;
+  size_type row, row_cell;
   number2 b_cell_row;
 
   FullMatrix<number> M_cell(this->blocksize);
@@ -356,11 +361,11 @@ void PreconditionBlock<MATRIX,inverse_type>::backward_step (
     {
       --rawcell;
       const unsigned int cell = cell_permuted ? permutation[rawcell] : rawcell;
-      const unsigned int block_start = cell*this->blocksize;
-      const unsigned int block_end = block_start + this->blocksize;
-      const unsigned int permuted_block_start = permuted
-                                                ? permutation[block_start]
-                                                : block_start;
+      const size_type block_start = cell*this->blocksize;
+      const size_type block_end = block_start + this->blocksize;
+      const size_type permuted_block_start = permuted
+                                             ? permutation[block_start]
+                                             : block_start;
       for (row = permuted_block_start, row_cell = 0;
            row_cell<this->blocksize;
            ++row_cell, ++row)
@@ -371,16 +376,16 @@ void PreconditionBlock<MATRIX,inverse_type>::backward_step (
           b_cell_row=src(row);
           for (; entry != row_end; ++entry)
             {
-              const unsigned int column = entry->column();
-              const unsigned int inverse_permuted_column = permuted
-                                                           ? inverse_permutation[column]
-                                                           : column;
+              const size_type column = entry->column();
+              const size_type inverse_permuted_column = permuted
+                                                        ? inverse_permutation[column]
+                                                        : column;
               b_cell_row -= entry->value() * prev(column);
               if (!this->inverses_ready()
                   && inverse_permuted_column < block_end
                   && column >= block_start)
                 {
-                  const unsigned int column_cell = column - block_start;
+                  const size_type column_cell = column - block_start;
                   // We need the
                   // transpose of the
                   // diagonal block,
@@ -419,7 +424,8 @@ void PreconditionBlock<MATRIX,inverse_type>::backward_step (
 
 
 template <class MATRIX, typename inverse_type>
-unsigned int PreconditionBlock<MATRIX,inverse_type>::block_size() const
+typename PreconditionBlock<MATRIX,inverse_type>::size_type
+PreconditionBlock<MATRIX,inverse_type>::block_size() const
 {
   return blocksize;
 }
@@ -439,7 +445,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
   if (this->same_diagonal())
     {
       deallog << "PreconditionBlock uses only one diagonal block" << std::endl;
-      for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
         {
           typename MATRIX::const_iterator entry = M.begin(row_cell);
           const typename MATRIX::const_iterator row_end = M.end(row_cell);
@@ -474,10 +480,10 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
 
       for (unsigned int cell=0; cell<this->size(); ++cell)
         {
-          const unsigned int cell_start = cell*blocksize;
-          for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+          const size_type cell_start = cell*blocksize;
+          for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
             {
-              const unsigned int row = row_cell + cell_start;
+              const size_type row = row_cell + cell_start;
               typename MATRIX::const_iterator entry = M.begin(row);
               const typename MATRIX::const_iterator row_end = M.end(row);
 
@@ -486,7 +492,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
                   if (entry->column()<cell_start)
                     continue;
 
-                  const unsigned int column_cell = entry->column()-cell_start;
+                  const size_type column_cell = entry->column()-cell_start;
                   if (column_cell >= blocksize)
                     continue;
                   M_cell(row_cell, column_cell) = entry->value();
@@ -519,8 +525,8 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
 
 template <class MATRIX, typename inverse_type>
 void PreconditionBlock<MATRIX,inverse_type>::set_permutation (
-  const std::vector<unsigned int> &p,
-  const std::vector<unsigned int> &i)
+  const std::vector<size_type> &p,
+  const std::vector<size_type> &i)
 {
   Assert (p.size() == i.size(), ExcDimensionMismatch(p.size(), i.size()));
 
@@ -574,7 +580,7 @@ void PreconditionBlockJacobi<MATRIX,inverse_type>
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell, begin_diag_block=0;
+  size_type row, row_cell, begin_diag_block=0;
 
   if (!this->inverses_ready())
     {
@@ -586,7 +592,7 @@ void PreconditionBlockJacobi<MATRIX,inverse_type>
                ++row_cell, ++row)
             {
               b_cell(row_cell)=src(row);
-              for (unsigned int column_cell=0, column=cell*this->blocksize;
+              for (size_type column_cell=0, column=cell*this->blocksize;
                    column_cell<this->blocksize; ++column_cell, ++column)
                 M_cell(row_cell,column_cell)=M(row,column);
             }
@@ -742,7 +748,7 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::forward (
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell, block_start=0;
+  size_type row, row_cell, block_start=0;
   number2 b_cell_row;
   // The diagonal block if the
   // inverses were not precomputed
@@ -750,9 +756,9 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::forward (
 
   for (unsigned int cell=0; cell < this->size(); ++cell)
     {
-      const unsigned int permuted_block_start = permuted
-                                                ? this->permutation[block_start]
-                                                :block_start;
+      const size_type permuted_block_start = permuted
+                                             ? this->permutation[block_start]
+                                             :block_start;
 
       for (row = permuted_block_start, row_cell = 0;
            row_cell < this->blocksize;
@@ -764,16 +770,16 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::forward (
           b_cell_row=src(row);
           for (; entry != row_end; ++entry)
             {
-              const unsigned int column = entry->column();
-              const unsigned int inverse_permuted_column = permuted
-                                                           ? this->inverse_permutation[column]
-                                                           : column;
+              const size_type column = entry->column();
+              const size_type inverse_permuted_column = permuted
+                                                        ? this->inverse_permutation[column]
+                                                        : column;
 
               if (inverse_permuted_column < block_start)
                 b_cell_row -= entry->value() * dst(column);
               else if (!this->inverses_ready() && column < block_start + this->blocksize)
                 {
-                  const unsigned int column_cell = column - block_start;
+                  const size_type column_cell = column - block_start;
                   if (transpose_diagonal)
                     M_cell(column_cell, row_cell) = entry->value();
                   else
@@ -832,19 +838,19 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::backward (
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell;
-  unsigned int block_end=this->blocksize * this->size();
+  size_type row, row_cell;
+  size_type block_end=this->blocksize * this->size();
   number2 b_cell_row;
 
   FullMatrix<number> M_cell(this->blocksize);
   for (unsigned int cell=this->size(); cell!=0 ;)
     {
       --cell;
-      const unsigned int block_start = block_end - this->blocksize;
+      const size_type block_start = block_end - this->blocksize;
       // Collect upper triangle
-      const unsigned int permuted_block_start = (this->permutation.size() != 0)
-                                                ? this->permutation[block_start]
-                                                :block_start;
+      const size_type permuted_block_start = (this->permutation.size() != 0)
+                                             ? this->permutation[block_start]
+                                             block_start;
       for (row = permuted_block_start, row_cell = 0;
            row_cell<this->blocksize;
            ++row_cell, ++row)
@@ -855,15 +861,15 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::backward (
           b_cell_row=src(row);
           for (; entry != row_end; ++entry)
             {
-              const unsigned int column = entry->column();
-              const unsigned int inverse_permuted_column = permuted
-                                                           ? this->inverse_permutation[column]
-                                                           : column;
+              const size_type column = entry->column();
+              const size_type inverse_permuted_column = permuted
+                                                        ? this->inverse_permutation[column]
+                                                        : column;
               if (inverse_permuted_column >= block_end)
                 b_cell_row -= entry->value() * dst(column);
               else if (!this->inverses_ready() && column >= block_start)
                 {
-                  const unsigned int column_cell = column - block_start;
+                  const size_type column_cell = column - block_start;
                   // We need the
                   // transpose of the
                   // diagonal block,
@@ -993,14 +999,14 @@ void PreconditionBlockSSOR<MATRIX,inverse_type>::vmult (Vector<number2>       &d
   // Multiply with diagonal blocks
   for (unsigned int cell=0; cell < this->size(); ++cell)
     {
-      unsigned int row = cell*this->blocksize;
+      size_type row = cell*this->blocksize;
 
-      for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<this->blocksize; ++row_cell)
         cell_src(row_cell)=help(row+row_cell);
 
       this->diagonal(cell).vmult(cell_dst, cell_src);
 
-      for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<this->blocksize; ++row_cell)
         help(row+row_cell) = scaling * cell_dst(row_cell);
     }
 
@@ -1024,14 +1030,14 @@ void PreconditionBlockSSOR<MATRIX,inverse_type>::Tvmult (Vector<number2>       &
   // Multiply with diagonal blocks
   for (unsigned int cell=0; cell < this->size(); ++cell)
     {
-      unsigned int row = cell*this->blocksize;
+      size_type row = cell*this->blocksize;
 
-      for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<this->blocksize; ++row_cell)
         cell_src(row_cell)=help(row+row_cell);
 
       this->diagonal(cell).Tvmult(cell_dst, cell_src);
 
-      for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<this->blocksize; ++row_cell)
         help(row+row_cell) = scaling * cell_dst(row_cell);
     }
 
index be37ffdd527c2098d67cd38f823cbff8e51e9684..ae9a142d61f5ced0c66d4328db0e7166fda59fb1 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__precondition_block_base_h
 #define __deal2__precondition_block_base_h
 
@@ -51,6 +56,11 @@ template <typename number>
 class PreconditionBlockBase
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Choose a method for inverting
    * the blocks, and thus the data
@@ -105,7 +115,7 @@ public:
    * then only one block will be
    * stored.
    */
-  void reinit(unsigned int nblocks, unsigned int blocksize, bool compress,
+  void reinit(unsigned int nblocks, size_type blocksize, bool compress,
               Inversion method = gauss_jordan);
 
   /**
@@ -164,69 +174,69 @@ public:
    * if the inverse diagonal blocks
    * are stored.
    */
-  number el(unsigned int i, unsigned int j) const;
+  number el(size_type i, size_type j) const;
 
   /**
    * Multiply with the inverse
    * block at position <tt>i</tt>.
    */
   template <typename number2>
-  void inverse_vmult(unsigned int i, Vector<number2> &dst, const Vector<number2> &src) const;
+  void inverse_vmult(size_type i, Vector<number2> &dst, const Vector<number2> &src) const;
 
   /**
    * Multiply with the transposed inverse
    * block at position <tt>i</tt>.
    */
   template <typename number2>
-  void inverse_Tvmult(unsigned int i, Vector<number2> &dst, const Vector<number2> &src) const;
+  void inverse_Tvmult(size_type i, Vector<number2> &dst, const Vector<number2> &src) const;
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #gauss_jordan.
    */
-  FullMatrix<number> &inverse (unsigned int i);
+  FullMatrix<number> &inverse (size_type i);
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #householder.
    */
-  Householder<number> &inverse_householder (unsigned int i);
+  Householder<number> &inverse_householder (size_type i);
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #householder.
    */
-  LAPACKFullMatrix<number> &inverse_svd (unsigned int i);
+  LAPACKFullMatrix<number> &inverse_svd (size_type i);
 
   /**
    * Access to the inverse diagonal
    * blocks.
    */
-  const FullMatrix<number> &inverse (unsigned int i) const;
+  const FullMatrix<number> &inverse (size_type i) const;
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #householder.
    */
-  const Householder<number> &inverse_householder (unsigned int i) const;
+  const Householder<number> &inverse_householder (size_type i) const;
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #householder.
    */
-  const LAPACKFullMatrix<number> &inverse_svd (unsigned int i) const;
+  const LAPACKFullMatrix<number> &inverse_svd (size_type i) const;
 
   /**
    * Access to the diagonal
    * blocks.
    */
-  FullMatrix<number> &diagonal (unsigned int i);
+  FullMatrix<number> &diagonal (size_type i);
 
   /**
    * Access to the diagonal
    * blocks.
    */
-  const FullMatrix<number> &diagonal (unsigned int i) const;
+  const FullMatrix<number> &diagonal (size_type i) const;
 
   /**
    * Print some statistics about
@@ -383,7 +393,7 @@ PreconditionBlockBase<number>::clear()
 template <typename number>
 inline
 void
-PreconditionBlockBase<number>::reinit(unsigned int n, unsigned int b, bool compress,
+PreconditionBlockBase<number>::reinit(unsigned int n, size_type b, bool compress,
                                       Inversion method)
 {
   inversion = method;
@@ -472,9 +482,9 @@ template <typename number2>
 inline
 void
 PreconditionBlockBase<number>::inverse_vmult(
-  unsigned int i, Vector<number2> &dst, const Vector<number2> &src) const
+  size_type i, Vector<number2> &dst, const Vector<number2> &src) const
 {
-  const unsigned int ii = same_diagonal() ? 0U : i;
+  const size_type ii = same_diagonal() ? 0U : i;
 
   switch (inversion)
     {
@@ -501,9 +511,9 @@ template <typename number2>
 inline
 void
 PreconditionBlockBase<number>::inverse_Tvmult(
-  unsigned int i, Vector<number2> &dst, const Vector<number2> &src) const
+  size_type i, Vector<number2> &dst, const Vector<number2> &src) const
 {
-  const unsigned int ii = same_diagonal() ? 0U : i;
+  const size_type ii = same_diagonal() ? 0U : i;
 
   switch (inversion)
     {
@@ -528,7 +538,7 @@ PreconditionBlockBase<number>::inverse_Tvmult(
 template <typename number>
 inline
 const FullMatrix<number> &
-PreconditionBlockBase<number>::inverse(unsigned int i) const
+PreconditionBlockBase<number>::inverse(size_type i) const
 {
   if (same_diagonal())
     return var_inverse_full[0];
@@ -541,7 +551,7 @@ PreconditionBlockBase<number>::inverse(unsigned int i) const
 template <typename number>
 inline
 const Householder<number> &
-PreconditionBlockBase<number>::inverse_householder(unsigned int i) const
+PreconditionBlockBase<number>::inverse_householder(size_type i) const
 {
   if (same_diagonal())
     return var_inverse_householder[0];
@@ -554,7 +564,7 @@ PreconditionBlockBase<number>::inverse_householder(unsigned int i) const
 template <typename number>
 inline
 const LAPACKFullMatrix<number> &
-PreconditionBlockBase<number>::inverse_svd(unsigned int i) const
+PreconditionBlockBase<number>::inverse_svd(size_type i) const
 {
   if (same_diagonal())
     return var_inverse_svd[0];
@@ -567,7 +577,7 @@ PreconditionBlockBase<number>::inverse_svd(unsigned int i) const
 template <typename number>
 inline
 const FullMatrix<number> &
-PreconditionBlockBase<number>::diagonal(unsigned int i) const
+PreconditionBlockBase<number>::diagonal(size_type i) const
 {
   Assert(store_diagonals(), ExcDiagonalsNotStored());
 
@@ -582,7 +592,7 @@ PreconditionBlockBase<number>::diagonal(unsigned int i) const
 template <typename number>
 inline
 FullMatrix<number> &
-PreconditionBlockBase<number>::inverse(unsigned int i)
+PreconditionBlockBase<number>::inverse(size_type i)
 {
   Assert(var_inverse_full.size() != 0, ExcInverseNotAvailable());
 
@@ -597,7 +607,7 @@ PreconditionBlockBase<number>::inverse(unsigned int i)
 template <typename number>
 inline
 Householder<number> &
-PreconditionBlockBase<number>::inverse_householder(unsigned int i)
+PreconditionBlockBase<number>::inverse_householder(size_type i)
 {
   Assert(var_inverse_householder.size() != 0, ExcInverseNotAvailable());
 
@@ -612,7 +622,7 @@ PreconditionBlockBase<number>::inverse_householder(unsigned int i)
 template <typename number>
 inline
 LAPACKFullMatrix<number> &
-PreconditionBlockBase<number>::inverse_svd(unsigned int i)
+PreconditionBlockBase<number>::inverse_svd(size_type i)
 {
   Assert(var_inverse_svd.size() != 0, ExcInverseNotAvailable());
 
@@ -627,7 +637,7 @@ PreconditionBlockBase<number>::inverse_svd(unsigned int i)
 template <typename number>
 inline
 FullMatrix<number> &
-PreconditionBlockBase<number>::diagonal(unsigned int i)
+PreconditionBlockBase<number>::diagonal(size_type i)
 {
   Assert(store_diagonals(), ExcDiagonalsNotStored());
 
@@ -683,10 +693,10 @@ PreconditionBlockBase<number>::log_statistics () const
       double sigmin = 1.e300, sigmax= -1.e300;
       double kappamin = 1.e300, kappamax= -1.e300;
 
-      for (unsigned int b=0; b<size(); ++b)
+      for (size_type b=0; b<size(); ++b)
         {
           const LAPACKFullMatrix<number> &matrix = inverse_svd(b);
-          unsigned int k=1;
+          size_type k=1;
           while (k <= matrix.n_cols() && matrix.singular_value(matrix.n_cols()-k) == 0)
             ++k;
           const double s0 = matrix.singular_value(0);
@@ -724,9 +734,9 @@ std::size_t
 PreconditionBlockBase<number>::memory_consumption () const
 {
   std::size_t mem = sizeof(*this);
-  for (unsigned int i=0; i<var_inverse_full.size(); ++i)
+  for (size_type i=0; i<var_inverse_full.size(); ++i)
     mem += MemoryConsumption::memory_consumption(var_inverse_full[i]);
-  for (unsigned int i=0; i<var_diagonal.size(); ++i)
+  for (size_type i=0; i<var_diagonal.size(); ++i)
     mem += MemoryConsumption::memory_consumption(var_diagonal[i]);
   return mem;
 }
index d4451c3fe8b0bcfd603942781715b3513083dcc8..21fe9100bc368ee283424bba0f9adcf72b38b907 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__precondition_selector_h
 #define __deal2__precondition_selector_h
 
index c4414385d8ab87bcb619840240f70e5904ff0fe8..6e6bb9bb159517be70a041509f55a7d36633718a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__relaxation_block_h
 #define __deal2__relaxation_block_h
 
@@ -63,6 +68,11 @@ private:
   typedef inverse_type value_type;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Parameters for block relaxation methods.
    */
@@ -176,8 +186,8 @@ public:
    * Read-only access to entries.  This function is only possible if
    * the inverse diagonal blocks are stored.
    */
-  value_type el(unsigned int i,
-                unsigned int j) const;
+  value_type el(size_type i,
+                size_type j) const;
 
   /**
    * Stores the inverse of the diagonal blocks in @p inverse. This
index d326a6aac09262293ecf643ffaae835bc1f4115e..621ed762806e2f2ec468d0aa92a5b91eaac706ec 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__relaxation_block_templates_h
 #define __deal2__relaxation_block_templates_h
 
@@ -111,9 +116,9 @@ RelaxationBlock<MATRIX,inverse_type>::invert_diagblocks ()
     }
   else
     {
-      for (unsigned int block=0; block<additional_data->block_list.n_rows(); ++block)
+      for (size_type block=0; block<additional_data->block_list.n_rows(); ++block)
         {
-          const unsigned int bs = additional_data->block_list.row_length(block);
+          const size_type bs = additional_data->block_list.row_length(block);
           M_cell.reinit(bs, bs);
 
           // Copy rows for this block
@@ -121,15 +126,15 @@ RelaxationBlock<MATRIX,inverse_type>::invert_diagblocks ()
           // diagonal block
           SparsityPattern::iterator row
             = additional_data->block_list.begin(block);
-          for (unsigned int row_cell=0; row_cell<bs; ++row_cell, ++row)
+          for (size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
             {
 //TODO:[GK] Optimize here
               for (typename MATRIX::const_iterator entry = M.begin(row->column());
                    entry != M.end(row->column()); ++entry)
                 {
-                  const unsigned int column = entry->column();
-                  const unsigned int col_cell = additional_data->block_list.row_position(block, column);
-                  if (col_cell != numbers::invalid_unsigned_int)
+                  const size_type column = entry->column();
+                  const size_type col_cell = additional_data->block_list.row_position(block, column);
+                  if (col_cell != numbers::invalid_size_type)
                     M_cell(row_cell, col_cell) = entry->value();
                 }
             }
@@ -183,7 +188,7 @@ RelaxationBlock<MATRIX,inverse_type>::do_step (
   const bool permutation_empty = additional_data->order.size() == 0;
   const unsigned int n_permutations = (permutation_empty)
                                       ? 1U : additional_data->order.size();
-  const unsigned int n_blocks = additional_data->block_list.n_rows();
+  const size_type n_blocks = additional_data->block_list.n_rows();
 
   if (!permutation_empty)
     for (unsigned int i=0; i<additional_data->order.size(); ++i)
@@ -200,13 +205,13 @@ RelaxationBlock<MATRIX,inverse_type>::do_step (
                                         ? (additional_data->order[n_permutations-1-perm][raw_block])
                                         : (additional_data->order[perm][raw_block]));
 
-          const unsigned int bs = additional_data->block_list.row_length(block);
+          const size_type bs = additional_data->block_list.row_length(block);
 
           b_cell.reinit(bs);
           x_cell.reinit(bs);
           // Collect off-diagonal parts
           SparsityPattern::iterator row = additional_data->block_list.begin(block);
-          for (unsigned int row_cell=0; row_cell<bs; ++row_cell, ++row)
+          for (size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
             {
               b_cell(row_cell) = src(row->column());
               for (typename MATRIX::const_iterator entry = M.begin(row->column());
@@ -216,14 +221,14 @@ RelaxationBlock<MATRIX,inverse_type>::do_step (
           // Apply inverse diagonal
           this->inverse_vmult(block, x_cell, b_cell);
 #ifdef DEBUG
-         for (unsigned int i=0;i<x_cell.size();++i)
-           {
-             Assert(numbers::is_finite(x_cell(i)), ExcNumberNotFinite());
-           }
+          for (unsigned int i=0; i<x_cell.size(); ++i)
+            {
+              Assert(numbers::is_finite(x_cell(i)), ExcNumberNotFinite());
+            }
 #endif
           // Store in result vector
           row=additional_data->block_list.begin(block);
-          for (unsigned int row_cell=0; row_cell<bs; ++row_cell, ++row)
+          for (size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
             dst(row->column()) = prev(row->column()) + additional_data->relaxation * x_cell(row_cell);
         }
     }
index 8f6d671f826eb8957fabfcc2e5db84b7a9533600..8de512c5bb5db288945074baaae1d4d391e646e7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__schur_matrix_h
 #define __deal2__schur_matrix_h
 
@@ -204,7 +209,7 @@ private:
   /**
    * Optional signature of the @p u-vector.
    */
-  std::vector<unsigned int> signature;
+  std::vector<types::global_dof_index> signature;
 
   /**
    * Switch for debugging information.
@@ -222,7 +227,7 @@ SchurMatrix<MA_inverse, MB, MDt, MC>
               const MDt &Dt,
               const MC &C,
               VectorMemory<BlockVector<double> > &mem,
-              const std::vector<unsigned int> &signature)
+              const std::vector<types::global_dof_index> &signature)
   : Ainv(&Ainv), B(&B), Dt(&Dt), C(&C),
     mem(mem),
     signature(signature),
index 185c0d1279ddd38a1a95ce6de7680c3f7f1d7910..6e1a8655e9d04992828ec9ab9553a778f8fa2f3e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__shifted_matrix_h
 #define __deal2__shifted_matrix_h
 
index d363702a981ddc7c611ed28e43b2819c39a25576..b5135d7403593c1c317807cb2c69932c51c9cd16 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Author: Toby D. Young, Polish Academy of Sciences, 2008-2013
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009-2013 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__slepc_solver_h
 #define __deal2__slepc_solver_h
@@ -115,6 +119,10 @@ namespace SLEPcWrappers
   class SolverBase
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
 
     /**
      * Constructor. Takes the MPI communicator over which parallel
@@ -153,7 +161,7 @@ namespace SLEPcWrappers
     solve (const PETScWrappers::MatrixBase &A,
            std::vector<double>             &eigenvalues,
            std::vector<OutputVector>       &eigenvectors,
-           const unsigned int               n_eigenpairs = 1);
+           const size_type                  n_eigenpairs = 1);
 
     /**
      * Same as above, but here a composite method for solving the
@@ -166,7 +174,7 @@ namespace SLEPcWrappers
            const PETScWrappers::MatrixBase &B,
            std::vector<double>             &eigenvalues,
            std::vector<OutputVector>       &eigenvectors,
-           const unsigned int               n_eigenpairs = 1);
+           const size_type                  n_eigenpairs = 1);
 
     /**
      * Same as above, but here a composite method for solving the
@@ -228,7 +236,7 @@ namespace SLEPcWrappers
      * deal.II's own SolverControl objects to see if convergence has
      * been reached.
      */
-    void 
+    void
     get_solver_state (const SolverControl::State state);
 
     /**
@@ -305,7 +313,7 @@ namespace SLEPcWrappers
      */
     void
     get_eigenpair (const unsigned int         index,
-                   double                    &eigenvalues,
+                   PetscScalar               &eigenvalues,
                    PETScWrappers::VectorBase &eigenvectors);
 
     /**
@@ -717,8 +725,8 @@ namespace SLEPcWrappers
      * change that.
      */
     SolverLAPACK (SolverControl        &cn,
-                 const MPI_Comm       &mpi_communicator = PETSC_COMM_SELF,
-                 const AdditionalData &data = AdditionalData());
+                  const MPI_Comm       &mpi_communicator = PETSC_COMM_SELF,
+                  const AdditionalData &data = AdditionalData());
 
   protected:
 
@@ -742,122 +750,122 @@ namespace SLEPcWrappers
   // todo: The logic of these functions can be simplified without breaking backward compatibility...
 
   template <typename OutputVector>
-    void
-    SolverBase::solve (const PETScWrappers::MatrixBase &A,
-                      std::vector<double>             &eigenvalues,
-                      std::vector<OutputVector>       &eigenvectors,
-                      const unsigned int               n_eigenpairs)
-    {
-      // Panic if the number of eigenpairs wanted is out of bounds.
-      AssertThrow ((n_eigenpairs > 0) && (n_eigenpairs <= A.m ()), 
-                  ExcSLEPcWrappersUsageError());
-      
-      // Set the matrices of the problem
-      set_matrices (A);  
-      
-      // and solve
-      unsigned int n_converged = 0; 
-      solve (n_eigenpairs, &n_converged); 
-      
-      if (n_converged > n_eigenpairs) 
-       n_converged = n_eigenpairs; 
-      AssertThrow (n_converged == n_eigenpairs, 
-                  ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs)); 
-      
-      AssertThrow (eigenvectors.size() != 0, ExcSLEPcWrappersUsageError()); 
-      eigenvectors.resize (n_converged, eigenvectors.front()); 
-      eigenvalues.resize (n_converged); 
-      
-      for (unsigned int index=0; index<n_converged; ++index) 
-       get_eigenpair (index, eigenvalues[index], eigenvectors[index]); 
-    }
-  
+  void
+  SolverBase::solve (const PETScWrappers::MatrixBase &A,
+                     std::vector<double>             &eigenvalues,
+                     std::vector<OutputVector>       &eigenvectors,
+                     const size_type                  n_eigenpairs)
+  {
+    // Panic if the number of eigenpairs wanted is out of bounds.
+    AssertThrow ((n_eigenpairs > 0) && (n_eigenpairs <= A.m ()),
+                 ExcSLEPcWrappersUsageError());
+
+    // Set the matrices of the problem
+    set_matrices (A);
+
+    // and solve
+    size_type n_converged = 0;
+    solve (n_eigenpairs, &n_converged);
+
+    if (n_converged > n_eigenpairs)
+      n_converged = n_eigenpairs;
+    AssertThrow (n_converged == n_eigenpairs,
+                 ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs));
+
+    AssertThrow (eigenvectors.size() != 0, ExcSLEPcWrappersUsageError());
+    eigenvectors.resize (n_converged, eigenvectors.front());
+    eigenvalues.resize (n_converged);
+
+    for (size_type index=0; index<n_converged; ++index)
+      get_eigenpair (index, eigenvalues[index], eigenvectors[index]);
+  }
+
   template <typename OutputVector>
-    void
-    SolverBase::solve (const PETScWrappers::MatrixBase &A,
-                      const PETScWrappers::MatrixBase &B,
-                      std::vector<double>             &eigenvalues,
-                      std::vector<OutputVector>       &eigenvectors,
-                      const unsigned int               n_eigenpairs)
-    { 
-      // Guard against incompatible matrix sizes:
-      AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m()));
-      AssertThrow (A.n() == B.n (), ExcDimensionMismatch(A.n(), B.n()));
-      
-      // Panic if the number of eigenpairs wanted is out of bounds.
-      AssertThrow ((n_eigenpairs>0) && (n_eigenpairs<=A.m ()), 
-                  ExcSLEPcWrappersUsageError());
-      
-      // Set the matrices of the problem
-      set_matrices (A, B);
-      
-      // and solve
-      unsigned int n_converged = 0;
-      solve (n_eigenpairs, &n_converged);
-      
-      if (n_converged>=n_eigenpairs)
-       n_converged = n_eigenpairs;
-      
-      AssertThrow (n_converged==n_eigenpairs,
-                  ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs));
-      AssertThrow (eigenvectors.size() != 0, ExcSLEPcWrappersUsageError());
-      
-      eigenvectors.resize (n_converged, eigenvectors.front());
-      eigenvalues.resize (n_converged);
-      
-      for (unsigned int index=0; index<n_converged; ++index)
-       get_eigenpair (index, eigenvalues[index], eigenvectors[index]);
-    }
+  void
+  SolverBase::solve (const PETScWrappers::MatrixBase &A,
+                     const PETScWrappers::MatrixBase &B,
+                     std::vector<double>             &eigenvalues,
+                     std::vector<OutputVector>       &eigenvectors,
+                     const size_type                  n_eigenpairs)
+  {
+    // Guard against incompatible matrix sizes:
+    AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m()));
+    AssertThrow (A.n() == B.n (), ExcDimensionMismatch(A.n(), B.n()));
+
+    // Panic if the number of eigenpairs wanted is out of bounds.
+    AssertThrow ((n_eigenpairs>0) && (n_eigenpairs<=A.m ()),
+                 ExcSLEPcWrappersUsageError());
+
+    // Set the matrices of the problem
+    set_matrices (A, B);
+
+    // and solve
+    size_type n_converged = 0;
+    solve (n_eigenpairs, &n_converged);
+
+    if (n_converged>=n_eigenpairs)
+      n_converged = n_eigenpairs;
+
+    AssertThrow (n_converged==n_eigenpairs,
+                 ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs));
+    AssertThrow (eigenvectors.size() != 0, ExcSLEPcWrappersUsageError());
+
+    eigenvectors.resize (n_converged, eigenvectors.front());
+    eigenvalues.resize (n_converged);
+
+    for (size_type index=0; index<n_converged; ++index)
+      get_eigenpair (index, eigenvalues[index], eigenvectors[index]);
+  }
 
   template <typename OutputVector>
-    void
-    SolverBase::solve (const PETScWrappers::MatrixBase &A,
-                      const PETScWrappers::MatrixBase &B,
-                      std::vector<double>             &real_eigenvalues,
-                      std::vector<double>             &imag_eigenvalues,
-                      std::vector<OutputVector>       &real_eigenvectors,
-                      std::vector<OutputVector>       &imag_eigenvectors,
-                      const unsigned int               n_eigenpairs)
-    { 
-      // Guard against incompatible matrix sizes:
-      AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m()));
-      AssertThrow (A.n() == B.n (), ExcDimensionMismatch(A.n(), B.n()));
-
-      // and incompatible eigenvalue/eigenvector sizes
-      AssertThrow (real_eigenvalues.size() == imag_eigenvalues.size(),  
-                          ExcDimensionMismatch(real_eigenvalues.size(), imag_eigenvalues.size())); 
-      AssertThrow (real_eigenvectors.size() == imag_eigenvectors.n (),  
-                          ExcDimensionMismatch(real_eigenvectors.size(), imag_eigenvectors.size())); 
-
-      // Panic if the number of eigenpairs wanted is out of bounds.
-      AssertThrow ((n_eigenpairs>0) && (n_eigenpairs<=A.m ()), 
-                  ExcSLEPcWrappersUsageError());
-      
-      // Set the matrices of the problem
-      set_matrices (A, B);
-      
-      // and solve
-      unsigned int n_converged = 0;
-      solve (n_eigenpairs, &n_converged);
-      
-      if (n_converged>=n_eigenpairs)
-       n_converged = n_eigenpairs;
-      
-      AssertThrow (n_converged==n_eigenpairs,
-                  ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs));
-      AssertThrow ((real_eigenvectors.size()!=0) && (imag_eigenvectors.size()!=0), 
-                  ExcSLEPcWrappersUsageError());
-      
-      real_eigenvectors.resize (n_converged, real_eigenvectors.front());
-      imag_eigenvectors.resize (n_converged, imag_eigenvectors.front());
-      real_eigenvalues.resize (n_converged);
-      imag_eigenvalues.resize (n_converged);
-      
-      for (unsigned int index=0; index<n_converged; ++index)
-       get_eigenpair (index, 
-                      real_eigenvalues[index], imag_eigenvalues[index], 
-                      real_eigenvectors[index], imag_eigenvectors[index]);
-    }
+  void
+  SolverBase::solve (const PETScWrappers::MatrixBase &A,
+                     const PETScWrappers::MatrixBase &B,
+                     std::vector<double>             &real_eigenvalues,
+                     std::vector<double>             &imag_eigenvalues,
+                     std::vector<OutputVector>       &real_eigenvectors,
+                     std::vector<OutputVector>       &imag_eigenvectors,
+                     const size_type                  n_eigenpairs)
+  {
+    // Guard against incompatible matrix sizes:
+    AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m()));
+    AssertThrow (A.n() == B.n (), ExcDimensionMismatch(A.n(), B.n()));
+
+    // and incompatible eigenvalue/eigenvector sizes
+    AssertThrow (real_eigenvalues.size() == imag_eigenvalues.size(),
+                 ExcDimensionMismatch(real_eigenvalues.size(), imag_eigenvalues.size()));
+    AssertThrow (real_eigenvectors.size() == imag_eigenvectors.n (),
+                 ExcDimensionMismatch(real_eigenvectors.size(), imag_eigenvectors.size()));
+
+    // Panic if the number of eigenpairs wanted is out of bounds.
+    AssertThrow ((n_eigenpairs>0) && (n_eigenpairs<=A.m ()),
+                 ExcSLEPcWrappersUsageError());
+
+    // Set the matrices of the problem
+    set_matrices (A, B);
+
+    // and solve
+    size_type n_converged = 0;
+    solve (n_eigenpairs, &n_converged);
+
+    if (n_converged>=n_eigenpairs)
+      n_converged = n_eigenpairs;
+
+    AssertThrow (n_converged==n_eigenpairs,
+                 ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs));
+    AssertThrow ((real_eigenvectors.size()!=0) && (imag_eigenvectors.size()!=0),
+                 ExcSLEPcWrappersUsageError());
+
+    real_eigenvectors.resize (n_converged, real_eigenvectors.front());
+    imag_eigenvectors.resize (n_converged, imag_eigenvectors.front());
+    real_eigenvalues.resize (n_converged);
+    imag_eigenvalues.resize (n_converged);
+
+    for (size_type index=0; index<n_converged; ++index)
+      get_eigenpair (index,
+                     real_eigenvalues[index], imag_eigenvalues[index],
+                     real_eigenvectors[index], imag_eigenvectors[index]);
+  }
 
 }
 
index c33a99bb9b6581d34f718e22755485be422b9f7f..4598afbb849fcfdd5028008bd3a6811c69b3bcf8 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Author: Toby D. Young, Polish Academy of Sciences, 2009
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__slepc_spectral_transformation_h
 #define __deal2__slepc_spectral_transformation_h
@@ -43,7 +47,7 @@ namespace SLEPcWrappers
    * <code>eigensolver</code>:
    * @code
    *  // Set a transformation, this one shifts the eigenspectrum by 3.142..
-   *  SLEPcWrappers::TransformationShift::AdditionalData additional_data (3.142); 
+   *  SLEPcWrappers::TransformationShift::AdditionalData additional_data (3.142);
    *  SLEPcWrappers::TransformationShift shift (additional_data);
    *  eigensolver.set_transformation (shift);
    * @endcode
@@ -53,7 +57,7 @@ namespace SLEPcWrappers
    *  SolverArnoldi system (solver_control, mpi_communicator);
    *  eigensolver.solve (A, B, lambda, x, size_of_spectrum);
    * @endcode
-   * 
+   *
    * @note These options can also be set at the commandline.
    *
    * @ingroup SLEPcWrappers
index ac1c2942e53c80e4f7faae538f029627b7a852e0..aeee863fcfc736fa41c6010d3c16c6e2b22fd2c0 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_h
 #define __deal2__solver_h
 
index f81d517d52090c7584f28bc566993e869e20f41a..98d65a76464455e044eefb092e481052d9226cff 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_bicgstab_h
 #define __deal2__solver_bicgstab_h
 
index 2d82c645520879c03d7c8267ffaef7a71a2d18f3..3f31cdce726849d30422eee769e88aa8d6b15cf8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_cg_h
 #define __deal2__solver_cg_h
 
@@ -75,6 +80,11 @@ template <class VECTOR = Vector<double> >
 class SolverCG : public Solver<VECTOR>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Standardized data struct to pipe
    * additional data to the solver.
@@ -422,7 +432,7 @@ SolverCG<VECTOR>::solve (const MATRIX         &A,
           if (additional_data.compute_all_condition_numbers && (diagonal.size()>1))
             {
               TridiagonalMatrix<double> T(diagonal.size(), true);
-              for (unsigned int i=0; i<diagonal.size(); ++i)
+              for (size_type i=0; i<diagonal.size(); ++i)
                 {
                   T(i,i) = diagonal[i];
                   if (i< diagonal.size()-1)
@@ -444,7 +454,7 @@ SolverCG<VECTOR>::solve (const MATRIX         &A,
   if (do_eigenvalues)
     {
       TridiagonalMatrix<double> T(diagonal.size(), true);
-      for (unsigned int i=0; i<diagonal.size(); ++i)
+      for (size_type i=0; i<diagonal.size(); ++i)
         {
           T(i,i) = diagonal[i];
           if (i< diagonal.size()-1)
@@ -458,7 +468,7 @@ SolverCG<VECTOR>::solve (const MATRIX         &A,
                 T.eigenvalue(T.n()-1)/T.eigenvalue(0) << std::endl;
       if (additional_data.compute_eigenvalues)
         {
-          for (unsigned int i=0; i<T.n(); ++i)
+          for (size_type i=0; i<T.n(); ++i)
             deallog << ' ' << T.eigenvalue(i);
           deallog << std::endl;
         }
index 7b9eb3ff2fa6bb1bb15175424528f523698279c7..7116304470900beec4c1f82afb48a29fea672460 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_control_h
 #define __deal2__solver_control_h
 
index 936b9a1a022106e147845d5a31e1d6bad17cec67..902b00493b647c1e495e85d6de6f99a59c451da6 100644 (file)
@@ -1,14 +1,19 @@
-//----------------------------  solver_gmres.h  ---------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  solver_gmres.h  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_gmres_h
 #define __deal2__solver_gmres_h
 
@@ -705,7 +710,7 @@ SolverGMRES<VECTOR>::solve (const MATRIX         &A,
               precondition.vmult(vv,p);
             }
           else
-            { 
+            {
               precondition.vmult(p, tmp_vectors[inner_iteration]);
               A.vmult(vv,p);
             };
index 4cb465060308d899257d0e907e586717f768d780..37934f4f041dd91990c92fb7e816432b36cee4d4 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_minres_h
 #define __deal2__solver_minres_h
 
index 12b1266d735be80059418bdf244cebbd30bd18ed..1cce088b84bde6c6283013659b587f42ea00c284 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_qmrs_h
 #define __deal2__solver_qmrs_h
 
index dd38286392e5e4de709c00078124c2267e4c2b6a..6a78113b5e3ae2b96935831f701c13e41da38cc0 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_relaxation_h
 #define __deal2__solver_relaxation_h
 
index e7c4c27dd3cacbf45e8629499edf66f3cd55d3a2..fd881aeb6d8b6eaedb154f2526dab83675799c63 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_richardson_h
 #define __deal2__solver_richardson_h
 
index 39bfaddec74a48128720ae33888cd09ce5fb4e8d..b027bb34c731d04f69b76d8a8050f7ebe9c40a47 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solver_selector_h
 #define __deal2__solver_selector_h
 
index 3f3d9cf42a0ad8ec0b00adb90a9c02972d34c388..b92e2712d66c23d06d0604aae9a2f7597c216bb7 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2012 by the deal.II authors
-//    by the deal.II authors and Stephen "Cheffo" Kolaroff
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_decomposition_h
 #define __deal2__sparse_decomposition_h
 
@@ -159,6 +163,11 @@ protected:
   SparseLUDecomposition (const SparsityPattern &sparsity) DEAL_II_DEPRECATED;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Destruction. Mark the
    * destructor pure to ensure that
@@ -389,7 +398,7 @@ protected:
    * <tt>strengthen_diagonal</tt>'s
    * value.
    */
-  virtual number get_strengthen_diagonal(const number rowsum, const unsigned int row) const;
+  virtual number get_strengthen_diagonal(const number rowsum, const size_type row) const;
 
   /**
    * State flag. If not in
@@ -421,7 +430,7 @@ protected:
    * available after invocation of
    * decompose().
    */
-  std::vector<const unsigned int *> prebuilt_lower_bound;
+  std::vector<const size_type *> prebuilt_lower_bound;
 
 private:
   /**
@@ -460,7 +469,7 @@ template <typename number>
 inline number
 SparseLUDecomposition<number>::
 get_strengthen_diagonal(const number /*rowsum*/,
-                        const unsigned int /*row*/) const
+                        const size_type /*row*/) const
 {
   return strengthen_diagonal;
 }
index 3935ef107b2efeab4abf3e7db903ff68571805da..278929f8438b73fc9fe6d51fbd452fd8cc9175ae 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2011, 2012, 2013 by the deal.II authors
-//    by the deal.II authors and Stephen "Cheffo" Kolaroff
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//---------------------------------------------------------------------------
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__sparse_decomposition_templates_h
 #define __deal2__sparse_decomposition_templates_h
@@ -54,7 +60,7 @@ void SparseLUDecomposition<number>::clear()
 {
   decomposed = false;
 
-  std::vector<const unsigned int *> tmp;
+  std::vector<const size_type *> tmp;
   tmp.swap (prebuilt_lower_bound);
 
   SparseMatrix<number>::clear();
@@ -129,7 +135,7 @@ void SparseLUDecomposition<number>::initialize (
           typename SparsityPattern::ExcDiagonalNotOptimized());
   decomposed = false;
   {
-    std::vector<const unsigned int *> tmp;
+    std::vector<const size_type *> tmp;
     tmp.swap (prebuilt_lower_bound);
   }
   SparseMatrix<number>::reinit (*sparsity_pattern_to_use);
@@ -160,7 +166,7 @@ void SparseLUDecomposition<number>::reinit (const SparsityPattern &sparsity)
           typename SparsityPattern::ExcDiagonalNotOptimized());
   decomposed = false;
   {
-    std::vector<const unsigned int *> tmp;
+    std::vector<const size_type *> tmp;
     tmp.swap (prebuilt_lower_bound);
   }
   SparseMatrix<number>::reinit (sparsity);
@@ -172,20 +178,20 @@ template<typename number>
 void
 SparseLUDecomposition<number>::prebuild_lower_bound()
 {
-  const unsigned int *const
-    column_numbers = this->get_sparsity_pattern().colnums;
+  const size_type *const
+  column_numbers = this->get_sparsity_pattern().colnums;
   const std::size_t *const
-    rowstart_indices = this->get_sparsity_pattern().rowstart;
-  const unsigned int N = this->m();
-   prebuilt_lower_bound.resize (N);
-   for (unsigned int row=0; row<N; row++)
-     {
-       prebuilt_lower_bound[row]
-         = Utilities::lower_bound (&column_numbers[rowstart_indices[row]+1],
-                                   &column_numbers[rowstart_indices[row+1]],
-                                   row);
+  rowstart_indices = this->get_sparsity_pattern().rowstart;
+  const size_type N = this->m();
+
+  prebuilt_lower_bound.resize (N);
+
+  for (size_type row=0; row<N; row++)
+    {
+      prebuilt_lower_bound[row]
+        = Utilities::lower_bound (&column_numbers[rowstart_indices[row]+1],
+                                  &column_numbers[rowstart_indices[row+1]],
+                                  row);
     }
 }
 
@@ -214,11 +220,11 @@ SparseLUDecomposition<number>::copy_from (const SparseMatrix<somenumber> &matrix
   SparseMatrix<number>::operator= (number(0));
 
   // both allow more and less entries in the new matrix
-  for (unsigned int row=0; row<this->m(); ++row)
+  for (size_type row=0; row<this->m(); ++row)
     {
       typename SparseMatrix<number>::iterator index = this->begin(row);
       typename SparseMatrix<somenumber>::const_iterator
-        in_index = matrix.begin(row);
+      in_index = matrix.begin(row);
       index->value() = in_index->value();
       ++index, ++in_index;
       while (index < this->end(row) && in_index < matrix.end(row))
@@ -240,7 +246,7 @@ template <typename number>
 void
 SparseLUDecomposition<number>::strengthen_diagonal_impl ()
 {
-  for (unsigned int row=0; row<this->m(); ++row)
+  for (size_type row=0; row<this->m(); ++row)
     {
       // get the global index of the first
       // non-diagonal element in this row
index da58687d0b772aa974f0ffa22ca3add7ec8b30fe..8ef14a7a383bec0953c82e7f74f5e644db0895d1 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_direct_h
 #define __deal2__sparse_direct_h
 
@@ -30,8 +35,6 @@
 
 DEAL_II_NAMESPACE_OPEN
 
-
-
 /**
  * This class provides an interface to the sparse direct solver
  * UMFPACK (see <a
@@ -80,6 +83,11 @@ DEAL_II_NAMESPACE_OPEN
 class SparseDirectUMFPACK : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Dummy class needed for the usual initalization interface of
    * preconditioners.
@@ -105,7 +113,7 @@ public:
   /**
    * @{
    */
-   
+
   /**
    * This function does nothing. It is only here to provide a interface
    * consistent with other sparse direct solvers.
@@ -150,10 +158,10 @@ public:
   /**
    * @{
    */
-  
+
   /**
    * Preconditioner interface function. Usually, given the source vector,
-   * this method returns an approximated solution of <i>Ax = b</i>. As this
+   * this method returns an approximate solution of <i>Ax = b</i>. As this
    * class provides a wrapper to a direct solver, here it is actually the
    * exact solution (exact within the range of numerical accuracy of
    * course).
@@ -162,33 +170,41 @@ public:
    * inverse of the matrix, $A^{-1}$.
    */
   void vmult (Vector<double> &dst,
-             const Vector<double> &src) const;
+              const Vector<double> &src) const;
 
   /**
    * Same as before, but for block vectors.
    */
   void vmult (BlockVector<double> &dst,
-             const BlockVector<double> &src) const;
+              const BlockVector<double> &src) const;
 
   /**
-   * Not implemented but necessary for compiling certain other classes.
+   * Same as before, but uses the transpose of the matrix, i.e. this
+   * function multiplies with $A^{-T}$.
    */
   void Tvmult (Vector<double> &dst,
-              const Vector<double> &src) const;
+               const Vector<double> &src) const;
+
+  /**
+   * Same as before, but for block vectors
+   */
+  void Tvmult (BlockVector<double> &dst,
+               const BlockVector<double> &src) const;
 
   /**
    * Same as vmult(), but adding to the previous solution. Not implemented
    * yet but necessary for compiling certain other classes.
    */
   void vmult_add (Vector<double> &dst,
-                 const Vector<double> &src) const;
+                  const Vector<double> &src) const;
 
   /**
-   * Not implemented but necessary for compiling certain other classes.
+   * Same as before, but uses the transpose of the matrix, i.e. this
+   * function multiplies with $A^{-T}$.
    */
   void Tvmult_add (Vector<double> &dst,
-                  const Vector<double> &src) const;
-  
+                   const Vector<double> &src) const;
+
   /**
    * @}
    */
@@ -213,14 +229,17 @@ public:
    * happen. Note that we can't actually call the factorize() function from
    * here if it has not yet been called, since we have no access to the
    * actual matrix.
+   *
+   * If @p transpose is set to true this function solves for the transpose
+   * of the matrix, i.e. $x=A^{-T}b$.
    */
-  void solve (Vector<double> &rhs_and_solution) const;
+  void solve (Vector<double> &rhs_and_solution, bool transpose = false) const;
 
   /**
    * Same as before, but for block vectors.
    */
-  void solve (BlockVector<double> &rhs_and_solution) const;
-  
+  void solve (BlockVector<double> &rhs_and_solution, bool transpose = false) const;
+
   /**
    * Call the two functions factorize() and solve() in that order, i.e. perform
    * the whole solution process for the given right hand side vector.
@@ -229,19 +248,21 @@ public:
    */
   template <class Matrix>
   void solve (const Matrix   &matrix,
-              Vector<double> &rhs_and_solution);
+              Vector<double> &rhs_and_solution,
+              bool            transpose = false);
 
   /**
    * Same as before, but for block vectors.
    */
   template <class Matrix>
   void solve (const Matrix        &matrix,
-              BlockVector<double> &rhs_and_solution);
+              BlockVector<double> &rhs_and_solution,
+              bool                 transpose = false);
 
   /**
    * @}
    */
-  
+
   /**
    * One of the UMFPack routines threw an error. The error code is included
    * in the output and can be looked up in the UMFPack user manual. The
@@ -250,8 +271,8 @@ public:
   DeclException2 (ExcUMFPACKError, char *, int,
                   << "UMFPACK routine " << arg1
                   << " returned error status " << arg2
-                  << ". See the file <contrib/umfpack/UMFPACK/Include/umfpack.h>"
-                  << " for a description of error codes.");
+                  << ". See the file <bundled/umfpack/UMFPACK/Include/umfpack.h>"
+                  << " for a description of 'status codes'.");
 
 private:
   /**
@@ -324,12 +345,12 @@ private:
   DMUMPS_STRUC_C id;
 #endif // DEAL_II_WITH_MUMPS
 
-  double       *a;
-  double       *rhs;
-  int          *irn;
-  int          *jcn;
-  unsigned int  n;
-  unsigned int  nz;
+  double   *a;
+  double   *rhs;
+  int      *irn;
+  int      *jcn;
+  types::global_dof_index n;
+  types::global_dof_index nz;
 
   /**
    * This function initializes a MUMPS instance and hands over the system's
@@ -350,6 +371,10 @@ private:
   bool initialize_called;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
 
   /**
    * Constructor
index ba745ccbbfb43ede877bd85072ba005f4aabcf99..a609bbbe1266249ecc4bcdab3547d4601566363f 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2012 by the deal.II authors
-//    by the deal.II authors and Stephen "Cheffo" Kolaroff
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//---------------------------------------------------------------------------
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__sparse_ilu_h
 #define __deal2__sparse_ilu_h
@@ -53,6 +59,11 @@ template <typename number>
 class SparseILU : public SparseLUDecomposition<number>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. Does nothing.
    *
index c695e9face7be95b844faacb20a281a374fb0b9d..ffffd2914c0e112d35d6156b8a75f782f861a07d 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2011, 2012 by the deal.II authors
-//    by the deal.II authors and Stephen "Cheffo" Kolaroff
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//---------------------------------------------------------------------------
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_ilu_templates_h
 #define __deal2__sparse_ilu_templates_h
 
@@ -71,29 +77,29 @@ void SparseILU<number>::decompose (const SparseMatrix<somenumber> &matrix,
   // translating in essence the algorithm given at the end of section 10.3.2,
   // using the names of variables used there
   const SparsityPattern     &sparsity = this->get_sparsity_pattern();
-  const std::size_t   *const ia      = sparsity.rowstart;
-  const unsigned int *const ja       = sparsity.colnums;
+  const std::size_t *const ia    = sparsity.rowstart;
+  const size_type *const ja      = sparsity.colnums;
 
   number *luval = this->SparseMatrix<number>::val;
 
-  const unsigned int N = this->m();
-  unsigned int jrow = 0;
+  const size_type N = this->m();
+  size_type jrow = 0;
 
-  std::vector<unsigned int> iw (N, numbers::invalid_unsigned_int);
+  std::vector<size_type> iw (N, numbers::invalid_size_type);
 
-  for (unsigned int k=0; k<N; ++k)
+  for (size_type k=0; k<N; ++k)
     {
-      const unsigned int j1 = ia[k],
-                         j2 = ia[k+1]-1;
+      const size_type j1 = ia[k],
+                      j2 = ia[k+1]-1;
 
-      for (unsigned int j=j1; j<=j2; ++j)
+      for (size_type j=j1; j<=j2; ++j)
         iw[ja[j]] = j;
 
       // the algorithm in the book works on the elements of row k left of the
       // diagonal. however, since we store the diagonal element at the first
       // position, start at the element after the diagonal and run as long as
       // we don't walk into the right half
-      unsigned int j = j1+1;
+      size_type j = j1+1;
 
       // pathological case: the current row of the matrix has only the
       // diagonal entry. then we have nothing to do.
@@ -112,13 +118,13 @@ label_150:
         luval[j] = t1;
 
         // jj runs from just right of the diagonal to the end of the row
-        unsigned int jj = ia[jrow]+1;
+        size_type jj = ia[jrow]+1;
         while (ja[jj] < jrow)
           ++jj;
         for (; jj<ia[jrow+1]; ++jj)
           {
-            const unsigned int jw = iw[ja[jj]];
-            if (jw != numbers::invalid_unsigned_int)
+            const size_type jw = iw[ja[jj]];
+            if (jw != numbers::invalid_size_type)
               luval[jw] -= t1 * luval[jj];
           }
 
@@ -142,8 +148,8 @@ label_200:
 
       luval[ia[k]] = 1./luval[ia[k]];
 
-      for (unsigned int j=j1; j<=j2; ++j)
-        iw[ja[j]] = numbers::invalid_unsigned_int;
+      for (size_type j=j1; j<=j2; ++j)
+        iw[ja[j]] = numbers::invalid_size_type;
     }
 }
 
@@ -158,10 +164,10 @@ void SparseILU<number>::vmult (Vector<somenumber>       &dst,
   Assert (dst.size() == src.size(), ExcDimensionMismatch(dst.size(), src.size()));
   Assert (dst.size() == this->m(), ExcDimensionMismatch(dst.size(), this->m()));
 
-  const unsigned int N=dst.size();
-  const std::size_t  *const rowstart_indices
+  const size_type N=dst.size();
+  const std::size_t *const rowstart_indices
     = this->get_sparsity_pattern().rowstart;
-  const unsigned int *const column_numbers
+  const size_type *const column_numbers
     = this->get_sparsity_pattern().colnums;
 
   // solve LUx=b in two steps:
@@ -177,19 +183,19 @@ void SparseILU<number>::vmult (Vector<somenumber>       &dst,
   // perform it at the outset of the
   // loop
   dst = src;
-  for (unsigned int row=0; row<N; ++row)
+  for (size_type row=0; row<N; ++row)
     {
       // get start of this row. skip the
       // diagonal element
-      const unsigned int *const rowstart = &column_numbers[rowstart_indices[row]+1];
+      const size_type *const rowstart = &column_numbers[rowstart_indices[row]+1];
       // find the position where the part
       // right of the diagonal starts
-      const unsigned int *const first_after_diagonal = this->prebuilt_lower_bound[row];
+      const size_type *const first_after_diagonal = this->prebuilt_lower_bound[row];
 
       somenumber dst_row = dst(row);
       const number *luval = this->SparseMatrix<number>::val +
                             (rowstart - column_numbers);
-      for (const unsigned int *col=rowstart; col!=first_after_diagonal; ++col, ++luval)
+      for (const size_type *col=rowstart; col!=first_after_diagonal; ++col, ++luval)
         dst_row -= *luval * dst(*col);
       dst(row) = dst_row;
     }
@@ -205,15 +211,15 @@ void SparseILU<number>::vmult (Vector<somenumber>       &dst,
   for (int row=N-1; row>=0; --row)
     {
       // get end of this row
-      const unsigned int *const rowend = &column_numbers[rowstart_indices[row+1]];
+      const size_type *const rowend = &column_numbers[rowstart_indices[row+1]];
       // find the position where the part
       // right of the diagonal starts
-      const unsigned int *const first_after_diagonal = this->prebuilt_lower_bound[row];
+      const size_type *const first_after_diagonal = this->prebuilt_lower_bound[row];
 
       somenumber dst_row = dst(row);
       const number *luval = this->SparseMatrix<number>::val +
                             (first_after_diagonal - column_numbers);
-      for (const unsigned int *col=first_after_diagonal; col!=rowend; ++col, ++luval)
+      for (const size_type *col=first_after_diagonal; col!=rowend; ++col, ++luval)
         dst_row -= *luval * dst(*col);
 
       // scale by the diagonal element.
@@ -232,10 +238,10 @@ void SparseILU<number>::Tvmult (Vector<somenumber>       &dst,
   Assert (dst.size() == src.size(), ExcDimensionMismatch(dst.size(), src.size()));
   Assert (dst.size() == this->m(), ExcDimensionMismatch(dst.size(), this->m()));
 
-  const unsigned int N=dst.size();
-  const std::size_t   *const rowstart_indices
+  const size_type N=dst.size();
+  const std::size_t *const rowstart_indices
     = this->get_sparsity_pattern().rowstart;
-  const unsigned int *const column_numbers
+  const size_type *const column_numbers
     = this->get_sparsity_pattern().colnums;
 
   // solve (LU)'x=b in two steps:
@@ -249,7 +255,7 @@ void SparseILU<number>::Tvmult (Vector<somenumber>       &dst,
   Vector<somenumber> tmp (N);
 
   dst = src;
-  for (unsigned int row=0; row<N; ++row)
+  for (size_type row=0; row<N; ++row)
     {
       dst(row) -= tmp (row);
       // scale by the diagonal element.
@@ -258,15 +264,15 @@ void SparseILU<number>::Tvmult (Vector<somenumber>       &dst,
       dst(row) *= this->diag_element(row);
 
       // get end of this row
-      const unsigned int *const rowend = &column_numbers[rowstart_indices[row+1]];
+      const size_type *const rowend = &column_numbers[rowstart_indices[row+1]];
       // find the position where the part
       // right of the diagonal starts
-      const unsigned int *const first_after_diagonal = this->prebuilt_lower_bound[row];
+      const size_type *const first_after_diagonal = this->prebuilt_lower_bound[row];
 
       const somenumber dst_row = dst (row);
       const number *luval = this->SparseMatrix<number>::val +
                             (first_after_diagonal - column_numbers);
-      for (const unsigned int *col=first_after_diagonal; col!=rowend; ++col, ++luval)
+      for (const size_type *col=first_after_diagonal; col!=rowend; ++col, ++luval)
         tmp(*col) += *luval * dst_row;
     }
 
@@ -285,15 +291,15 @@ void SparseILU<number>::Tvmult (Vector<somenumber>       &dst,
 
       // get start of this row. skip the
       // diagonal element
-      const unsigned int *const rowstart = &column_numbers[rowstart_indices[row]+1];
+      const size_type *const rowstart = &column_numbers[rowstart_indices[row]+1];
       // find the position where the part
       // right of the diagonal starts
-      const unsigned int *const first_after_diagonal = this->prebuilt_lower_bound[row];
+      const size_type *const first_after_diagonal = this->prebuilt_lower_bound[row];
 
       const somenumber dst_row = dst (row);
       const number *luval = this->SparseMatrix<number>::val +
                             (rowstart - column_numbers);
-      for (const unsigned int *col=rowstart; col!=first_after_diagonal; ++col, ++luval)
+      for (const size_type *col=rowstart; col!=first_after_diagonal; ++col, ++luval)
         tmp(*col) += *luval * dst_row;
     }
 }
index 1eacd52948841ae410d2e8faf288d0e1c89ad014..79b71911acb1d0dc8cc56f5a34b5cdae54b84b2b 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_matrix_h
 #define __deal2__sparse_matrix_h
 
@@ -19,6 +24,8 @@
 #include <deal.II/lac/sparsity_pattern.h>
 #include <deal.II/lac/identity_matrix.h>
 #include <deal.II/lac/exceptions.h>
+// Included for VectorOperation
+#include <deal.II/lac/vector.h>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -27,7 +34,6 @@ template <typename number> class FullMatrix;
 template <typename Matrix> class BlockMatrixBase;
 template <typename number> class SparseILU;
 
-
 #ifdef DEAL_II_WITH_TRILINOS
 namespace TrilinosWrappers
 {
@@ -46,6 +52,11 @@ namespace TrilinosWrappers
  */
 namespace SparseMatrixIterators
 {
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   // forward declaration
   template <typename number, bool Constness>
   class Iterator;
@@ -105,9 +116,9 @@ namespace SparseMatrixIterators
      * @deprecated This constructor is deprecated. Use the other constructor
      * with a global index instead.
      */
-    Accessor (MatrixType         *matrix,
-              const unsigned int  row,
-              const unsigned int  index) DEAL_II_DEPRECATED;
+    Accessor (MatrixType     *matrix,
+              const size_type row,
+              const size_type index) DEAL_II_DEPRECATED;
 
     /**
      * Constructor.
@@ -247,9 +258,9 @@ namespace SparseMatrixIterators
     /**
      * Constructor.
      */
-    Accessor (MatrixType         *matrix,
-              const unsigned int  row,
-              const unsigned int  index);
+    Accessor (MatrixType     *matrix,
+              const size_type row,
+              const size_type index);
 
     /**
      * Constructor.
@@ -353,9 +364,9 @@ namespace SparseMatrixIterators
      * @deprecated This constructor is deprecated. Use the other constructor
      * with a global index instead.
      */
-    Iterator (MatrixType        *matrix,
-              const unsigned int row,
-              const unsigned int index) DEAL_II_DEPRECATED;
+    Iterator (MatrixType     *matrix,
+              const size_type row,
+              const size_type index) DEAL_II_DEPRECATED;
 
     /**
      * Constructor. Create an iterator into the matrix @p matrix for the given
@@ -431,7 +442,7 @@ namespace SparseMatrixIterators
     /**
      * Return an iterator that is @p n ahead of the current one.
      */
-    Iterator operator + (const unsigned int n) const;
+    Iterator operator + (const size_type n) const;
 
   private:
     /**
@@ -470,13 +481,19 @@ namespace SparseMatrixIterators
  * @<double@></tt>; others can be generated in application programs (see the
  * section on @ref Instantiations in the manual).
  *
+ * @ingroup Matrix1
  * @author Essentially everyone who has ever worked on deal.II
- * @date 1994-2010
+ * @date 1994-2013
  */
 template <typename number>
 class SparseMatrix : public virtual Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Type of matrix entries. In analogy to the STL container classes.
    */
@@ -650,25 +667,25 @@ public:
    * Return the dimension of the image space. To remember: the matrix is of
    * dimension $m \times n$.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Return the dimension of the range space. To remember: the matrix is of
    * dimension $m \times n$.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Return the number of entries in a specific row.
    */
-  unsigned int get_row_length (const unsigned int row) const;
+  size_type get_row_length (const size_type row) const;
 
   /**
    * Return the number of nonzero elements of this matrix. Actually, it
    * returns the number of entries in the sparsity pattern; if any of the
    * entries should happen to be zero, it is counted anyway.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return the number of actually nonzero elements of this matrix. It is
@@ -679,7 +696,7 @@ public:
    * count all entries of the sparsity pattern but only the ones that are
    * nonzero (or whose absolute value is greater than threshold).
    */
-  unsigned int n_actually_nonzero_elements (const double threshold = 0.) const;
+  size_type n_actually_nonzero_elements (const double threshold = 0.) const;
 
   /**
    * Return a (constant) reference to the underlying sparsity pattern of this
@@ -697,6 +714,11 @@ public:
    */
   std::size_t memory_consumption () const;
 
+  /**
+   * Dummy function for compatibility with distributed, parallel matrices.
+   */
+  void compress (::dealii::VectorOperation::values);
+
 //@}
   /**
    * @name Modifying entries
@@ -707,8 +729,8 @@ public:
    * entry does not exist or if <tt>value</tt> is not a finite number. Still,
    * it is allowed to store zero values in non-existent fields.
    */
-  void set (const unsigned int i,
-            const unsigned int j,
+  void set (const size_type i,
+            const size_type j,
             const number value);
 
   /**
@@ -727,7 +749,7 @@ public:
    * treated.
    */
   template <typename number2>
-  void set (const std::vector<unsigned int> &indices,
+  void set (const std::vector<size_type> &indices,
             const FullMatrix<number2>       &full_matrix,
             const bool                       elide_zero_values = false);
 
@@ -737,10 +759,10 @@ public:
    * and columns, respectively.
    */
   template <typename number2>
-  void set (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
-            const FullMatrix<number2>       &full_matrix,
-            const bool                       elide_zero_values = false);
+  void set (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
+            const FullMatrix<number2>    &full_matrix,
+            const bool                    elide_zero_values = false);
 
   /**
    * Set several elements in the specified row of the matrix with column
@@ -753,10 +775,10 @@ public:
    * treated.
    */
   template <typename number2>
-  void set (const unsigned int               row,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number2>      &values,
-            const bool                       elide_zero_values = false);
+  void set (const size_type               row,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number2>   &values,
+            const bool                    elide_zero_values = false);
 
   /**
    * Set several elements to values given by <tt>values</tt> in a given row in
@@ -768,19 +790,19 @@ public:
    * inserted/replaced.
    */
   template <typename number2>
-  void set (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number2      *values,
-            const bool          elide_zero_values = false);
+  void set (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number2   *values,
+            const bool       elide_zero_values = false);
 
   /**
    * Add <tt>value</tt> to the element (<i>i,j</i>).  Throws an error if the
    * entry does not exist or if <tt>value</tt> is not a finite number. Still,
    * it is allowed to store zero values in non-existent fields.
    */
-  void add (const unsigned int i,
-            const unsigned int j,
+  void add (const size_type i,
+            const size_type j,
             const number value);
 
   /**
@@ -798,9 +820,9 @@ public:
    * i.e., zero values won't be added into the matrix.
    */
   template <typename number2>
-  void add (const std::vector<unsigned int> &indices,
-            const FullMatrix<number2>       &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &indices,
+            const FullMatrix<number2>    &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Same function as before, but now including the possibility to use
@@ -808,10 +830,10 @@ public:
    * and columns, respectively.
    */
   template <typename number2>
-  void add (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
-            const FullMatrix<number2>       &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
+            const FullMatrix<number2>    &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Set several elements in the specified row of the matrix with column
@@ -823,10 +845,10 @@ public:
    * i.e., zero values won't be added into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int               row,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number2>      &values,
-            const bool                       elide_zero_values = true);
+  void add (const size_type               row,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number2>   &values,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add an array of values given by <tt>values</tt> in the given global
@@ -838,12 +860,12 @@ public:
    * i.e., zero values won't be added into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number2      *values,
-            const bool          elide_zero_values = true,
-            const bool          col_indices_are_sorted = false);
+  void add (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number2   *values,
+            const bool       elide_zero_values = true,
+            const bool       col_indices_are_sorted = false);
 
   /**
    * Multiply the entire matrix by a fixed factor.
@@ -927,7 +949,7 @@ public:
   SparseMatrix<number> &
   copy_from (const TrilinosWrappers::SparseMatrix &matrix);
 #endif
-  
+
   /**
    * Add <tt>matrix</tt> scaled by <tt>factor</tt> to this matrix, i.e. the
    * matrix <tt>factor*matrix</tt> is added to <tt>this</tt>. This function
@@ -962,8 +984,8 @@ public:
    * classes instead, since they are tailored better to a sparse matrix
    * structure.
    */
-  number operator () (const unsigned int i,
-                      const unsigned int j) const;
+  number operator () (const size_type i,
+                      const size_type j) const;
 
   /**
    * This function is mostly like operator()() in that it returns the value of
@@ -977,8 +999,8 @@ public:
    * classes instead, since they are tailored better to a sparse matrix
    * structure.
    */
-  number el (const unsigned int i,
-             const unsigned int j) const;
+  number el (const size_type i,
+             const size_type j) const;
 
   /**
    * Return the main diagonal element in the <i>i</i>th row. This function
@@ -990,13 +1012,13 @@ public:
    * each row and access therefore does not involve searching for the right
    * column number.
    */
-  number diag_element (const unsigned int i) const;
+  number diag_element (const size_type i) const;
 
   /**
    * Same as above, but return a writeable reference. You're sure you know
    * what you do?
    */
-  number &diag_element (const unsigned int i);
+  number &diag_element (const size_type i);
 
   /**
    * Access to values in internal mode.  Returns the value of the
@@ -1006,8 +1028,8 @@ public:
    *
    * @deprecated Use iterator or const_iterator instead!
    */
-  number raw_entry (const unsigned int row,
-                    const unsigned int index) const DEAL_II_DEPRECATED;
+  number raw_entry (const size_type row,
+                    const size_type index) const DEAL_II_DEPRECATED;
 
   /**
    * This is for hackers. Get access to the <i>i</i>th element of this
@@ -1022,14 +1044,14 @@ public:
    *
    * @internal @deprecated Use iterator or const_iterator instead!
    */
-  number global_entry (const unsigned int i) const DEAL_II_DEPRECATED;
+  number global_entry (const size_type i) const DEAL_II_DEPRECATED;
 
   /**
    * Same as above, but with write access.  You certainly know what you do?
    *
    * @internal @deprecated Use iterator or const_iterator instead!
    */
-  number &global_entry (const unsigned int i) DEAL_II_DEPRECATED;
+  number &global_entry (const size_type i) DEAL_II_DEPRECATED;
 
 //@}
   /**
@@ -1313,8 +1335,8 @@ public:
    */
   template <typename somenumber>
   void PSOR (Vector<somenumber> &v,
-             const std::vector<unsigned int> &permutation,
-             const std::vector<unsigned int> &inverse_permutation,
+             const std::vector<size_type> &permutation,
+             const std::vector<size_type> &inverse_permutation,
              const number        om = 1.) const;
 
   /**
@@ -1329,8 +1351,8 @@ public:
    */
   template <typename somenumber>
   void TPSOR (Vector<somenumber> &v,
-              const std::vector<unsigned int> &permutation,
-              const std::vector<unsigned int> &inverse_permutation,
+              const std::vector<size_type> &permutation,
+              const std::vector<size_type> &inverse_permutation,
               const number        om = 1.) const;
 
   /**
@@ -1415,7 +1437,7 @@ public:
    * Note also the discussion in the general documentation of this class about
    * the order in which elements are accessed.
    */
-  const_iterator begin (const unsigned int r) const;
+  const_iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row <tt>r</tt>. It points to the first element past the
@@ -1426,7 +1448,7 @@ public:
    * particular the case if it is the end iterator for the last row of a
    * matrix.
    */
-  const_iterator end (const unsigned int r) const;
+  const_iterator end (const size_type r) const;
 
   /**
    * STL-like iterator with the first entry of row <tt>r</tt>. This is the
@@ -1440,7 +1462,7 @@ public:
    * Note the discussion in the general documentation of this class about
    * the order in which elements are accessed.
    */
-  iterator begin (const unsigned int r);
+  iterator begin (const size_type r);
 
   /**
    * Final iterator of row <tt>r</tt>. It points to the first element past the
@@ -1451,7 +1473,7 @@ public:
    * particular the case if it is the end iterator for the last row of a
    * matrix.
    */
-  iterator end (const unsigned int r);
+  iterator end (const size_type r);
 //@}
   /**
    * @name Input/Output
@@ -1459,13 +1481,18 @@ public:
 //@{
 
   /**
-   * Print the matrix to the given stream, using the format <tt>(row,column)
-   * value</tt>, i.e. one nonzero entry of the matrix per line. If @p across
-   * is true, print all entries on a single line, using the format
-   * row,column:value
+   * Print the matrix to the given stream, using the format
+   * <tt>(row,column) value</tt>, i.e. one nonzero entry of the matrix
+   * per line. If <tt>across</tt> is true, print all entries on a
+   * single line, using the format row,column:value.
+   *
+   * If the argument <tt>diagonal_first</tt> is true, diagonal
+   * elements of quadratic matrices are printed first in their row,
+   * corresponding to the internal storage scheme. If it is false, the
+   * elements in a row are written in ascending column order.
    */
   template <class STREAM>
-  void print (STREAM &out, bool across=false) const;
+  void print (STREAM &out, bool across=false, bool diagonal_first=true) const;
 
   /**
    * Print the matrix in the usual format, i.e. as a matrix and not as a list
@@ -1637,7 +1664,7 @@ private:
 
 template <typename number>
 inline
-unsigned int SparseMatrix<number>::m () const
+typename SparseMatrix<number>::size_type SparseMatrix<number>::m () const
 {
   Assert (cols != 0, ExcNotInitialized());
   return cols->rows;
@@ -1646,7 +1673,7 @@ unsigned int SparseMatrix<number>::m () const
 
 template <typename number>
 inline
-unsigned int SparseMatrix<number>::n () const
+typename SparseMatrix<number>::size_type SparseMatrix<number>::n () const
 {
   Assert (cols != 0, ExcNotInitialized());
   return cols->cols;
@@ -1657,13 +1684,13 @@ unsigned int SparseMatrix<number>::n () const
 template <typename number>
 inline
 void
-SparseMatrix<number>::set (const unsigned int i,
-                           const unsigned int j,
+SparseMatrix<number>::set (const size_type i,
+                           const size_type j,
                            const number       value)
 {
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
-  const unsigned int index = cols->operator()(i, j);
+  const size_type index = cols->operator()(i, j);
 
   // it is allowed to set elements of the matrix that are not part of the
   // sparsity pattern, if the value to which we set it is zero
@@ -1684,15 +1711,15 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::set (const std::vector<unsigned int> &indices,
-                           const FullMatrix<number2>       &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::set (const std::vector<size_type> &indices,
+                           const FullMatrix<number2>    &values,
+                           const bool                    elide_zero_values)
 {
   Assert (indices.size() == values.m(),
           ExcDimensionMismatch(indices.size(), values.m()));
   Assert (values.m() == values.n(), ExcNotQuadratic());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     set (indices[i], indices.size(), &indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1703,17 +1730,17 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::set (const std::vector<unsigned int> &row_indices,
-                           const std::vector<unsigned int> &col_indices,
-                           const FullMatrix<number2>       &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::set (const std::vector<size_type> &row_indices,
+                           const std::vector<size_type> &col_indices,
+                           const FullMatrix<number2>    &values,
+                           const bool                    elide_zero_values)
 {
   Assert (row_indices.size() == values.m(),
           ExcDimensionMismatch(row_indices.size(), values.m()));
   Assert (col_indices.size() == values.n(),
           ExcDimensionMismatch(col_indices.size(), values.n()));
 
-  for (unsigned int i=0; i<row_indices.size(); ++i)
+  for (size_type i=0; i<row_indices.size(); ++i)
     set (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1724,10 +1751,10 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::set (const unsigned int               row,
-                           const std::vector<unsigned int> &col_indices,
-                           const std::vector<number2>      &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::set (const size_type               row,
+                           const std::vector<size_type> &col_indices,
+                           const std::vector<number2>   &values,
+                           const bool                    elide_zero_values)
 {
   Assert (col_indices.size() == values.size(),
           ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1741,16 +1768,16 @@ SparseMatrix<number>::set (const unsigned int               row,
 template <typename number>
 inline
 void
-SparseMatrix<number>::add (const unsigned int i,
-                           const unsigned int j,
-                           const number       value)
+SparseMatrix<number>::add (const size_type i,
+                           const size_type j,
+                           const number    value)
 {
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
   if (value == 0)
     return;
 
-  const unsigned int index = cols->operator()(i, j);
+  const size_type index = cols->operator()(i, j);
 
   // it is allowed to add elements to the matrix that are not part of the
   // sparsity pattern, if the value to which we set it is zero
@@ -1771,15 +1798,15 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::add (const std::vector<unsigned int> &indices,
-                           const FullMatrix<number2>       &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::add (const std::vector<size_type> &indices,
+                           const FullMatrix<number2>    &values,
+                           const bool                    elide_zero_values)
 {
   Assert (indices.size() == values.m(),
           ExcDimensionMismatch(indices.size(), values.m()));
   Assert (values.m() == values.n(), ExcNotQuadratic());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     add (indices[i], indices.size(), &indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1790,17 +1817,17 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::add (const std::vector<unsigned int> &row_indices,
-                           const std::vector<unsigned int> &col_indices,
-                           const FullMatrix<number2>       &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::add (const std::vector<size_type> &row_indices,
+                           const std::vector<size_type> &col_indices,
+                           const FullMatrix<number2>    &values,
+                           const bool                    elide_zero_values)
 {
   Assert (row_indices.size() == values.m(),
           ExcDimensionMismatch(row_indices.size(), values.m()));
   Assert (col_indices.size() == values.n(),
           ExcDimensionMismatch(col_indices.size(), values.n()));
 
-  for (unsigned int i=0; i<row_indices.size(); ++i)
+  for (size_type i=0; i<row_indices.size(); ++i)
     add (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1811,10 +1838,10 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::add (const unsigned int               row,
-                           const std::vector<unsigned int> &col_indices,
-                           const std::vector<number2>      &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::add (const size_type               row,
+                           const std::vector<size_type> &col_indices,
+                           const std::vector<number2>   &values,
+                           const bool                    elide_zero_values)
 {
   Assert (col_indices.size() == values.size(),
           ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1868,8 +1895,8 @@ SparseMatrix<number>::operator /= (const number factor)
 
 template <typename number>
 inline
-number SparseMatrix<number>::operator () (const unsigned int i,
-                                          const unsigned int j) const
+number SparseMatrix<number>::operator () (const size_type i,
+                                          const size_type j) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (cols->operator()(i,j) != SparsityPattern::invalid_entry,
@@ -1881,11 +1908,11 @@ number SparseMatrix<number>::operator () (const unsigned int i,
 
 template <typename number>
 inline
-number SparseMatrix<number>::el (const unsigned int i,
-                                 const unsigned int j) const
+number SparseMatrix<number>::el (const size_type i,
+                                 const size_type j) const
 {
   Assert (cols != 0, ExcNotInitialized());
-  const unsigned int index = cols->operator()(i,j);
+  const size_type index = cols->operator()(i,j);
 
   if (index != SparsityPattern::invalid_entry)
     return val[index];
@@ -1897,7 +1924,7 @@ number SparseMatrix<number>::el (const unsigned int i,
 
 template <typename number>
 inline
-number SparseMatrix<number>::diag_element (const unsigned int i) const
+number SparseMatrix<number>::diag_element (const size_type i) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (m() == n(),  ExcNotQuadratic());
@@ -1912,7 +1939,7 @@ number SparseMatrix<number>::diag_element (const unsigned int i) const
 
 template <typename number>
 inline
-number &SparseMatrix<number>::diag_element (const unsigned int i)
+number &SparseMatrix<number>::diag_element (const size_type i)
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (m() == n(),  ExcNotQuadratic());
@@ -1928,8 +1955,8 @@ number &SparseMatrix<number>::diag_element (const unsigned int i)
 template <typename number>
 inline
 number
-SparseMatrix<number>::raw_entry (const unsigned int row,
-                                 const unsigned int index) const
+SparseMatrix<number>::raw_entry (const size_type row,
+                                 const size_type index) const
 {
   Assert(row<cols->rows, ExcIndexRange(row,0,cols->rows));
   Assert(index<cols->row_length(row),
@@ -1943,7 +1970,7 @@ SparseMatrix<number>::raw_entry (const unsigned int row,
 
 template <typename number>
 inline
-number SparseMatrix<number>::global_entry (const unsigned int j) const
+number SparseMatrix<number>::global_entry (const size_type j) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (j < cols->n_nonzero_elements(),
@@ -1956,7 +1983,7 @@ number SparseMatrix<number>::global_entry (const unsigned int j) const
 
 template <typename number>
 inline
-number &SparseMatrix<number>::global_entry (const unsigned int j)
+number &SparseMatrix<number>::global_entry (const size_type j)
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (j < cols->n_nonzero_elements(),
@@ -1973,13 +2000,13 @@ void
 SparseMatrix<number>::copy_from (const ForwardIterator begin,
                                  const ForwardIterator end)
 {
-  Assert (static_cast<unsigned int>(std::distance (begin, end)) == m(),
+  Assert (static_cast<size_type>(std::distance (begin, end)) == m(),
           ExcIteratorRange (std::distance (begin, end), m()));
 
   // for use in the inner loop, we define a typedef to the type of the inner
   // iterators
   typedef typename std::iterator_traits<ForwardIterator>::value_type::const_iterator inner_iterator;
-  unsigned int row=0;
+  size_type row=0;
   for (ForwardIterator i=begin; i!=end; ++i, ++row)
     {
       const inner_iterator end_of_row = i->end();
@@ -1998,9 +2025,9 @@ namespace SparseMatrixIterators
   template <typename number>
   inline
   Accessor<number,true>::
-  Accessor (const MatrixType   *matrix,
-            const unsigned int  row,
-            const unsigned int  index)
+  Accessor (const MatrixType *matrix,
+            const size_type   row,
+            const size_type   index)
     :
     SparsityPatternIterators::Accessor (&matrix->get_sparsity_pattern(),
                                         row, index),
@@ -2148,9 +2175,9 @@ namespace SparseMatrixIterators
   template <typename number>
   inline
   Accessor<number,false>::
-  Accessor (MatrixType         *matrix,
-            const unsigned int  row,
-            const unsigned int  index)
+  Accessor (MatrixType      *matrix,
+            const size_type  row,
+            const size_type  index)
     :
     SparsityPatternIterators::Accessor (&matrix->get_sparsity_pattern(),
                                         row, index),
@@ -2207,9 +2234,9 @@ namespace SparseMatrixIterators
   template <typename number, bool Constness>
   inline
   Iterator<number, Constness>::
-  Iterator (MatrixType        *matrix,
-            const unsigned int r,
-            const unsigned int i)
+  Iterator (MatrixType      *matrix,
+            const size_type  r,
+            const size_type  i)
     :
     accessor(matrix, r, i)
   {}
@@ -2347,10 +2374,10 @@ namespace SparseMatrixIterators
   inline
   Iterator<number,Constness>
   Iterator<number,Constness>::
-  operator + (const unsigned int n) const
+  operator + (const size_type n) const
   {
     Iterator x = *this;
-    for (unsigned int i=0; i<n; ++i)
+    for (size_type i=0; i<n; ++i)
       ++x;
 
     return x;
@@ -2399,7 +2426,7 @@ SparseMatrix<number>::end ()
 template <typename number>
 inline
 typename SparseMatrix<number>::const_iterator
-SparseMatrix<number>::begin (const unsigned int r) const
+SparseMatrix<number>::begin (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
 
@@ -2411,7 +2438,7 @@ SparseMatrix<number>::begin (const unsigned int r) const
 template <typename number>
 inline
 typename SparseMatrix<number>::const_iterator
-SparseMatrix<number>::end (const unsigned int r) const
+SparseMatrix<number>::end (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
 
@@ -2423,7 +2450,7 @@ SparseMatrix<number>::end (const unsigned int r) const
 template <typename number>
 inline
 typename SparseMatrix<number>::iterator
-SparseMatrix<number>::begin (const unsigned int r)
+SparseMatrix<number>::begin (const size_type r)
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
 
@@ -2435,7 +2462,7 @@ SparseMatrix<number>::begin (const unsigned int r)
 template <typename number>
 inline
 typename SparseMatrix<number>::iterator
-SparseMatrix<number>::end (const unsigned int r)
+SparseMatrix<number>::end (const size_type r)
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
 
@@ -2447,22 +2474,50 @@ SparseMatrix<number>::end (const unsigned int r)
 template <typename number>
 template <class STREAM>
 inline
-void SparseMatrix<number>::print (STREAM &out, bool across) const
+void SparseMatrix<number>::print (STREAM &out, bool across, bool diagonal_first) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (val != 0, ExcNotInitialized());
 
-  if (across)
+  bool hanging_diagonal = false;
+  number diagonal;
+
+  for (size_type i=0; i<cols->rows; ++i)
     {
-      for (unsigned int i=0; i<cols->rows; ++i)
-        for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
-          out << ' ' << i << ',' << cols->colnums[j] << ':' << val[j];
-      out << std::endl;
+      for (size_type j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
+        {
+          if (!diagonal_first && i == cols->colnums[j])
+            {
+              diagonal = val[j];
+              hanging_diagonal = true;
+            }
+          else
+            {
+              if (hanging_diagonal && cols->colnums[j]>i)
+                {
+                  if (across)
+                    out << ' ' << i << ',' << i << ':' << diagonal;
+                  else
+                    out << '(' << i << ',' << i << ") " << diagonal << std::endl;
+                  hanging_diagonal = false;
+                }
+              if (across)
+                out << ' ' << i << ',' << cols->colnums[j] << ':' << val[j];
+              else
+                out << "(" << i << "," << cols->colnums[j] << ") " << val[j] << std::endl;
+            }
+        }
+      if (hanging_diagonal)
+        {
+          if (across)
+            out << ' ' << i << ',' << i << ':' << diagonal;
+          else
+            out << '(' << i << ',' << i << ") " << diagonal << std::endl;
+          hanging_diagonal = false;
+        }
     }
-  else
-    for (unsigned int i=0; i<cols->rows; ++i)
-      for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
-        out << "(" << i << "," << cols->colnums[j] << ") " << val[j] << std::endl;
+  if (across)
+    out << std::endl;
 }
 
 
index ce97bbcaeee535bfed9abd0a126745c108b0734f..e0075798336e375dda1cd70634a1105e7fa389cf 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__sparse_matrix_templates_h
 #define __deal2__sparse_matrix_templates_h
@@ -103,7 +108,7 @@ SparseMatrix<number>::SparseMatrix (const SparsityPattern &c,
   Assert (c.n_cols() == id.n(), ExcDimensionMismatch (c.n_cols(), id.n()));
 
   reinit (c);
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     this->set(i,i,1.);
 }
 
@@ -124,9 +129,11 @@ namespace internal
 {
   namespace SparseMatrix
   {
+    typedef types::global_dof_index size_type;
+
     template<typename T>
-    void zero_subrange (const unsigned int begin,
-                        const unsigned int end,
+    void zero_subrange (const size_type begin,
+                        const size_type end,
                         T *dst)
     {
       std::memset (dst+begin,0,(end-begin)*sizeof(T));
@@ -152,8 +159,8 @@ SparseMatrix<number>::operator = (const double d)
   // operator=. The grain size is chosen to reflect the number of rows in
   // minimum_parallel_grain_size, weighted by the number of nonzero entries
   // per row on average.
-  const unsigned int matrix_size = cols->n_nonzero_elements();
-  const unsigned int grain_size =
+  const size_type matrix_size = cols->n_nonzero_elements();
+  const size_type grain_size =
     internal::SparseMatrix::minimum_parallel_grain_size *
     (cols->n_nonzero_elements()+m()) / m();
   if (matrix_size>grain_size)
@@ -181,7 +188,7 @@ SparseMatrix<number>::operator= (const IdentityMatrix  &id)
           ExcDimensionMismatch (cols->n_cols(), id.n()));
 
   *this = 0;
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     this->set(i,i,1.);
 
   return *this;
@@ -243,8 +250,8 @@ SparseMatrix<number>::empty () const
 
 
 template <typename number>
-unsigned int
-SparseMatrix<number>::get_row_length (const unsigned int row) const
+typename SparseMatrix<number>::size_type
+SparseMatrix<number>::get_row_length (const size_type row) const
 {
   Assert (cols != 0, ExcNotInitialized());
   return cols->row_length(row);
@@ -253,7 +260,7 @@ SparseMatrix<number>::get_row_length (const unsigned int row) const
 
 
 template <typename number>
-unsigned int
+typename SparseMatrix<number>::size_type
 SparseMatrix<number>::n_nonzero_elements () const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -263,14 +270,14 @@ SparseMatrix<number>::n_nonzero_elements () const
 
 
 template <typename number>
-unsigned int
+typename SparseMatrix<number>::size_type
 SparseMatrix<number>::n_actually_nonzero_elements (const double threshold) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (threshold >= 0, ExcMessage ("Negative threshold!"));
-  unsigned int nnz = 0;
-  const unsigned int nnz_alloc = n_nonzero_elements();
-  for (unsigned int i=0; i<nnz_alloc; ++i)
+  size_type nnz = 0;
+  const size_type nnz_alloc = n_nonzero_elements();
+  for (size_type i=0; i<nnz_alloc; ++i)
     if (std::fabs(val[i]) > threshold)
       ++nnz;
   return nnz;
@@ -285,15 +292,15 @@ SparseMatrix<number>::symmetrize ()
   Assert (cols != 0, ExcNotInitialized());
   Assert (cols->rows == cols->cols, ExcNotQuadratic());
 
-  const unsigned int n_rows = m();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = m();
+  for (size_type row=0; row<n_rows; ++row)
     {
       // first skip diagonal entry
       number             *val_ptr = &val[cols->rowstart[row]];
       if (m() == n())
         ++val_ptr;
-      const unsigned int *colnum_ptr = &cols->colnums[cols->rowstart[row]+1];
-      const number       *const val_end_of_row = &val[cols->rowstart[row+1]];
+      const size_type *colnum_ptr = &cols->colnums[cols->rowstart[row]+1];
+      const number    *const val_end_of_row = &val[cols->rowstart[row+1]];
 
       // treat lower left triangle
       while ((val_ptr != val_end_of_row) && (*colnum_ptr<row))
@@ -343,8 +350,8 @@ SparseMatrix<number>::copy_from (const FullMatrix<somenumber> &matrix)
   *this = 0;
 
   // then copy old matrix
-  for (unsigned int row=0; row<matrix.m(); ++row)
-    for (unsigned int col=0; col<matrix.n(); ++col)
+  for (size_type row=0; row<matrix.m(); ++row)
+    for (size_type col=0; col<matrix.n(); ++col)
       if (matrix(row,col) != 0)
         set (row, col, matrix(row,col));
 }
@@ -359,14 +366,14 @@ SparseMatrix<number>::copy_from (const TrilinosWrappers::SparseMatrix &matrix)
 {
   Assert (m() == matrix.m(), ExcDimensionMismatch(m(), matrix.m()));
   Assert (n() == matrix.n(), ExcDimensionMismatch(n(), matrix.n()));
-  
+
   // first delete previous content
   *this = 0;
 
   std::vector < TrilinosScalar > value_cache;
-  std::vector<unsigned int> colnum_cache;
+  std::vector<size_type> colnum_cache;
 
-  for (unsigned int row = 0; row < matrix.m(); ++row)
+  for (size_type row = 0; row < matrix.m(); ++row)
     {
       value_cache.resize(matrix.n());
       colnum_cache.resize(matrix.n());
@@ -375,10 +382,10 @@ SparseMatrix<number>::copy_from (const TrilinosWrappers::SparseMatrix &matrix)
       // length of the row
       int ncols;
       int ierr
-       = matrix.trilinos_matrix().ExtractGlobalRowCopy
-       (row, matrix.row_length(row), ncols,
-        &(value_cache[0]),
-        reinterpret_cast<int*>(&(colnum_cache[0])));
+        = matrix.trilinos_matrix().ExtractGlobalRowCopy
+          (row, matrix.row_length(row), ncols,
+           &(value_cache[0]),
+           reinterpret_cast<TrilinosWrappers::types::int_type *>(&(colnum_cache[0])));
       Assert (ierr==0, ExcTrilinosError(ierr));
 
       // resize arrays to the size actually used
@@ -387,8 +394,8 @@ SparseMatrix<number>::copy_from (const TrilinosWrappers::SparseMatrix &matrix)
 
       // then copy everything in one swoop
       this->set(row,
-               colnum_cache,
-               value_cache);
+                colnum_cache,
+                value_cache);
     }
 
   return *this;
@@ -412,7 +419,7 @@ SparseMatrix<number>::add (const number factor,
   const number *const end_ptr    = &val[cols->n_nonzero_elements()];
 
   while (val_ptr != end_ptr)
-    *val_ptr++ += factor * *matrix_ptr++;
+    *val_ptr++ += factor **matrix_ptr++;
 }
 
 
@@ -432,21 +439,21 @@ namespace internal
     template <typename number,
              typename InVector,
              typename OutVector>
-    void vmult_on_subrange (const unsigned int  begin_row,
-                            const unsigned int  end_row,
-                            const number       *values,
+    void vmult_on_subrange (const size_type    begin_row,
+                            const size_type    end_row,
+                            const number      *values,
                             const std::size_t  *rowstart,
-                            const unsigned int *colnums,
-                            const InVector     &src,
-                            OutVector          &dst,
-                            const bool          add)
+                            const size_type   *colnums,
+                            const InVector    &src,
+                            OutVector         &dst,
+                            const bool         add)
     {
-      const number       *val_ptr    = &values[rowstart[begin_row]];
-      const unsigned int *colnum_ptr = &colnums[rowstart[begin_row]];
+      const number    *val_ptr    = &values[rowstart[begin_row]];
+      const size_type *colnum_ptr = &colnums[rowstart[begin_row]];
       typename OutVector::iterator dst_ptr = dst.begin() + begin_row;
 
       if (add == false)
-        for (unsigned int row=begin_row; row<end_row; ++row)
+        for (size_type row=begin_row; row<end_row; ++row)
           {
             typename OutVector::value_type s = 0.;
             const number *const val_end_of_row = &values[rowstart[row+1]];
@@ -455,7 +462,7 @@ namespace internal
             *dst_ptr++ = s;
           }
       else
-        for (unsigned int row=begin_row; row<end_row; ++row)
+        for (size_type row=begin_row; row<end_row; ++row)
           {
             typename OutVector::value_type s = *dst_ptr;
             const number *const val_end_of_row = &values[rowstart[row+1]];
@@ -471,12 +478,12 @@ namespace internal
 template <typename number>
 template <typename number2>
 void
-SparseMatrix<number>::add (const unsigned int  row,
-                           const unsigned int  n_cols,
-                           const unsigned int *col_indices,
-                           const number2      *values,
-                           const bool          elide_zero_values,
-                           const bool          col_indices_are_sorted)
+SparseMatrix<number>::add (const size_type  row,
+                           const size_type  n_cols,
+                           const size_type *col_indices,
+                           const number2   *values,
+                           const bool       elide_zero_values,
+                           const bool       col_indices_are_sorted)
 {
   Assert (cols != 0, ExcNotInitialized());
 
@@ -491,14 +498,14 @@ SparseMatrix<number>::add (const unsigned int  row,
       // check whether the given indices are
       // really sorted
 #ifdef DEBUG
-      for (unsigned int i=1; i<n_cols; ++i)
+      for (size_type i=1; i<n_cols; ++i)
         Assert (col_indices[i] > col_indices[i-1],
                 ExcMessage("List of indices is unsorted or contains duplicates."));
 #endif
 
-      const unsigned int *this_cols =
+      const size_type *this_cols =
         &cols->colnums[cols->rowstart[row]];
-      const unsigned int row_length_1 = cols->row_length(row)-1;
+      const size_type row_length_1 = cols->row_length(row)-1;
       number *val_ptr = &val[cols->rowstart[row]];
 
       if (m() == n())
@@ -506,12 +513,12 @@ SparseMatrix<number>::add (const unsigned int  row,
 
           // find diagonal and add it if found
           Assert (this_cols[0] == row, ExcInternalError());
-          const unsigned int *diag_pos =
+          const size_type *diag_pos =
             Utilities::lower_bound (col_indices,
                                     col_indices+n_cols,
                                     row);
-          const unsigned int diag = diag_pos - col_indices;
-          unsigned int post_diag = diag;
+          const size_type diag = diag_pos - col_indices;
+          size_type post_diag = diag;
           if (diag != n_cols && *diag_pos == row)
             {
               val_ptr[0] += *(values+(diag_pos-col_indices));
@@ -519,8 +526,8 @@ SparseMatrix<number>::add (const unsigned int  row,
             }
 
           // add indices before diagonal
-          unsigned int counter = 1;
-          for (unsigned int i=0; i<diag; ++i)
+          size_type counter = 1;
+          for (size_type i=0; i<diag; ++i)
             {
               while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                 ++counter;
@@ -532,7 +539,7 @@ SparseMatrix<number>::add (const unsigned int  row,
             }
 
           // add indices after diagonal
-          for (unsigned int i=post_diag; i<n_cols; ++i)
+          for (size_type i=post_diag; i<n_cols; ++i)
             {
               while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                 ++counter;
@@ -548,8 +555,8 @@ SparseMatrix<number>::add (const unsigned int  row,
         }
       else
         {
-          unsigned int counter = 0;
-          for (unsigned int i=0; i<n_cols; ++i)
+          size_type counter = 0;
+          for (size_type i=0; i<n_cols; ++i)
             {
               while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                 ++counter;
@@ -568,11 +575,11 @@ SparseMatrix<number>::add (const unsigned int  row,
   // unsorted case: first, search all the
   // indices to find out which values we
   // actually need to add.
-  const unsigned int *const my_cols = cols->colnums;
-  unsigned int index = cols->rowstart[row];
-  const unsigned int next_row_index = cols->rowstart[row+1];
+  const size_type *const my_cols = cols->colnums;
+  size_type index = cols->rowstart[row];
+  const size_type next_row_index = cols->rowstart[row+1];
 
-  for (unsigned int j=0; j<n_cols; ++j)
+  for (size_type j=0; j<n_cols; ++j)
     {
       const number value = values[j];
       Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -615,11 +622,11 @@ add_value:
 template <typename number>
 template <typename number2>
 void
-SparseMatrix<number>::set (const unsigned int  row,
-                           const unsigned int  n_cols,
-                           const unsigned int *col_indices,
-                           const number2      *values,
-                           const bool          elide_zero_values)
+SparseMatrix<number>::set (const size_type  row,
+                           const size_type  n_cols,
+                           const size_type *col_indices,
+                           const number2   *values,
+                           const bool       elide_zero_values)
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (row < m(), ExcInvalidIndex1(row));
@@ -627,13 +634,13 @@ SparseMatrix<number>::set (const unsigned int  row,
   // First, search all the indices to find
   // out which values we actually need to
   // set.
-  const unsigned int *my_cols = cols->colnums;
+  const size_type *my_cols = cols->colnums;
   std::size_t index = cols->rowstart[row], next_index = index;
   const std::size_t next_row_index = cols->rowstart[row+1];
 
   if (elide_zero_values == true)
     {
-      for (unsigned int j=0; j<n_cols; ++j)
+      for (size_type j=0; j<n_cols; ++j)
         {
           const number value = values[j];
           Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -669,7 +676,7 @@ set_value:
   else
     {
       // same code as above, but now check for zeros
-      for (unsigned int j=0; j<n_cols; ++j)
+      for (size_type j=0; j<n_cols; ++j)
         {
           const number value = values[j];
           Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -738,11 +745,11 @@ SparseMatrix<number>::Tvmult (OutVector &dst,
 
   dst = 0;
 
-  for (unsigned int i=0; i<m(); i++)
+  for (size_type i=0; i<m(); i++)
     {
-      for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
+      for (size_type j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
         {
-          const unsigned int p = cols->colnums[j];
+          const size_type p = cols->colnums[j];
           dst(p) += val[j] * src(i);
         }
     }
@@ -791,10 +798,10 @@ SparseMatrix<number>::Tvmult_add (OutVector &dst,
 
   Assert (!PointerComparison::equal(&src, &dst), ExcSourceEqualsDestination());
 
-  for (unsigned int i=0; i<m(); i++)
-    for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
+  for (size_type i=0; i<m(); i++)
+    for (size_type j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
       {
-        const unsigned int p = cols->colnums[j];
+        const size_type p = cols->colnums[j];
         dst(p) += val[j] * src(i);
       }
 }
@@ -817,19 +824,19 @@ namespace internal
      */
     template <typename number,
              typename InVector>
-    number matrix_norm_sqr_on_subrange (const unsigned int  begin_row,
-                                        const unsigned int  end_row,
-                                        const number       *values,
+    number matrix_norm_sqr_on_subrange (const size_type    begin_row,
+                                        const size_type    end_row,
+                                        const number      *values,
                                         const std::size_t  *rowstart,
-                                        const unsigned int *colnums,
-                                        const InVector     &v)
+                                        const size_type   *colnums,
+                                        const InVector    &v)
     {
       number norm_sqr=0.;
 
-      for (unsigned int i=begin_row; i<end_row; ++i)
+      for (size_type i=begin_row; i<end_row; ++i)
         {
           number s = 0;
-          for (unsigned int j=rowstart[i]; j<rowstart[i+1] ; j++)
+          for (size_type j=rowstart[i]; j<rowstart[i+1] ; j++)
             s += values[j] * v(colnums[j]);
           norm_sqr += v(i)*numbers::NumberTraits<number>::conjugate(s);
         }
@@ -880,20 +887,20 @@ namespace internal
      */
     template <typename number,
              typename InVector>
-    number matrix_scalar_product_on_subrange (const unsigned int  begin_row,
-                                              const unsigned int  end_row,
-                                              const number       *values,
+    number matrix_scalar_product_on_subrange (const size_type    begin_row,
+                                              const size_type    end_row,
+                                              const number      *values,
                                               const std::size_t  *rowstart,
-                                              const unsigned int *colnums,
-                                              const InVector     &u,
-                                              const InVector     &v)
+                                              const size_type   *colnums,
+                                              const InVector    &u,
+                                              const InVector    &v)
     {
       number norm_sqr=0.;
 
-      for (unsigned int i=begin_row; i<end_row; ++i)
+      for (size_type i=begin_row; i<end_row; ++i)
         {
           number s = 0;
-          for (unsigned int j=rowstart[i]; j<rowstart[i+1] ; j++)
+          for (size_type j=rowstart[i]; j<rowstart[i+1] ; j++)
             s += values[j] * v(colnums[j]);
           norm_sqr += u(i)*numbers::NumberTraits<number>::conjugate(s);
         }
@@ -971,18 +978,18 @@ SparseMatrix<number>::mmult (SparseMatrix<numberC>       &C,
       // CompressedSimpleSparsityPattern class.
       {
         CompressedSimpleSparsityPattern csp (m(), B.n());
-        for (unsigned int i = 0; i < csp.n_rows(); ++i)
+        for (size_type i = 0; i < csp.n_rows(); ++i)
           {
-            const unsigned int *rows = &sp_A.colnums[sp_A.rowstart[i]];
-            const unsigned int *const end_rows =
+            const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]];
+            const size_type *const end_rows =
               &sp_A.colnums[sp_A.rowstart[i+1]];
             for (; rows != end_rows; ++rows)
               {
-                const unsigned int col = *rows;
-                unsigned int *new_cols = const_cast<unsigned int *>
-                                         (&sp_B.colnums[sp_B.rowstart[col]]);
-                unsigned int *end_new_cols = const_cast<unsigned int *>
-                                             (&sp_B.colnums[sp_B.rowstart[col+1]]);
+                const size_type col = *rows;
+                size_type *new_cols = const_cast<size_type *>
+                                      (&sp_B.colnums[sp_B.rowstart[col]]);
+                size_type *end_new_cols = const_cast<size_type *>
+                                          (&sp_B.colnums[sp_B.rowstart[col+1]]);
 
                 // if B has a diagonal, need to add that manually. this way,
                 // we maintain sortedness.
@@ -1009,7 +1016,7 @@ SparseMatrix<number>::mmult (SparseMatrix<numberC>       &C,
   // elements that are going to be written
   // into the new matrix.
   unsigned int max_n_cols_B = 0;
-  for (unsigned int i=0; i<B.m(); ++i)
+  for (size_type i=0; i<B.m(); ++i)
     max_n_cols_B = std::max (max_n_cols_B, sp_B.row_length(i));
   std::vector<numberC> new_entries(max_n_cols_B);
 
@@ -1017,15 +1024,15 @@ SparseMatrix<number>::mmult (SparseMatrix<numberC>       &C,
   // nested loops. One over the rows of A, for each row we then loop over all
   // the columns, and then we need to multiply each element with all the
   // elements in that row in B.
-  for (unsigned int i=0; i<C.m(); ++i)
+  for (size_type i=0; i<C.m(); ++i)
     {
-      const unsigned int *rows = &sp_A.colnums[sp_A.rowstart[i]];
-      const unsigned int *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]];
+      const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]];
+      const size_type *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]];
       for (; rows != end_rows; ++rows)
         {
           const double A_val = val[rows-&sp_A.colnums[sp_A.rowstart[0]]];
-          const unsigned int col = *rows;
-          const unsigned int *new_cols =
+          const size_type col = *rows;
+          const size_type *new_cols =
             (&sp_B.colnums[sp_B.rowstart[col]]);
 
           // special treatment for diagonal
@@ -1045,7 +1052,7 @@ SparseMatrix<number>::mmult (SparseMatrix<numberC>       &C,
             &B.val[new_cols-&sp_B.colnums[sp_B.rowstart[0]]];
           const numberB *const end_cols = &B.val[sp_B.rowstart[col+1]];
           for (; B_val_ptr != end_cols; ++B_val_ptr)
-            *new_ptr++ = A_val * *B_val_ptr * (use_vector ? V(col) : 1);
+            *new_ptr++ = A_val **B_val_ptr * (use_vector ? V(col) : 1);
 
           C.add (i, new_ptr-&new_entries[0], new_cols, &new_entries[0],
                  false, true);
@@ -1098,24 +1105,24 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
       // CompressedSimpleSparsityPattern class.
       {
         CompressedSimpleSparsityPattern csp (n(), B.n());
-        for (unsigned int i = 0; i < sp_A.n_rows(); ++i)
+        for (size_type i = 0; i < sp_A.n_rows(); ++i)
           {
-            const unsigned int *rows =
+            const size_type *rows =
               &sp_A.colnums[sp_A.rowstart[i]];
-            const unsigned int *const end_rows =
+            const size_type *const end_rows =
               &sp_A.colnums[sp_A.rowstart[i+1]];
             // cast away constness to conform with csp.add_entries interface
-            unsigned int *new_cols = const_cast<unsigned int *>
-                                     (&sp_B.colnums[sp_B.rowstart[i]]);
-            unsigned int *end_new_cols = const_cast<unsigned int *>
-                                         (&sp_B.colnums[sp_B.rowstart[i+1]]);
+            size_type *new_cols = const_cast<size_type *>
+                                  (&sp_B.colnums[sp_B.rowstart[i]]);
+            size_type *end_new_cols = const_cast<size_type *>
+                                      (&sp_B.colnums[sp_B.rowstart[i+1]]);
 
             if (sp_B.n_rows() == sp_B.n_cols())
               ++new_cols;
 
             for (; rows != end_rows; ++rows)
               {
-                const unsigned int row = *rows;
+                const size_type row = *rows;
 
                 // if B has a diagonal, need to add that manually. this way,
                 // we maintain sortedness.
@@ -1139,7 +1146,7 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
   // elements that are going to be written
   // into the new matrix.
   unsigned int max_n_cols_B = 0;
-  for (unsigned int i=0; i<B.m(); ++i)
+  for (size_type i=0; i<B.m(); ++i)
     max_n_cols_B = std::max (max_n_cols_B, sp_B.row_length(i));
   std::vector<numberC> new_entries(max_n_cols_B);
 
@@ -1147,11 +1154,11 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
   // nested loops. One over the rows of A, for each row we then loop over all
   // the columns, and then we need to multiply each element with all the
   // elements in that row in B.
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      const unsigned int *rows = &sp_A.colnums[sp_A.rowstart[i]];
-      const unsigned int *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]];
-      const unsigned int *new_cols = &sp_B.colnums[sp_B.rowstart[i]];
+      const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]];
+      const size_type *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]];
+      const size_type *new_cols = &sp_B.colnums[sp_B.rowstart[i]];
       if (sp_B.n_rows() == sp_B.n_cols())
         ++new_cols;
 
@@ -1159,7 +1166,7 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
 
       for (; rows != end_rows; ++rows)
         {
-          const unsigned int row = *rows;
+          const size_type row = *rows;
           const double A_val = val[rows-&sp_A.colnums[sp_A.rowstart[0]]];
 
           // special treatment for diagonal
@@ -1175,7 +1182,7 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
           const numberB *B_val_ptr =
             &B.val[new_cols-&sp_B.colnums[sp_B.rowstart[0]]];
           for (; B_val_ptr != end_cols; ++B_val_ptr)
-            *new_ptr++ = A_val * *B_val_ptr * (use_vector ? V(i) : 1);
+            *new_ptr++ = A_val **B_val_ptr * (use_vector ? V(i) : 1);
 
           C.add (row, new_ptr-&new_entries[0], new_cols, &new_entries[0],
                  false, true);
@@ -1193,9 +1200,9 @@ SparseMatrix<number>::l1_norm () const
   Assert (val != 0, ExcNotInitialized());
 
   Vector<real_type> column_sums(n());
-  const unsigned int n_rows = m();
-  for (unsigned int row=0; row<n_rows; ++row)
-    for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1] ; ++j)
+  const size_type n_rows = m();
+  for (size_type row=0; row<n_rows; ++row)
+    for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1] ; ++j)
       column_sums(cols->colnums[j]) += numbers::NumberTraits<number>::abs(val[j]);
 
   return column_sums.linfty_norm();
@@ -1213,8 +1220,8 @@ SparseMatrix<number>::linfty_norm () const
   const number *val_ptr = &val[cols->rowstart[0]];
 
   real_type max=0;
-  const unsigned int n_rows = m();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = m();
+  for (size_type row=0; row<n_rows; ++row)
     {
       real_type sum = 0;
       const number *const val_end_of_row = &val[cols->rowstart[row+1]];
@@ -1236,7 +1243,7 @@ SparseMatrix<number>::frobenius_norm () const
   // sparsity pattern, without taking any
   // reference to rows or columns
   real_type norm_sqr = 0;
-  const unsigned int n_rows = m();
+  const size_type n_rows = m();
   for (const number *ptr = &val[0];
        ptr != &val[cols->rowstart[n_rows]]; ++ptr)
     norm_sqr +=  numbers::NumberTraits<number>::abs_square(*ptr);
@@ -1264,21 +1271,21 @@ namespace internal
     template <typename number,
              typename InVector,
              typename OutVector>
-    number residual_sqr_on_subrange (const unsigned int  begin_row,
-                                     const unsigned int  end_row,
-                                     const number       *values,
+    number residual_sqr_on_subrange (const size_type    begin_row,
+                                     const size_type    end_row,
+                                     const number      *values,
                                      const std::size_t  *rowstart,
-                                     const unsigned int *colnums,
-                                     const InVector     &u,
-                                     const InVector     &b,
-                                     OutVector          &dst)
+                                     const size_type   *colnums,
+                                     const InVector    &u,
+                                     const InVector    &b,
+                                     OutVector         &dst)
     {
       number norm_sqr=0.;
 
-      for (unsigned int i=begin_row; i<end_row; ++i)
+      for (size_type i=begin_row; i<end_row; ++i)
         {
           number s = b(i);
-          for (unsigned int j=rowstart[i]; j<rowstart[i+1] ; j++)
+          for (size_type j=rowstart[i]; j<rowstart[i+1] ; j++)
             s -= values[j] * u(colnums[j]);
           dst(i) = s;
           norm_sqr += s*numbers::NumberTraits<number>::conjugate(s);
@@ -1332,9 +1339,9 @@ SparseMatrix<number>::precondition_Jacobi (Vector<somenumber>       &dst,
   AssertDimension (dst.size(), n());
   AssertDimension (src.size(), n());
 
-  const unsigned int n = src.size();
-  somenumber              *dst_ptr = dst.begin();
-  const somenumber        *src_ptr = src.begin();
+  const size_type n = src.size();
+  somenumber            *dst_ptr = dst.begin();
+  const somenumber      *src_ptr = src.begin();
   const std::size_t  *rowstart_ptr = &cols->rowstart[0];
 
   // optimize the following loop for
@@ -1349,10 +1356,10 @@ SparseMatrix<number>::precondition_Jacobi (Vector<somenumber>       &dst,
   // rowstart[i]. and we do have a
   // square matrix by above assertion
   if (om != 1.)
-    for (unsigned int i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
-      *dst_ptr = om * *src_ptr / val[*rowstart_ptr];
+    for (size_type i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
+      *dst_ptr = om **src_ptr / val[*rowstart_ptr];
   else
-    for (unsigned int i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
+    for (size_type i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
       *dst_ptr = *src_ptr / val[*rowstart_ptr];
 }
 
@@ -1376,9 +1383,9 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
   AssertDimension (dst.size(), n());
   AssertDimension (src.size(), n());
 
-  const unsigned int  n            = src.size();
-  const std::size_t  *rowstart_ptr = &cols->rowstart[0];
-  somenumber         *dst_ptr      = &dst(0);
+  const size_type    n            = src.size();
+  const std::size_t *rowstart_ptr = &cols->rowstart[0];
+  somenumber        *dst_ptr      = &dst(0);
 
   // case when we have stored the position
   // just right of the diagonal (then we
@@ -1389,7 +1396,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
               ExcDimensionMismatch (pos_right_of_diagonal.size(), dst.size()));
 
       // forward sweep
-      for (unsigned int row=0; row<n; ++row, ++dst_ptr, ++rowstart_ptr)
+      for (size_type row=0; row<n; ++row, ++dst_ptr, ++rowstart_ptr)
         {
           *dst_ptr = src(row);
           const std::size_t first_right_of_diagonal_index =
@@ -1397,7 +1404,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
           Assert (first_right_of_diagonal_index <= *(rowstart_ptr+1),
                   ExcInternalError());
           number s = 0;
-          for (unsigned int j=(*rowstart_ptr)+1; j<first_right_of_diagonal_index; ++j)
+          for (size_type j=(*rowstart_ptr)+1; j<first_right_of_diagonal_index; ++j)
             s += val[j] * dst(cols->colnums[j]);
 
           // divide by diagonal element
@@ -1416,11 +1423,11 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
       dst_ptr      = &dst(n-1);
       for (int row=n-1; row>=0; --row, --rowstart_ptr, --dst_ptr)
         {
-          const unsigned int end_row = *(rowstart_ptr+1);
-          const unsigned int first_right_of_diagonal_index
+          const size_type end_row = *(rowstart_ptr+1);
+          const size_type first_right_of_diagonal_index
             = pos_right_of_diagonal[row];
           number s = 0;
-          for (unsigned int j=first_right_of_diagonal_index; j<end_row; ++j)
+          for (size_type j=first_right_of_diagonal_index; j<end_row; ++j)
             s += val[j] * dst(cols->colnums[j]);
 
           *dst_ptr -= s * om;
@@ -1434,7 +1441,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
   // of the first element right of the
   // diagonal manually for each sweep.
   // forward sweep
-  for (unsigned int row=0; row<n; ++row, ++dst_ptr, ++rowstart_ptr)
+  for (size_type row=0; row<n; ++row, ++dst_ptr, ++rowstart_ptr)
     {
       *dst_ptr = src(row);
       // find the first element in this line
@@ -1444,7 +1451,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
       // note: the first entry in each
       // line denotes the diagonal element,
       // which we need not check.
-      const unsigned int first_right_of_diagonal_index
+      const size_type first_right_of_diagonal_index
         = (Utilities::lower_bound (&cols->colnums[*rowstart_ptr+1],
                                    &cols->colnums[*(rowstart_ptr+1)],
                                    row)
@@ -1452,7 +1459,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
            &cols->colnums[0]);
 
       number s = 0;
-      for (unsigned int j=(*rowstart_ptr)+1; j<first_right_of_diagonal_index; ++j)
+      for (size_type j=(*rowstart_ptr)+1; j<first_right_of_diagonal_index; ++j)
         s += val[j] * dst(cols->colnums[j]);
 
       // divide by diagonal element
@@ -1463,7 +1470,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
 
   rowstart_ptr = &cols->rowstart[0];
   dst_ptr      = &dst(0);
-  for (unsigned int row=0; row<n; ++row, ++rowstart_ptr, ++dst_ptr)
+  for (size_type row=0; row<n; ++row, ++rowstart_ptr, ++dst_ptr)
     *dst_ptr *= (2.-om)*val[*rowstart_ptr];
 
   // backward sweep
@@ -1471,14 +1478,14 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
   dst_ptr      = &dst(n-1);
   for (int row=n-1; row>=0; --row, --rowstart_ptr, --dst_ptr)
     {
-      const unsigned int end_row = *(rowstart_ptr+1);
-      const unsigned int first_right_of_diagonal_index
+      const size_type end_row = *(rowstart_ptr+1);
+      const size_type first_right_of_diagonal_index
         = (Utilities::lower_bound (&cols->colnums[*rowstart_ptr+1],
                                    &cols->colnums[end_row],
-                                   static_cast<unsigned int>(row)) -
+                                   static_cast<size_type>(row)) -
            &cols->colnums[0]);
       number s = 0;
-      for (unsigned int j=first_right_of_diagonal_index; j<end_row; ++j)
+      for (size_type j=first_right_of_diagonal_index; j<end_row; ++j)
         s += val[j] * dst(cols->colnums[j]);
       *dst_ptr -= s * om;
       Assert(val[*rowstart_ptr]!= 0., ExcDivideByZero());
@@ -1528,12 +1535,12 @@ SparseMatrix<number>::SOR (Vector<somenumber> &dst,
   AssertDimension (m(), n());
   AssertDimension (dst.size(), n());
 
-  for (unsigned int row=0; row<m(); ++row)
+  for (size_type row=0; row<m(); ++row)
     {
       somenumber s = dst(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
-          const unsigned int col = cols->colnums[j];
+          const size_type col = cols->colnums[j];
           if (col < row)
             s -= val[j] * dst(col);
         }
@@ -1555,11 +1562,11 @@ SparseMatrix<number>::TSOR (Vector<somenumber> &dst,
   AssertDimension (m(), n());
   AssertDimension (dst.size(), n());
 
-  unsigned int row=m()-1;
+  size_type row=m()-1;
   while (true)
     {
       somenumber s = dst(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         if (cols->colnums[j] > row)
           s -= val[j] * dst(cols->colnums[j]);
 
@@ -1578,8 +1585,8 @@ template <typename number>
 template <typename somenumber>
 void
 SparseMatrix<number>::PSOR (Vector<somenumber> &dst,
-                            const std::vector<unsigned int> &permutation,
-                            const std::vector<unsigned int> &inverse_permutation,
+                            const std::vector<size_type> &permutation,
+                            const std::vector<size_type> &inverse_permutation,
                             const number om) const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -1592,14 +1599,14 @@ SparseMatrix<number>::PSOR (Vector<somenumber> &dst,
   Assert (m() == inverse_permutation.size(),
           ExcDimensionMismatch(m(), inverse_permutation.size()));
 
-  for (unsigned int urow=0; urow<m(); ++urow)
+  for (size_type urow=0; urow<m(); ++urow)
     {
-      const unsigned int row = permutation[urow];
+      const size_type row = permutation[urow];
       somenumber s = dst(row);
 
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
-          const unsigned int col = cols->colnums[j];
+          const size_type col = cols->colnums[j];
           if (inverse_permutation[col] < urow)
             {
               s -= val[j] * dst(col);
@@ -1616,8 +1623,8 @@ template <typename number>
 template <typename somenumber>
 void
 SparseMatrix<number>::TPSOR (Vector<somenumber> &dst,
-                             const std::vector<unsigned int> &permutation,
-                             const std::vector<unsigned int> &inverse_permutation,
+                             const std::vector<size_type> &permutation,
+                             const std::vector<size_type> &inverse_permutation,
                              const number om) const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -1630,14 +1637,14 @@ SparseMatrix<number>::TPSOR (Vector<somenumber> &dst,
   Assert (m() == inverse_permutation.size(),
           ExcDimensionMismatch(m(), inverse_permutation.size()));
 
-  for (unsigned int urow=m(); urow != 0;)
+  for (size_type urow=m(); urow != 0;)
     {
       --urow;
-      const unsigned int row = permutation[urow];
+      const size_type row = permutation[urow];
       somenumber s = dst(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
-          const unsigned int col = cols->colnums[j];
+          const size_type col = cols->colnums[j];
           if (inverse_permutation[col] > urow)
             s -= val[j] * dst(col);
         }
@@ -1693,10 +1700,10 @@ SparseMatrix<number>::SOR_step (Vector<somenumber> &v,
   Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
   Assert (m() == b.size(), ExcDimensionMismatch(m(),b.size()));
 
-  for (unsigned int row=0; row<m(); ++row)
+  for (size_type row=0; row<m(); ++row)
     {
       somenumber s = b(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
           s -= val[j] * v(cols->colnums[j]);
         }
@@ -1723,7 +1730,7 @@ SparseMatrix<number>::TSOR_step (Vector<somenumber> &v,
   for (int row=m()-1; row>=0; --row)
     {
       somenumber s = b(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
           s -= val[j] * v(cols->colnums[j]);
         }
@@ -1761,16 +1768,16 @@ SparseMatrix<number>::SSOR (Vector<somenumber> &dst,
   AssertDimension (m(), n());
   Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
 
-  const unsigned int  n = dst.size();
-  unsigned int  j;
+  const size_type n = dst.size();
+  size_type j;
   somenumber s;
 
-  for (unsigned int i=0; i<n; i++)
+  for (size_type i=0; i<n; i++)
     {
       s = 0.;
       for (j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
         {
-          const unsigned int p = cols->colnums[j];
+          const size_type p = cols->colnums[j];
           if (p != SparsityPattern::invalid_entry)
             {
               if (i>j) s += val[j] * dst(p);
@@ -1786,10 +1793,10 @@ SparseMatrix<number>::SSOR (Vector<somenumber> &dst,
       s = 0.;
       for (j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
         {
-          const unsigned int p = cols->colnums[j];
+          const size_type p = cols->colnums[j];
           if (p != SparsityPattern::invalid_entry)
             {
-              if (static_cast<unsigned int>(i)<j) s += val[j] * dst(p);
+              if (static_cast<size_type>(i)<j) s += val[j] * dst(p);
             }
         }
       Assert(val[cols->rowstart[i]]!= 0., ExcDivideByZero());
@@ -1838,9 +1845,9 @@ void SparseMatrix<number>::print_formatted (std::ostream &out,
         width = precision+2;
     }
 
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      for (unsigned int j=0; j<n(); ++j)
+      for (size_type j=0; j<n(); ++j)
         if ((*cols)(i,j) != SparsityPattern::invalid_entry)
           out << std::setw(width)
               << val[cols->operator()(i,j)] * denominator << ' ';
@@ -1864,9 +1871,9 @@ void SparseMatrix<number>::print_pattern (std::ostream &out,
   Assert (cols != 0, ExcNotInitialized());
   Assert (val != 0, ExcNotInitialized());
 
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      for (unsigned int j=0; j<n(); ++j)
+      for (size_type j=0; j<n(); ++j)
         if ((*cols)(i,j) == SparsityPattern::invalid_entry)
           out << '.';
         else if (std::fabs(val[cols->operator()(i,j)]) > threshold)
@@ -1931,6 +1938,11 @@ SparseMatrix<number>::block_read (std::istream &in)
 }
 
 
+template <typename number>
+void
+SparseMatrix<number>::compress (::dealii::VectorOperation::values)
+{}
+
 
 template <typename number>
 std::size_t
index a7fa2e7f466ea65955cd6e288727b0aec5804d42..f4d45cad380a7c2785f8be6c1816c2f6a2a36a70 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_matrix_ez_h
 #define __deal2__sparse_matrix_ez_h
 
@@ -97,6 +102,11 @@ template <typename number>
 class SparseMatrixEZ : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * The class for storing the
    * column number of an entry
@@ -115,13 +125,13 @@ public:
      * Constructor. Fills column
      * and value.
      */
-    Entry (const unsigned int column,
+    Entry (const size_type column,
            const number &value);
 
     /**
      * The column number.
      */
-    unsigned int column;
+    size_type column;
 
     /**
      * The value there.
@@ -131,7 +141,7 @@ public:
     /**
      * Non-existent column number.
      */
-    static const unsigned int invalid = numbers::invalid_unsigned_int;
+    static const size_type invalid = numbers::invalid_size_type;
   };
 
   /**
@@ -145,13 +155,13 @@ public:
     /**
      * Constructor.
      */
-    RowInfo (unsigned int start = Entry::invalid);
+    RowInfo (size_type start = Entry::invalid);
 
     /**
      * Index of first entry of
      * the row in the data field.
      */
-    unsigned int start;
+    size_type start;
     /**
      * Number of entries in this
      * row.
@@ -191,7 +201,7 @@ public:
        * pointer is sufficient.
        */
       Accessor (const SparseMatrixEZ<number> *matrix,
-                const unsigned int            row,
+                const size_type               row,
                 const unsigned short          index);
 
       /**
@@ -199,7 +209,7 @@ public:
        * represented by this
        * object.
        */
-      unsigned int row() const;
+      size_type row() const;
 
       /**
        * Index in row of the element
@@ -213,7 +223,7 @@ public:
        * element represented by
        * this object.
        */
-      unsigned int column() const;
+      size_type column() const;
 
       /**
        * Value of this matrix entry.
@@ -229,7 +239,7 @@ public:
       /**
        * Current row number.
        */
-      unsigned int a_row;
+      size_type a_row;
 
       /**
        * Current index in row.
@@ -248,7 +258,7 @@ public:
      * Constructor.
      */
     const_iterator(const SparseMatrixEZ<number> *matrix,
-                   const unsigned int            row,
+                   const size_type               row,
                    const unsigned short          index);
 
     /**
@@ -364,9 +374,9 @@ public:
    * efficient assembling of the
    * matrix.
    */
-  explicit SparseMatrixEZ (const unsigned int n_rows,
-                           const unsigned int n_columns,
-                           const unsigned int default_row_length = 0,
+  explicit SparseMatrixEZ (const size_type n_rows,
+                           const size_type n_columns,
+                           const size_type default_row_length = 0,
                            const unsigned int default_increment = 1);
 
   /**
@@ -415,11 +425,11 @@ public:
    * efficient assembling of the
    * matrix.
    */
-  void reinit (const unsigned int n_rows,
-               const unsigned int n_columns,
-               unsigned int default_row_length = 0,
+  void reinit (const size_type n_rows,
+               const size_type n_columns,
+               size_type default_row_length = 0,
                unsigned int default_increment = 1,
-               unsigned int reserve = 0);
+               size_type reserve = 0);
 
   /**
    * Release all memory and return
@@ -447,7 +457,7 @@ public:
    * matrix is of dimension
    * $m \times n$.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Return the dimension of the
@@ -455,19 +465,19 @@ public:
    * matrix is of dimension
    * $m \times n$.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Return the number of entries
    * in a specific row.
    */
-  unsigned int get_row_length (const unsigned int row) const;
+  size_type get_row_length (const size_type row) const;
 
   /**
    * Return the number of nonzero
    * elements of this matrix.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Determine an estimate for the
@@ -501,10 +511,10 @@ public:
    * the number of entries in each
    * line is printed as well.
    */
-  void compute_statistics (unsigned int &used,
-                           unsigned int &allocated,
-                           unsigned int &reserved,
-                           std::vector<unsigned int> &used_by_line,
+  void compute_statistics (size_type &used,
+                           size_type &allocated,
+                           size_type &reserved,
+                           std::vector<size_type> &used_by_line,
                            const bool compute_by_line) const;
 //@}
   /**
@@ -520,7 +530,7 @@ public:
                    * finite number an exception
                    * is thrown.
                    */
-  void set (const unsigned int i, const unsigned int j,
+  void set (const size_type i, const size_type j,
             const number value);
 
   /**
@@ -532,8 +542,8 @@ public:
    * finite number an exception
    * is thrown.
    */
-  void add (const unsigned int i,
-            const unsigned int j,
+  void add (const size_type i,
+            const size_type j,
             const number value);
 
   /**
@@ -564,9 +574,9 @@ public:
    * into the matrix.
    */
   template <typename number2>
-  void add (const std::vector<unsigned int> &indices,
-            const FullMatrix<number2>       &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &indices,
+            const FullMatrix<number2>    &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Same function as before, but now
@@ -576,8 +586,8 @@ public:
    * on rows and columns, respectively.
    */
   template <typename number2>
-  void add (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
+  void add (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
             const FullMatrix<number2>       &full_matrix,
             const bool                       elide_zero_values = true);
 
@@ -599,10 +609,10 @@ public:
    * into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int               row,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number2>      &values,
-            const bool                       elide_zero_values = true);
+  void add (const size_type               row,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number2>   &values,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add an array of values given by
@@ -622,12 +632,12 @@ public:
    * into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number2      *values,
-            const bool          elide_zero_values = true,
-            const bool          col_indices_are_sorted = false);
+  void add (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number2   *values,
+            const bool       elide_zero_values = true,
+            const bool       col_indices_are_sorted = false);
 
   /**
    * Copy the given matrix to this
@@ -696,16 +706,16 @@ public:
    * matrix), use the @p el
    * function.
    */
-  number operator () (const unsigned int i,
-                      const unsigned int j) const;
+  number operator () (const size_type i,
+                      const size_type j) const;
 
   /**
    * Return the value of the entry
    * (i,j). Returns zero for all
    * non-existing entries.
    */
-  number el (const unsigned int i,
-             const unsigned int j) const;
+  number el (const size_type i,
+             const size_type j) const;
 //@}
   /**
    * @name Multiplications
@@ -853,14 +863,14 @@ public:
    * is <tt>end(r)</tt>, which does NOT
    * point into row @p r..
    */
-  const_iterator begin (const unsigned int r) const;
+  const_iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row
    * @p r. The result may be
    * different from <tt>end()</tt>!
    */
-  const_iterator end (const unsigned int r) const;
+  const_iterator end (const size_type r) const;
 //@}
   /**
    * @name Input/Output
@@ -978,8 +988,8 @@ private:
    * zero-pointer if the entry does
    * not exist.
    */
-  const Entry *locate (const unsigned int row,
-                       const unsigned int col) const;
+  const Entry *locate (const size_type row,
+                       const size_type col) const;
 
   /**
    * Find an entry and return a
@@ -987,14 +997,14 @@ private:
    * zero-pointer if the entry does
    * not exist.
    */
-  Entry *locate (const unsigned int row,
-                 const unsigned int col);
+  Entry *locate (const size_type row,
+                 const size_type col);
 
   /**
    * Find an entry or generate it.
    */
-  Entry *allocate (const unsigned int row,
-                   const unsigned int col);
+  Entry *allocate (const size_type row,
+                   const size_type col);
 
   /**
    * Version of @p vmult which only
@@ -1008,8 +1018,8 @@ private:
   template <typename somenumber>
   void threaded_vmult (Vector<somenumber>       &dst,
                        const Vector<somenumber> &src,
-                       const unsigned int        begin_row,
-                       const unsigned int        end_row) const;
+                       const size_type           begin_row,
+                       const size_type           end_row) const;
 
   /**
    * Version of
@@ -1024,8 +1034,8 @@ private:
    */
   template <typename somenumber>
   void threaded_matrix_norm_square (const Vector<somenumber> &v,
-                                    const unsigned int        begin_row,
-                                    const unsigned int        end_row,
+                                    const size_type           begin_row,
+                                    const size_type           end_row,
                                     somenumber               *partial_sum) const;
 
   /**
@@ -1042,8 +1052,8 @@ private:
   template <typename somenumber>
   void threaded_matrix_scalar_product (const Vector<somenumber> &u,
                                        const Vector<somenumber> &v,
-                                       const unsigned int        begin_row,
-                                       const unsigned int        end_row,
+                                       const size_type           begin_row,
+                                       const size_type           end_row,
                                        somenumber               *partial_sum) const;
 
   /**
@@ -1051,7 +1061,7 @@ private:
    * used to check vector
    * dimensions only.
    */
-  unsigned int n_columns;
+  size_type n_columns;
 
   /**
    * Info structure for each row.
@@ -1084,7 +1094,7 @@ private:
 
 template <typename number>
 inline
-SparseMatrixEZ<number>::Entry::Entry(unsigned int column,
+SparseMatrixEZ<number>::Entry::Entry(size_type column,
                                      const number &value)
   :
   column(column),
@@ -1104,7 +1114,7 @@ SparseMatrixEZ<number>::Entry::Entry()
 
 template <typename number>
 inline
-SparseMatrixEZ<number>::RowInfo::RowInfo(unsigned int start)
+SparseMatrixEZ<number>::RowInfo::RowInfo(size_type start)
   :
   start(start),
   length(0),
@@ -1117,7 +1127,7 @@ template <typename number>
 inline
 SparseMatrixEZ<number>::const_iterator::Accessor::
 Accessor (const SparseMatrixEZ<number> *matrix,
-          const unsigned int            r,
+          const size_type               r,
           const unsigned short          i)
   :
   matrix(matrix),
@@ -1128,7 +1138,7 @@ Accessor (const SparseMatrixEZ<number> *matrix,
 
 template <typename number>
 inline
-unsigned int
+typename SparseMatrixEZ<number>::size_type
 SparseMatrixEZ<number>::const_iterator::Accessor::row() const
 {
   return a_row;
@@ -1137,7 +1147,7 @@ SparseMatrixEZ<number>::const_iterator::Accessor::row() const
 
 template <typename number>
 inline
-unsigned int
+typename SparseMatrixEZ<number>::size_type
 SparseMatrixEZ<number>::const_iterator::Accessor::column() const
 {
   return matrix->data[matrix->row_info[a_row].start+a_index].column;
@@ -1167,7 +1177,7 @@ template <typename number>
 inline
 SparseMatrixEZ<number>::const_iterator::
 const_iterator(const SparseMatrixEZ<number> *matrix,
-               const unsigned int            r,
+               const size_type               r,
                const unsigned short          i)
   :
   accessor(matrix, r, i)
@@ -1280,7 +1290,7 @@ operator < (const const_iterator &other) const
 //---------------------------------------------------------------------------
 template <typename number>
 inline
-unsigned int SparseMatrixEZ<number>::m () const
+typename SparseMatrixEZ<number>::size_type SparseMatrixEZ<number>::m () const
 {
   return row_info.size();
 }
@@ -1288,7 +1298,7 @@ unsigned int SparseMatrixEZ<number>::m () const
 
 template <typename number>
 inline
-unsigned int SparseMatrixEZ<number>::n () const
+typename SparseMatrixEZ<number>::size_type SparseMatrixEZ<number>::n () const
 {
   return n_columns;
 }
@@ -1297,15 +1307,15 @@ unsigned int SparseMatrixEZ<number>::n () const
 template <typename number>
 inline
 typename SparseMatrixEZ<number>::Entry *
-SparseMatrixEZ<number>::locate (const unsigned int row,
-                                const unsigned int col)
+SparseMatrixEZ<number>::locate (const size_type row,
+                                const size_type col)
 {
   Assert (row<m(), ExcIndexRange(row,0,m()));
   Assert (col<n(), ExcIndexRange(col,0,n()));
 
   const RowInfo &r = row_info[row];
-  const unsigned int end = r.start + r.length;
-  for (unsigned int i=r.start; i<end; ++i)
+  const size_type end = r.start + r.length;
+  for (size_type i=r.start; i<end; ++i)
     {
       Entry *const entry = &data[i];
       if (entry->column == col)
@@ -1321,8 +1331,8 @@ SparseMatrixEZ<number>::locate (const unsigned int row,
 template <typename number>
 inline
 const typename SparseMatrixEZ<number>::Entry *
-SparseMatrixEZ<number>::locate (const unsigned int row,
-                                const unsigned int col) const
+SparseMatrixEZ<number>::locate (const size_type row,
+                                const size_type col) const
 {
   SparseMatrixEZ<number> *t = const_cast<SparseMatrixEZ<number>*> (this);
   return t->locate(row,col);
@@ -1332,16 +1342,16 @@ SparseMatrixEZ<number>::locate (const unsigned int row,
 template <typename number>
 inline
 typename SparseMatrixEZ<number>::Entry *
-SparseMatrixEZ<number>::allocate (const unsigned int row,
-                                  const unsigned int col)
+SparseMatrixEZ<number>::allocate (const size_type row,
+                                  const size_type col)
 {
   Assert (row<m(), ExcIndexRange(row,0,m()));
   Assert (col<n(), ExcIndexRange(col,0,n()));
 
   RowInfo &r = row_info[row];
-  const unsigned int end = r.start + r.length;
+  const size_type end = r.start + r.length;
 
-  unsigned int i = r.start;
+  size_type i = r.start;
   // If diagonal exists and this
   // column is higher, start only
   // after diagonal.
@@ -1373,7 +1383,7 @@ SparseMatrixEZ<number>::allocate (const unsigned int row,
           data.insert(data.begin()+end, increment, Entry());
           // Update starts of
           // following rows
-          for (unsigned int rn=row+1; rn<row_info.size(); ++rn)
+          for (size_type rn=row+1; rn<row_info.size(); ++rn)
             row_info[rn].start += increment;
         }
     }
@@ -1409,7 +1419,7 @@ SparseMatrixEZ<number>::allocate (const unsigned int row,
 
   // Move all entries in this
   // row up by one
-  for (unsigned int j = i+1; j < end; ++j)
+  for (size_type j = i+1; j < end; ++j)
     {
       // There should be no invalid
       // entry below end
@@ -1429,8 +1439,8 @@ SparseMatrixEZ<number>::allocate (const unsigned int row,
 
 template <typename number>
 inline
-void SparseMatrixEZ<number>::set (const unsigned int i,
-                                  const unsigned int j,
+void SparseMatrixEZ<number>::set (const size_type i,
+                                  const size_type j,
                                   const number value)
 {
 
@@ -1456,8 +1466,8 @@ void SparseMatrixEZ<number>::set (const unsigned int i,
 
 template <typename number>
 inline
-void SparseMatrixEZ<number>::add (const unsigned int i,
-                                  const unsigned int j,
+void SparseMatrixEZ<number>::add (const size_type i,
+                                  const size_type j,
                                   const number value)
 {
 
@@ -1477,13 +1487,13 @@ void SparseMatrixEZ<number>::add (const unsigned int i,
 
 template <typename number>
 template <typename number2>
-void SparseMatrixEZ<number>::add (const std::vector<unsigned int> &indices,
-                                  const FullMatrix<number2>       &full_matrix,
-                                  const bool                       elide_zero_values)
+void SparseMatrixEZ<number>::add (const std::vector<size_type> &indices,
+                                  const FullMatrix<number2>    &full_matrix,
+                                  const bool                    elide_zero_values)
 {
 //TODO: This function can surely be made more efficient
-  for (unsigned int i=0; i<indices.size(); ++i)
-    for (unsigned int j=0; j<indices.size(); ++j)
+  for (size_type i=0; i<indices.size(); ++i)
+    for (size_type j=0; j<indices.size(); ++j)
       if ((full_matrix(i,j) != 0) || (elide_zero_values == false))
         add (indices[i], indices[j], full_matrix(i,j));
 }
@@ -1492,14 +1502,14 @@ void SparseMatrixEZ<number>::add (const std::vector<unsigned int> &indices,
 
 template <typename number>
 template <typename number2>
-void SparseMatrixEZ<number>::add (const std::vector<unsigned int> &row_indices,
-                                  const std::vector<unsigned int> &col_indices,
-                                  const FullMatrix<number2>       &full_matrix,
-                                  const bool                       elide_zero_values)
+void SparseMatrixEZ<number>::add (const std::vector<size_type> &row_indices,
+                                  const std::vector<size_type> &col_indices,
+                                  const FullMatrix<number2>    &full_matrix,
+                                  const bool                    elide_zero_values)
 {
 //TODO: This function can surely be made more efficient
-  for (unsigned int i=0; i<row_indices.size(); ++i)
-    for (unsigned int j=0; j<col_indices.size(); ++j)
+  for (size_type i=0; i<row_indices.size(); ++i)
+    for (size_type j=0; j<col_indices.size(); ++j)
       if ((full_matrix(i,j) != 0) || (elide_zero_values == false))
         add (row_indices[i], col_indices[j], full_matrix(i,j));
 }
@@ -1509,13 +1519,13 @@ void SparseMatrixEZ<number>::add (const std::vector<unsigned int> &row_indices,
 
 template <typename number>
 template <typename number2>
-void SparseMatrixEZ<number>::add (const unsigned int               row,
-                                  const std::vector<unsigned int> &col_indices,
-                                  const std::vector<number2>      &values,
-                                  const bool                       elide_zero_values)
+void SparseMatrixEZ<number>::add (const size_type               row,
+                                  const std::vector<size_type> &col_indices,
+                                  const std::vector<number2>   &values,
+                                  const bool                    elide_zero_values)
 {
 //TODO: This function can surely be made more efficient
-  for (unsigned int j=0; j<col_indices.size(); ++j)
+  for (size_type j=0; j<col_indices.size(); ++j)
     if ((values[j] != 0) || (elide_zero_values == false))
       add (row, col_indices[j], values[j]);
 }
@@ -1524,15 +1534,15 @@ void SparseMatrixEZ<number>::add (const unsigned int               row,
 
 template <typename number>
 template <typename number2>
-void SparseMatrixEZ<number>::add (const unsigned int  row,
-                                  const unsigned int  n_cols,
-                                  const unsigned int *col_indices,
-                                  const number2      *values,
-                                  const bool          elide_zero_values,
-                                  const bool          /*col_indices_are_sorted*/)
+void SparseMatrixEZ<number>::add (const size_type  row,
+                                  const size_type  n_cols,
+                                  const size_type *col_indices,
+                                  const number2   *values,
+                                  const bool       elide_zero_values,
+                                  const bool      /*col_indices_are_sorted*/)
 {
 //TODO: This function can surely be made more efficient
-  for (unsigned int j=0; j<n_cols; ++j)
+  for (size_type j=0; j<n_cols; ++j)
     if ((values[j] != 0) || (elide_zero_values == false))
       add (row, col_indices[j], values[j]);
 }
@@ -1542,8 +1552,8 @@ void SparseMatrixEZ<number>::add (const unsigned int  row,
 
 template <typename number>
 inline
-number SparseMatrixEZ<number>::el (const unsigned int i,
-                                   const unsigned int j) const
+number SparseMatrixEZ<number>::el (const size_type i,
+                                   const size_type j) const
 {
   const Entry *entry = locate(i,j);
   if (entry)
@@ -1555,8 +1565,8 @@ number SparseMatrixEZ<number>::el (const unsigned int i,
 
 template <typename number>
 inline
-number SparseMatrixEZ<number>::operator() (const unsigned int i,
-                                           const unsigned int j) const
+number SparseMatrixEZ<number>::operator() (const size_type i,
+                                           const size_type j) const
 {
   const Entry *entry = locate(i,j);
   if (entry)
@@ -1586,7 +1596,7 @@ SparseMatrixEZ<number>::end () const
 template <typename number>
 inline
 typename SparseMatrixEZ<number>::const_iterator
-SparseMatrixEZ<number>::begin (const unsigned int r) const
+SparseMatrixEZ<number>::begin (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   const_iterator result (this, r, 0);
@@ -1596,7 +1606,7 @@ SparseMatrixEZ<number>::begin (const unsigned int r) const
 template <typename number>
 inline
 typename SparseMatrixEZ<number>::const_iterator
-SparseMatrixEZ<number>::end (const unsigned int r) const
+SparseMatrixEZ<number>::end (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   const_iterator result(this, r+1, 0);
@@ -1614,11 +1624,11 @@ SparseMatrixEZ<number>::copy_from (const MATRIX &M)
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class, and
   // copy them into the current object
-  for (unsigned int row = 0; row < M.m(); ++row)
+  for (size_type row = 0; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
-          entry != end_row; ++entry)
+           entry != end_row; ++entry)
         if (entry->value() != 0)
           set(row, entry->column(), entry->value());
     }
@@ -1642,11 +1652,11 @@ SparseMatrixEZ<number>::add (const number factor,
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class, and
   // add them into the current object
-  for (unsigned int row = 0; row < M.m(); ++row)
+  for (size_type row = 0; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
-          entry != end_row; ++entry)
+           entry != end_row; ++entry)
         if (entry->value() != 0)
           add(row, entry->column(), factor * entry->value());
     }
@@ -1682,13 +1692,13 @@ SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
   if (transpose)
     while (b1 != b_final)
       {
-        const unsigned int i = b1->column();
-        const unsigned int k = b1->row();
+        const size_type i = b1->column();
+        const size_type k = b1->row();
         typename MATRIXB::const_iterator b2 = B.begin();
         while (b2 != b_final)
           {
-            const unsigned int j = b2->column();
-            const unsigned int l = b2->row();
+            const size_type j = b2->column();
+            const size_type l = b2->row();
 
             const typename MATRIXA::value_type a = A.el(k,l);
 
@@ -1704,11 +1714,11 @@ SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
       // maximal row for a column in
       // advance.
 
-      std::vector<unsigned int> minrow(B.n(), B.m());
-      std::vector<unsigned int> maxrow(B.n(), 0);
+      std::vector<size_type> minrow(B.n(), B.m());
+      std::vector<size_type> maxrow(B.n(), 0);
       while (b1 != b_final)
         {
-          const unsigned int r = b1->row();
+          const size_type r = b1->row();
           if (r < minrow[b1->column()])
             minrow[b1->column()] = r;
           if (r > maxrow[b1->column()])
@@ -1745,7 +1755,7 @@ SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
               // the work
               if (b1->column() == ai->row() && (b1v != 0.))
                 {
-                  const unsigned int i = b1->row();
+                  const size_type i = b1->row();
 
                   typename MATRIXB::const_iterator
                   b2 = B.begin(minrow[ai->column()]);
@@ -1753,7 +1763,7 @@ SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
                     {
                       if (b2->column() == ai->column())
                         {
-                          const unsigned int j = b2->row();
+                          const size_type j = b2->row();
                           add (i, j, a * b1v * b2->value());
                         }
                       ++b2;
@@ -1773,10 +1783,10 @@ inline
 void
 SparseMatrixEZ<number>::print_statistics(STREAM &out, bool full)
 {
-  unsigned int used;
-  unsigned int allocated;
-  unsigned int reserved;
-  std::vector<unsigned int> used_by_line;
+  size_type used;
+  size_type allocated;
+  size_type reserved;
+  std::vector<size_type> used_by_line;
 
   compute_statistics (used, allocated, reserved, used_by_line, full);
 
@@ -1786,7 +1796,7 @@ SparseMatrixEZ<number>::print_statistics(STREAM &out, bool full)
 
   if (full)
     {
-      for (unsigned int i=0; i< used_by_line.size(); ++i)
+      for (size_type i=0; i< used_by_line.size(); ++i)
         if (used_by_line[i] != 0)
           out << "SparseMatrixEZ:entries\t" << i
               << "\trows\t" << used_by_line[i]
index 1c4ee5b8f644e3596e798d04ea9535aa1fc6c825..eac1a95b32d3100a6c90e9bf96f969000999ca91 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_matrix_ez_templates_h
 #define __deal2__sparse_matrix_ez_templates_h
 
@@ -44,9 +49,9 @@ SparseMatrixEZ<number>::SparseMatrixEZ(const SparseMatrixEZ<number> &m)
 
 
 template <typename number>
-SparseMatrixEZ<number>::SparseMatrixEZ(const unsigned int n_rows,
-                                       const unsigned int n_cols,
-                                       const unsigned int default_row_length,
+SparseMatrixEZ<number>::SparseMatrixEZ(const size_type    n_rows,
+                                       const size_type    n_cols,
+                                       const size_type    default_row_length,
                                        const unsigned int default_increment)
 {
   reinit(n_rows, n_cols, default_row_length, default_increment);
@@ -88,11 +93,11 @@ SparseMatrixEZ<number>::operator = (const double d)
 
 template <typename number>
 void
-SparseMatrixEZ<number>::reinit(const unsigned int n_rows,
-                               const unsigned int n_cols,
-                               unsigned int default_row_length,
-                               unsigned int default_increment,
-                               unsigned int reserve)
+SparseMatrixEZ<number>::reinit(const size_type n_rows,
+                               const size_type n_cols,
+                               size_type       default_row_length,
+                               unsigned int    default_increment,
+                               size_type       reserve)
 {
   clear();
 
@@ -104,7 +109,7 @@ SparseMatrixEZ<number>::reinit(const unsigned int n_rows,
     data.reserve(reserve);
   data.resize(default_row_length * n_rows);
 
-  for (unsigned int i=0; i<n_rows; ++i)
+  for (size_type i=0; i<n_rows; ++i)
     row_info[i].start = i * default_row_length;
 }
 
@@ -136,8 +141,8 @@ SparseMatrixEZ<number>::vmult (Vector<somenumber> &dst,
   Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
   Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
 
-  const unsigned int end_row = row_info.size();
-  for (unsigned int row = 0; row < end_row; ++row)
+  const size_type end_row = row_info.size();
+  for (size_type row = 0; row < end_row; ++row)
     {
       const RowInfo &ri = row_info[row];
       typename std::vector<Entry>::const_iterator
@@ -193,8 +198,8 @@ SparseMatrixEZ<number>::vmult_add (Vector<somenumber> &dst,
   Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
   Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
 
-  const unsigned int end_row = row_info.size();
-  for (unsigned int row = 0; row < end_row; ++row)
+  const size_type end_row = row_info.size();
+  for (size_type row = 0; row < end_row; ++row)
     {
       const RowInfo &ri = row_info[row];
       typename std::vector<Entry>::const_iterator
@@ -219,8 +224,8 @@ SparseMatrixEZ<number>::Tvmult_add (Vector<somenumber> &dst,
   Assert(n() == dst.size(), ExcDimensionMismatch(n(),dst.size()));
   Assert(m() == src.size(), ExcDimensionMismatch(m(),src.size()));
 
-  const unsigned int end_row = row_info.size();
-  for (unsigned int row = 0; row < end_row; ++row)
+  const size_type end_row = row_info.size();
+  for (size_type row = 0; row < end_row; ++row)
     {
       const RowInfo &ri = row_info[row];
       typename std::vector<Entry>::const_iterator
@@ -254,7 +259,7 @@ SparseMatrixEZ<number>::precondition_Jacobi (Vector<somenumber>       &dst,
   for (; ri != end; ++dst_ptr, ++src_ptr, ++ri)
     {
       Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
-      *dst_ptr = om * *src_ptr / data[ri->start + ri->diagonal].value;
+      *dst_ptr = om **src_ptr / data[ri->start + ri->diagonal].value;
     }
 }
 
@@ -280,8 +285,8 @@ SparseMatrixEZ<number>::precondition_SOR (Vector<somenumber>       &dst,
     {
       Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
       number s = *src_ptr;
-      const unsigned int end_row = ri->start + ri->diagonal;
-      for (unsigned int i=ri->start; i<end_row; ++i)
+      const size_type end_row = ri->start + ri->diagonal;
+      for (size_type i=ri->start; i<end_row; ++i)
         s -= data[i].value * dst(data[i].column);
 
       *dst_ptr = om * s / data[ri->start + ri->diagonal].value;
@@ -312,8 +317,8 @@ SparseMatrixEZ<number>::precondition_TSOR (Vector<somenumber>       &dst,
     {
       Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
       number s = *src_ptr;
-      const unsigned int end_row = ri->start + ri->length;
-      for (unsigned int i=ri->start+ri->diagonal+1; i<end_row; ++i)
+      const size_type end_row = ri->start + ri->length;
+      for (size_type i=ri->start+ri->diagonal+1; i<end_row; ++i)
         s -= data[i].value * dst(data[i].column);
 
       *dst_ptr = om * s / data[ri->start + ri->diagonal].value;
@@ -344,8 +349,8 @@ SparseMatrixEZ<number>::precondition_SSOR (Vector<somenumber>       &dst,
     {
       Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
       number s = 0;
-      const unsigned int end_row = ri->start + ri->diagonal;
-      for (unsigned int i=ri->start; i<end_row; ++i)
+      const size_type end_row = ri->start + ri->diagonal;
+      for (size_type i=ri->start; i<end_row; ++i)
         s += data[i].value * dst(data[i].column);
 
       *dst_ptr = *src_ptr - s * om;
@@ -363,9 +368,9 @@ SparseMatrixEZ<number>::precondition_SSOR (Vector<somenumber>       &dst,
   dst_ptr = dst.begin()+dst.size()-1;
   for (rri = row_info.rbegin(); rri != rend; --dst_ptr, ++rri)
     {
-      const unsigned int end_row = rri->start + rri->length;
+      const size_type end_row = rri->start + rri->length;
       number s = 0;
-      for (unsigned int i=rri->start+rri->diagonal+1; i<end_row; ++i)
+      for (size_type i=rri->start+rri->diagonal+1; i<end_row; ++i)
         s += data[i].value * dst(data[i].column);
 
       *dst_ptr -= s * om;
@@ -381,15 +386,15 @@ SparseMatrixEZ<number>::memory_consumption() const
 {
   return
     sizeof (*this)
-    + sizeof(unsigned int) * row_info.capacity()
+    + sizeof(size_type) * row_info.capacity()
     + sizeof(typename SparseMatrixEZ<number>::Entry) * data.capacity();
 }
 
 
 
 template <typename number>
-unsigned int
-SparseMatrixEZ<number>::get_row_length (const unsigned int row) const
+typename SparseMatrixEZ<number>::size_type
+SparseMatrixEZ<number>::get_row_length (const size_type row) const
 {
   return row_info[row].length;
 }
@@ -397,14 +402,14 @@ SparseMatrixEZ<number>::get_row_length (const unsigned int row) const
 
 
 template <typename number>
-unsigned int
+typename SparseMatrixEZ<number>::size_type
 SparseMatrixEZ<number>::n_nonzero_elements() const
 {
   typename std::vector<RowInfo>::const_iterator row = row_info.begin();
   const typename std::vector<RowInfo>::const_iterator endrow = row_info.end();
 
   // Add up entries actually used
-  unsigned int used = 0;
+  size_type used = 0;
   for (; row != endrow ; ++ row)
     used += row->length;
   return used;
@@ -415,10 +420,10 @@ SparseMatrixEZ<number>::n_nonzero_elements() const
 template <typename number>
 void
 SparseMatrixEZ<number>::compute_statistics(
-  unsigned int &used,
-  unsigned int &allocated,
-  unsigned int &reserved,
-  std::vector<unsigned int> &used_by_line,
+  size_type &used,
+  size_type &allocated,
+  size_type &reserved,
+  std::vector<size_type> &used_by_line,
   const bool full) const
 {
   typename std::vector<RowInfo>::const_iterator row = row_info.begin();
@@ -426,7 +431,7 @@ SparseMatrixEZ<number>::compute_statistics(
 
   // Add up entries actually used
   used = 0;
-  unsigned int max_length = 0;
+  size_type max_length = 0;
   for (; row != endrow ; ++ row)
     {
       used += row->length;
@@ -503,9 +508,9 @@ SparseMatrixEZ<number>::print_formatted ( std::ostream          &out,
     }
 
   // TODO: Skip nonexisting entries
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      for (unsigned int j=0; j<n(); ++j)
+      for (size_type j=0; j<n(); ++j)
         {
           const Entry *entry = locate(i,j);
           if (entry)
index fca18fafd6104559931e5940a7f9d27c0c32662b..a7ceb20fef5e2d90c087eff6c9bb0692a5b4489c 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
-//    by the deal.II authors and Stephen "Cheffo" Kolaroff
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//---------------------------------------------------------------------------
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_mic_h
 #define __deal2__sparse_mic_h
 
@@ -41,6 +47,11 @@ template <typename number>
 class SparseMIC : public SparseLUDecomposition<number>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. Does nothing, so
    * you have to call @p decompose
@@ -197,7 +208,7 @@ private:
    * Compute the row-th "inner
    * sum".
    */
-  number get_rowsum (const unsigned int row) const;
+  number get_rowsum (const size_type row) const;
 };
 
 /*@}*/
index 69034c07baed0c4cf59bb327467a6197abf40392..dd9cd57c64ff44eb6abd1ad7029fdbefdbc7d174 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2011, 2012, 2013 by the deal.II authors
-//    by the deal.II authors and Stephen "Cheffo" Kolaroff
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//---------------------------------------------------------------------------
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_mic_templates_h
 #define __deal2__sparse_mic_templates_h
 
@@ -131,10 +137,10 @@ void SparseMIC<number>::decompose (const SparseMatrix<somenumber> &matrix,
   inner_sums.resize (this->m());
 
   // precalc sum(j=k+1, N, a[k][j]))
-  for (unsigned int row=0; row<this->m(); row++)
+  for (size_type row=0; row<this->m(); row++)
     inner_sums[row] = get_rowsum(row);
 
-  for (unsigned int row=0; row<this->m(); row++)
+  for (size_type row=0; row<this->m(); row++)
     {
       const number temp = this->begin(row)->value();
       number temp1 = 0;
@@ -158,7 +164,7 @@ void SparseMIC<number>::decompose (const SparseMatrix<somenumber> &matrix,
 
 template <typename number>
 inline number
-SparseMIC<number>::get_rowsum (const unsigned int row) const
+SparseMIC<number>::get_rowsum (const size_type row) const
 {
   Assert(this->m()==this->n(), ExcNotQuadratic());
 
@@ -184,13 +190,13 @@ SparseMIC<number>::vmult (Vector<somenumber>       &dst,
   Assert (dst.size() == src.size(), ExcDimensionMismatch(dst.size(), src.size()));
   Assert (dst.size() == this->m(), ExcDimensionMismatch(dst.size(), this->m()));
 
-  const unsigned int N=dst.size();
+  const size_type N=dst.size();
   // We assume the underlying matrix A is: A = X - L - U, where -L and -U are
   // strictly lower- and upper- diagonal parts of the system.
   //
   // Solve (X-L)X{-1}(X-U) x = b in 3 steps:
   dst = src;
-  for (unsigned int row=0; row<N; ++row)
+  for (size_type row=0; row<N; ++row)
     {
       // Now: (X-L)u = b
 
@@ -206,7 +212,7 @@ SparseMIC<number>::vmult (Vector<somenumber>       &dst,
     }
 
   // Now: v = Xu
-  for (unsigned int row=0; row<N; row++)
+  for (size_type row=0; row<N; row++)
     dst(row) *= diag[row];
 
   // x = (X-U)v
@@ -217,7 +223,7 @@ SparseMIC<number>::vmult (Vector<somenumber>       &dst,
            p = this->begin(row)+1;
            p != this->end(row);
            ++p)
-        if (p->column() > static_cast<unsigned int>(row))
+        if (p->column() > static_cast<size_type>(row))
           dst(row) -= p->value() * dst(p->column());
 
       dst(row) *= inv_diag[row];
index 0989a77bc71c046af8363f0673aa34b86eb29519..fba90664de9ad4bdfa1f9bc187c9b2f1a63e2a70 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_vanka_h
 #define __deal2__sparse_vanka_h
 
@@ -129,6 +134,11 @@ template<typename number>
 class SparseVanka
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. Gets the matrix
    * for preconditioning and a bit
@@ -309,8 +319,8 @@ private:
    * mode, several copies of this
    * function are spawned.
    */
-  void compute_inverses (const unsigned int begin,
-                         const unsigned int end);
+  void compute_inverses (const size_type begin,
+                         const size_type end);
 
   /**
    * Compute the inverse of the
@@ -326,8 +336,8 @@ private:
    * the case where this function
    * re-creates it each time.
    */
-  void compute_inverse (const unsigned int         row,
-                        std::vector<unsigned int> &local_indices);
+  void compute_inverse (const size_type         row,
+                        std::vector<size_type> &local_indices);
 
   /**
    * Make the derived class a
@@ -510,6 +520,11 @@ template<typename number>
 class SparseBlockVanka : public SparseVanka<number>
 {
 public:
+  /**
+   * Declate type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Enumeration of the different
    * methods by which the DoFs are
index 6ae96146b4b532b372c93dd13fb172e8b6cf7495..de72b05d8a9f7e6f9bd94b983fa718633beb04f8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparse_vanka_templates_h
 #define __deal2__sparse_vanka_templates_h
 
@@ -65,12 +70,12 @@ SparseVanka<number>::compute_inverses ()
 #ifndef DEAL_II_WITH_THREADS
   compute_inverses (0, matrix->m());
 #else
-  const unsigned int n_inverses = std::count (selected.begin(),
-                                              selected.end(),
-                                              true);
+  const size_type n_inverses = std::count (selected.begin(),
+                                           selected.end(),
+                                           true);
 
-  const unsigned int n_inverses_per_thread = std::max(n_inverses / n_threads,
-                                                      1U);
+  const size_type n_inverses_per_thread = std::max(n_inverses / n_threads,
+                                                   static_cast<size_type> (1U));
 
   // set up start and end index
   // for each of the
@@ -88,13 +93,13 @@ SparseVanka<number>::compute_inverses ()
   // consecutive, with other
   // consecutive regions where we
   // do not have to do something
-  std::vector<std::pair<unsigned int, unsigned int> > blocking (n_threads);
+  std::vector<std::pair<size_type, unsigned int> > blocking (n_threads);
 
   unsigned int c       = 0;
   unsigned int thread  = 0;
   blocking[0].first = 0;
 
-  for (unsigned int i=0; (i<matrix->m()) && (thread+1<n_threads); ++i)
+  for (size_type i=0; (i<matrix->m()) && (thread+1<n_threads); ++i)
     {
       if (selected[i] == true)
         ++c;
@@ -109,8 +114,8 @@ SparseVanka<number>::compute_inverses ()
     };
   blocking[n_threads-1].second = matrix->m();
 
-  typedef void (SparseVanka<number>::*FunPtr)(const unsigned int,
-                                              const unsigned int);
+  typedef void (SparseVanka<number>::*FunPtr)(const size_type,
+                                              const size_type);
   const FunPtr fun_ptr = &SparseVanka<number>::compute_inverses;
 
   // Now spawn the threads
@@ -126,17 +131,17 @@ SparseVanka<number>::compute_inverses ()
 
 template <typename number>
 void
-SparseVanka<number>::compute_inverses (const unsigned int begin,
-                                       const unsigned int end)
+SparseVanka<number>::compute_inverses (const size_type begin,
+                                       const size_type end)
 {
   // set-up the vector that will be used
   // by the functions which we call
   // below.
-  std::vector<unsigned int> local_indices;
+  std::vector<size_type> local_indices;
 
   // traverse all rows of the matrix
   // which are selected
-  for (unsigned int row=begin; row<end; ++row)
+  for (size_type row=begin; row<end; ++row)
     if (selected[row] == true)
       compute_inverse (row, local_indices);
 }
@@ -145,8 +150,8 @@ SparseVanka<number>::compute_inverses (const unsigned int begin,
 
 template <typename number>
 void
-SparseVanka<number>::compute_inverse (const unsigned int         row,
-                                      std::vector<unsigned int> &local_indices)
+SparseVanka<number>::compute_inverse (const size_type         row,
+                                      std::vector<size_type> &local_indices)
 {
   // first define an alias to the sparsity
   // pattern of the matrix, since this
@@ -154,14 +159,14 @@ SparseVanka<number>::compute_inverse (const unsigned int         row,
   const SparsityPattern &structure
     = matrix->get_sparsity_pattern();
 
-  const unsigned int row_length = structure.row_length(row);
+  const size_type row_length = structure.row_length(row);
 
   inverses[row] = new FullMatrix<float> (row_length, row_length);
 
   // collect the dofs that couple
   // with @p row
   local_indices.resize (row_length);
-  for (unsigned int i=0; i<row_length; ++i)
+  for (size_type i=0; i<row_length; ++i)
     local_indices[i] = structure.column_number(row, i);
 
   // Build local matrix
@@ -226,16 +231,16 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
   Vector<float> b (structure.max_entries_per_row());
   Vector<float> x (structure.max_entries_per_row());
 
-  std::map<unsigned int, unsigned int> local_index;
+  std::map<size_type, size_type> local_index;
 
   // traverse all rows of the matrix
   // which are selected
-  const unsigned int n = matrix->m();
-  for (unsigned int row=0; row<n; ++row)
+  const size_type n = matrix->m();
+  for (size_type row=0; row<n; ++row)
     if ((selected[row] == true) &&
         ((range_is_restricted == false) || ((*dof_mask)[row] == true)))
       {
-        const unsigned int row_length = structure.row_length(row);
+        const size_type row_length = structure.row_length(row);
 
         // if we don't store the
         // inverse matrices, then alias
@@ -264,21 +269,21 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
         // all degrees of freedom that
         // couple with @p row.
         local_index.clear ();
-        for (unsigned int i=0; i<row_length; ++i)
-          local_index.insert(std::pair<unsigned int, unsigned int>
+        for (size_type i=0; i<row_length; ++i)
+          local_index.insert(std::pair<size_type, size_type>
                              (structure.column_number(row, i), i));
 
         // Build local matrix and rhs
-        for (std::map<unsigned int, unsigned int>::const_iterator is=local_index.begin();
+        for (std::map<size_type, size_type>::const_iterator is=local_index.begin();
              is!=local_index.end(); ++is)
           {
             // irow loops over all DoFs that
             // couple with the present DoF
-            const unsigned int irow = is->first;
+            const size_type irow = is->first;
             // index of DoF irow in the matrix
             // row corresponding to DoF @p row.
             // runs between 0 and row_length
-            const unsigned int i = is->second;
+            const size_type i = is->second;
 
             // copy rhs
             b(i) = src(irow);
@@ -288,14 +293,14 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
             // number of DoFs coupling to
             // irow (including irow itself)
             for (typename SparseMatrix<number>::const_iterator p=matrix->begin(row);
-                p != matrix->end(row); ++p)
+                 p != matrix->end(row); ++p)
               {
                 // find out whether this DoF
                 // (that couples with @p irow,
                 // which itself couples with
                 // @p row) also couples with
                 // @p row.
-                const std::map<unsigned int, unsigned int>::const_iterator js
+                const std::map<size_type, size_type>::const_iterator js
                   = local_index.find(p->column());
                 // if not, then still use
                 // this dof to modify the rhs
@@ -324,11 +329,11 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
         inverses[row]->vmult(x,b);
 
         // Distribute new values
-        for (std::map<unsigned int, unsigned int>::const_iterator is=local_index.begin();
+        for (std::map<size_type, size_type>::const_iterator is=local_index.begin();
              is!=local_index.end(); ++is)
           {
-            const unsigned int irow = is->first;
-            const unsigned int i = is->second;
+            const size_type irow = is->first;
+            const size_type i = is->second;
 
             if (!range_is_restricted ||
                 ((*dof_mask)[irow] == true))
@@ -353,7 +358,7 @@ SparseVanka<number>::memory_consumption () const
 {
   std::size_t mem = (sizeof(*this) +
                      MemoryConsumption::memory_consumption (selected));
-  for (unsigned int i=0; i<inverses.size(); ++i)
+  for (size_type i=0; i<inverses.size(); ++i)
     mem += MemoryConsumption::memory_consumption (*inverses[i]);
 
   return mem;
@@ -387,14 +392,15 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
 {
   Assert (n_blocks > 0, ExcInternalError());
 
-  const unsigned int n_inverses = std::count (selected.begin(),
-                                              selected.end(),
-                                              true);
+  const size_type n_inverses = std::count (selected.begin(),
+                                           selected.end(),
+                                           true);
 
-  const unsigned int n_inverses_per_block = std::max(n_inverses / n_blocks, 1U);
+  const size_type n_inverses_per_block = std::max(n_inverses / n_blocks,
+                                                  static_cast<size_type> (1U));
 
   // precompute the splitting points
-  std::vector<std::pair<unsigned int, unsigned int> > intervals (n_blocks);
+  std::vector<std::pair<size_type, size_type> > intervals (n_blocks);
 
   // set up start and end index for
   // each of the blocks. note that
@@ -416,7 +422,7 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
       unsigned int block   = 0;
       intervals[0].first   = 0;
 
-      for (unsigned int i=0; (i<M.m()) && (block+1<n_blocks); ++i)
+      for (size_type i=0; (i<M.m()) && (block+1<n_blocks); ++i)
         {
           if (selected[i] == true)
             ++c;
@@ -464,16 +470,16 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
       // Lagrange dofs of each
       // block access the different
       // dofs
-      Table<2,unsigned int> access_count (n_blocks, M.m());
+      Table<2,size_type> access_count (n_blocks, M.m());
 
       // set-up the map that will
       // be used to store the
       // indices each Lagrange dof
       // accesses
-      std::map<unsigned int, unsigned int> local_index;
+      std::map<size_type, size_type> local_index;
       const SparsityPattern &structure = M.get_sparsity_pattern();
 
-      for (unsigned int row=0; row<M.m(); ++row)
+      for (size_type row=0; row<M.m(); ++row)
         if (selected[row] == true)
           {
             // first find out to
@@ -490,8 +496,8 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
             // dofs number the
             // present index wants
             // to write
-            const unsigned int row_length = structure.row_length(row);
-            for (unsigned int i=0; i<row_length; ++i)
+            const size_type row_length = structure.row_length(row);
+            for (size_type i=0; i<row_length; ++i)
               ++access_count[block_number][structure.column_number(row, i)];
           };
 
@@ -507,7 +513,7 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
       // the of course we leave it
       // to the block we put it
       // into in the first place
-      for (unsigned int row=0; row<M.m(); ++row)
+      for (size_type row=0; row<M.m(); ++row)
         if (selected[row] == true)
           {
             unsigned int block_number = 0;
@@ -521,7 +527,7 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
             // find out which block
             // accesses this dof
             // the most often
-            unsigned int max_accesses     = 0;
+            size_type max_accesses        = 0;
             unsigned int max_access_block = 0;
             for (unsigned int block=0; block<n_blocks; ++block)
               if (access_count[block][row] > max_accesses)
@@ -597,7 +603,7 @@ std::size_t
 SparseBlockVanka<number>::memory_consumption () const
 {
   std::size_t mem = SparseVanka<number>::memory_consumption();
-  for (unsigned int i=0; i<dof_masks.size(); ++i)
+  for (size_type i=0; i<dof_masks.size(); ++i)
     mem += MemoryConsumption::memory_consumption (dof_masks[i]);
   return mem;
 }
index 212038578d0130fa2aee1fd0280ac79528447049..b327e5b9ab8fa70b52b51b80eb7ae9700153219f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparsity_pattern_h
 #define __deal2__sparsity_pattern_h
 
@@ -51,13 +56,18 @@ namespace internals
 {
   namespace SparsityPatternTools
   {
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * Helper function to get the column index from a dereferenced iterator in
      * the copy_from() function, if the inner iterator type points to plain
      * unsigned integers.
      */
-    unsigned int
-    get_column_index_from_iterator (const unsigned int i);
+    size_type
+    get_column_index_from_iterator (const size_type i);
 
     /**
      * Helper function to get the column index from a dereferenced iterator in
@@ -65,8 +75,8 @@ namespace internals
      * unsigned integers and some other value.
      */
     template <typename value>
-    unsigned int
-    get_column_index_from_iterator (const std::pair<unsigned int, value> &i);
+    size_type
+    get_column_index_from_iterator (const std::pair<size_type, value> &i);
 
     /**
      * Likewise, but sometimes needed for certain types of containers that
@@ -74,8 +84,8 @@ namespace internals
      * <tt>std::map</tt>).
      */
     template <typename value>
-    unsigned int
-    get_column_index_from_iterator (const std::pair<const unsigned int, value> &i);
+    size_type
+    get_column_index_from_iterator (const std::pair<const size_type, value> &i);
 
   }
 }
@@ -89,6 +99,11 @@ namespace SparsityPatternIterators
   // forward declaration
   class Iterator;
 
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Accessor class for iterators into sparsity patterns. This class is
    * also the base class for both const and non-const accessor classes
@@ -112,8 +127,8 @@ namespace SparsityPatternIterators
      * with a global index instead.
      */
     Accessor (const SparsityPattern *matrix,
-              const unsigned int     row,
-              const unsigned int     index) DEAL_II_DEPRECATED;
+              const size_type        row,
+              const size_type        index) DEAL_II_DEPRECATED;
 
     /**
      * Constructor.
@@ -130,19 +145,19 @@ namespace SparsityPatternIterators
      * Row number of the element represented by this object. This function can
      * only be called for entries for which is_valid_entry() is true.
      */
-    unsigned int row () const;
+    size_type row () const;
 
     /**
      * Index within the current row of the element represented by this object. This function
      * can only be called for entries for which is_valid_entry() is true.
      */
-    unsigned int index () const;
+    size_type index () const;
 
     /**
      * Column number of the element represented by this object. This function
      * can only be called for entries for which is_valid_entry() is true.
      */
-    unsigned int column () const;
+    size_type column () const;
 
     /**
      * Return whether the sparsity pattern entry pointed to by this iterator
@@ -237,8 +252,8 @@ namespace SparsityPatternIterators
      * with a global index instead.
      */
     Iterator (const SparsityPattern *sp,
-              const unsigned int     row,
-              const unsigned int     index) DEAL_II_DEPRECATED;
+              const size_type        row,
+              const size_type        index) DEAL_II_DEPRECATED;
 
     /**
      * Constructor. Create an iterator into the sparsity pattern @p sp for the
@@ -334,6 +349,11 @@ namespace SparsityPatternIterators
 class SparsityPattern : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Typedef an iterator class that allows to walk over all nonzero elements
    * of a sparsity pattern.
@@ -349,7 +369,7 @@ public:
    * @deprecated This typedef is deprecated. Use proper iterators instead.
    */
   typedef
-  const unsigned int *row_iterator;
+  const size_type *row_iterator;
 
   /**
    * Typedef an iterator class that allows to walk over all nonzero elements
@@ -377,7 +397,7 @@ public:
    * perform some optimizations, but the actual value of the variable may
    * change over time.
    */
-  static const unsigned int invalid_entry = numbers::invalid_unsigned_int;
+  static const size_type invalid_entry = numbers::invalid_size_type;
 
   /**
    * @name Construction and setup
@@ -419,8 +439,8 @@ public:
    * @deprecated Use the constructor without the last argument since
    *   it is ignored.
    */
-  SparsityPattern (const unsigned int m,
-                   const unsigned int n,
+  SparsityPattern (const size_type m,
+                   const size_type n,
                    const unsigned int max_per_row,
                    const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
@@ -431,8 +451,8 @@ public:
    * @arg n number of columns
    * @arg max_per_row maximum number of nonzero entries per row
    */
-  SparsityPattern (const unsigned int m,
-                   const unsigned int n,
+  SparsityPattern (const size_type m,
+                   const size_type n,
                    const unsigned int max_per_row);
 
   /**
@@ -447,8 +467,8 @@ public:
    * @deprecated Use the constructor without the last argument since
    *   it is ignored.
    */
-  SparsityPattern (const unsigned int               m,
-                   const unsigned int               n,
+  SparsityPattern (const size_type               m,
+                   const size_type               n,
                    const std::vector<unsigned int> &row_lengths,
                    const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
@@ -460,8 +480,8 @@ public:
    * @arg row_lengths possible number of nonzero entries for each row.  This
    * vector must have one entry for each row.
    */
-  SparsityPattern (const unsigned int               m,
-                   const unsigned int               n,
+  SparsityPattern (const size_type               m,
+                   const size_type               n,
                    const std::vector<unsigned int> &row_lengths);
 
   /**
@@ -472,7 +492,7 @@ public:
    * elements. To avoid this, use the constructor taking row and column
    * numbers separately.
    */
-  SparsityPattern (const unsigned int n,
+  SparsityPattern (const size_type n,
                    const unsigned int max_per_row);
 
   /**
@@ -486,7 +506,7 @@ public:
    * @deprecated Use the constructor without the last argument since
    *   it is ignored.
    */
-  SparsityPattern (const unsigned int               m,
+  SparsityPattern (const size_type               m,
                    const std::vector<unsigned int> &row_lengths,
                    const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
@@ -497,7 +517,7 @@ public:
    * @arg row_lengths possible number of nonzero entries for each row.  This
    * vector must have one entry for each row.
    */
-  SparsityPattern (const unsigned int               m,
+  SparsityPattern (const size_type               m,
                    const std::vector<unsigned int> &row_lengths);
 
   /**
@@ -523,8 +543,8 @@ public:
    * compressed after this function finishes.
    */
   SparsityPattern (const SparsityPattern  &original,
-                   const unsigned int      max_per_row,
-                   const unsigned int      extra_off_diagonals);
+                   const unsigned int        max_per_row,
+                   const size_type        extra_off_diagonals);
 
   /**
    * Destructor.
@@ -549,8 +569,8 @@ public:
    * @deprecated The last argument of this function is ignored. Use the
    *     version of this function without the last argument.
    */
-  void reinit (const unsigned int m,
-               const unsigned int n,
+  void reinit (const size_type m,
+               const size_type n,
                const unsigned int max_per_row,
                const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
@@ -562,8 +582,8 @@ public:
    * This function simply maps its operations to the other <tt>reinit</tt>
    * function.
    */
-  void reinit (const unsigned int m,
-               const unsigned int n,
+  void reinit (const size_type m,
+               const size_type n,
                const unsigned int max_per_row);
 
   /**
@@ -583,8 +603,8 @@ public:
    * @deprecated The last argument of this function is ignored. Use the
    *     version of this function without the last argument.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
+  void reinit (const size_type               m,
+               const size_type               n,
                const std::vector<unsigned int> &row_lengths,
                const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
@@ -602,8 +622,8 @@ public:
    * is true, diagonal elements are stored first in each row to allow
    * optimized access in relaxation methods of SparseMatrix.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
+  void reinit (const size_type               m,
+               const size_type               n,
                const std::vector<unsigned int> &row_lengths);
 
   /**
@@ -612,16 +632,16 @@ public:
    * @deprecated The last argument of this function is ignored. Use the
    *     version of this function without the last argument.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
+  void reinit (const size_type                                   m,
+               const size_type                                   n,
                const VectorSlice<const std::vector<unsigned int> > &row_lengths,
                const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
    * Same as above, but with a VectorSlice argument instead.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
+  void reinit (const size_type                                   m,
+               const size_type                                   n,
                const VectorSlice<const std::vector<unsigned int> > &row_lengths);
 
   /**
@@ -718,8 +738,8 @@ public:
    *     version of this function without the last argument.
    */
   template <typename ForwardIterator>
-  void copy_from (const unsigned int    n_rows,
-                  const unsigned int    n_cols,
+  void copy_from (const size_type       n_rows,
+                  const size_type       n_cols,
                   const ForwardIterator begin,
                   const ForwardIterator end,
                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
@@ -801,8 +821,8 @@ public:
    * iterators that point to such pairs.
    */
   template <typename ForwardIterator>
-  void copy_from (const unsigned int    n_rows,
-                  const unsigned int    n_cols,
+  void copy_from (const size_type n_rows,
+                  const size_type n_cols,
                   const ForwardIterator begin,
                   const ForwardIterator end);
 
@@ -867,8 +887,8 @@ public:
    *
    * If the entry already exists, nothing bad happens.
    */
-  void add (const unsigned int i,
-            const unsigned int j);
+  void add (const size_type i,
+            const size_type j);
 
   /**
    * Add several nonzero entries to the specified matrix row.  This function
@@ -877,10 +897,10 @@ public:
    * If some of the entries already exist, nothing bad happens.
    */
   template <typename ForwardIterator>
-  void add_entries (const unsigned int row,
-                    ForwardIterator    begin,
-                    ForwardIterator    end,
-                    const bool         indices_are_sorted = false);
+  void add_entries (const size_type row,
+                    ForwardIterator begin,
+                    ForwardIterator end,
+                    const bool      indices_are_sorted = false);
 
 // @}
   /**
@@ -914,7 +934,7 @@ public:
    * Note also the discussion in the general documentation of this class about
    * the order in which elements are accessed.
    */
-  iterator begin (const unsigned int r) const;
+  iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row <tt>r</tt>. It points to the first element past the
@@ -924,7 +944,7 @@ public:
    * particular the case if it is the end iterator for the last row of a
    * matrix.
    */
-  iterator end (const unsigned int r) const;
+  iterator end (const size_type r) const;
 
   /**
    * STL-like iterator with the first entry of row <tt>r</tt>.
@@ -937,7 +957,7 @@ public:
    * @deprecated Use the iterators provided by the begin() and end()
    * functions instead.
    */
-  row_iterator row_begin (const unsigned int r) const DEAL_II_DEPRECATED;
+  row_iterator row_begin (const size_type r) const DEAL_II_DEPRECATED;
 
   /**
    * Final iterator of row <tt>r</tt>. It points to the first element past the
@@ -950,7 +970,7 @@ public:
    * @deprecated Use the iterators provided by the begin() and end()
    * functions instead.
    */
-  row_iterator row_end (const unsigned int r) const DEAL_II_DEPRECATED;
+  row_iterator row_end (const size_type r) const DEAL_II_DEPRECATED;
 
 // @}
   /**
@@ -973,7 +993,7 @@ public:
    * equals the number given to the constructor, while after compression, it
    * equals the maximum number of entries actually allocated by the user.
    */
-  unsigned int max_entries_per_row () const;
+  size_type max_entries_per_row () const;
 
   /**
    * Compute the bandwidth of the matrix represented by this structure. The
@@ -981,7 +1001,7 @@ public:
    * represents a nonzero entry of the matrix. Consequently, the maximum
    * bandwidth a $n\times m$ matrix can have is $\max\{n-1,m-1\}$.
    */
-  unsigned int bandwidth () const;
+  size_type bandwidth () const;
 
   /**
    * Return the number of nonzero elements of this matrix. Actually, it
@@ -991,7 +1011,7 @@ public:
    * This function may only be called if the matrix struct is compressed. It
    * does not make too much sense otherwise anyway.
    */
-  std::size_t n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return whether the structure is compressed or not.
@@ -1002,18 +1022,18 @@ public:
    * Return number of rows of this matrix, which equals the dimension of the
    * image space.
    */
-  unsigned int n_rows () const;
+  size_type n_rows () const;
 
   /**
    * Return number of columns of this matrix, which equals the dimension of
    * the range space.
    */
-  unsigned int n_cols () const;
+  size_type n_cols () const;
 
   /**
    * Number of entries in a specific row.
    */
-  unsigned int row_length (const unsigned int row) const;
+  unsigned int row_length (const size_type row) const;
 
   /**
    * Determine whether the matrix uses the special convention for quadratic
@@ -1071,8 +1091,8 @@ public:
    * single row. In such cases, it is more efficient to use iterators over
    * the elements of the sparsity pattern or of the sparse matrix.
    */
-  unsigned int operator() (const unsigned int i,
-                           const unsigned int j) const;
+  size_type operator() (const size_type i,
+                        const size_type j) const;
 
   /**
    * This is the inverse operation to operator()(): given a global index, find
@@ -1085,14 +1105,14 @@ public:
    * If <tt>N</tt> is the number of rows of this matrix, then the complexity
    * of this function is <i>log(N)</i>.
    */
-  std::pair<unsigned int, unsigned int>
-  matrix_position (const unsigned int global_index) const;
+  std::pair<size_type, size_type>
+  matrix_position (const size_type global_index) const;
 
   /**
    * Check if a value at a certain position may be non-zero.
    */
-  bool exists (const unsigned int i,
-               const unsigned int j) const;
+  bool exists (const size_type i,
+               const size_type j) const;
 
   /**
    * The index of a global matrix entry in its row.
@@ -1101,8 +1121,8 @@ public:
    * with respect to the total field, but only with respect to the row
    * <tt>j</tt>.
    */
-  unsigned int row_position(const unsigned int i,
-                            const unsigned int j) const;
+  size_type row_position(const size_type i,
+                         const size_type j) const;
 
   /**
    * Access to column number field.  Return the column number of the
@@ -1115,8 +1135,8 @@ public:
    * i.e. <tt>column_number(row,i)</tt> <tt><</tt>
    * <tt>column_number(row,i+1)</tt>.
    */
-  unsigned int column_number (const unsigned int row,
-                              const unsigned int index) const;
+  size_type column_number (const size_type row,
+                           const unsigned int index) const;
 
 
 // @}
@@ -1268,7 +1288,7 @@ public:
    * yourself, you should also rename this function to avoid programs relying
    * on outdated information!
    */
-  const unsigned int *get_column_numbers () const DEAL_II_DEPRECATED;
+  const size_type *get_column_numbers () const DEAL_II_DEPRECATED;
 
   BOOST_SERIALIZATION_SPLIT_MEMBER()
   /** @addtogroup Exceptions
@@ -1326,24 +1346,24 @@ private:
    * be larger than #rows and in this case #rowstart has more elements than
    * are used.
    */
-  unsigned int max_dim;
+  size_type max_dim;
 
   /**
    * Number of rows that this sparsity structure shall represent.
    */
-  unsigned int rows;
+  size_type rows;
 
   /**
    * Number of columns that this sparsity structure shall represent.
    */
-  unsigned int cols;
+  size_type cols;
 
   /**
    * Size of the actually allocated array #colnums. Here, the same applies as
    * for the #rowstart array, i.e. it may be larger than the actually used
    * part of the array.
    */
-  std::size_t max_vec_len;
+  size_type max_vec_len;
 
   /**
    * Maximum number of elements per row. This is set to the value given to the
@@ -1375,7 +1395,7 @@ private:
    * <i>r</i> are stored within the index range
    * #rowstart[<i>r</i>]...#rowstart[<i>r+1</i>]. Therefore to find out
    * whether a given element (<i>r,c</i>) exists, we have to check whether the
-   * column number <i>c</i> exists in the abovementioned range within this
+   * column number <i>c</i> exists in the above-mentioned range within this
    * array. If it exists, say at position <i>p</i> within this array, the
    * value of the respective element in the sparse matrix will also be at
    * position <i>p</i> of the values array of that class.
@@ -1391,7 +1411,7 @@ private:
    * sorted, such that finding whether an element exists and determining its
    * position can be done by a binary search.
    */
-  unsigned int *colnums;
+  size_type *colnums;
 
   /**
    * Store whether the compress() function was called for this object.
@@ -1434,8 +1454,8 @@ namespace SparsityPatternIterators
   inline
   Accessor::
   Accessor (const SparsityPattern *sparsity_pattern,
-            const unsigned int     r,
-            const unsigned int     i)
+            const size_type        r,
+            const size_type        i)
     :
     sparsity_pattern(sparsity_pattern),
     index_within_sparsity(sparsity_pattern->rowstart[r]+i)
@@ -1473,12 +1493,12 @@ namespace SparsityPatternIterators
 
 
   inline
-  unsigned int
+  size_type
   Accessor::row() const
   {
     Assert (is_valid_entry() == true, ExcInvalidIterator());
 
-    const std::size_t * insert_point =
+    const std::size_t *insert_point =
       std::upper_bound(sparsity_pattern->rowstart,
                        sparsity_pattern->rowstart + sparsity_pattern->rows + 1,
                        index_within_sparsity);
@@ -1487,7 +1507,7 @@ namespace SparsityPatternIterators
 
 
   inline
-  unsigned int
+  size_type
   Accessor::column() const
   {
     Assert (is_valid_entry() == true, ExcInvalidIterator());
@@ -1497,7 +1517,7 @@ namespace SparsityPatternIterators
 
 
   inline
-  unsigned int
+  size_type
   Accessor::index() const
   {
     Assert (is_valid_entry() == true, ExcInvalidIterator());
@@ -1542,8 +1562,8 @@ namespace SparsityPatternIterators
 
   inline
   Iterator::Iterator (const SparsityPattern *sparsity_pattern,
-                      const unsigned int     r,
-                      const unsigned int     i)
+                      const size_type        r,
+                      const size_type        i)
     :
     accessor(sparsity_pattern, sparsity_pattern->rowstart[r]+i)
   {}
@@ -1654,9 +1674,9 @@ SparsityPattern::end () const
 
 inline
 SparsityPattern::iterator
-SparsityPattern::begin (const unsigned int r) const
+SparsityPattern::begin (const size_type r) const
 {
-  Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()));
+  Assert (r<n_rows(), ExcIndexRangeType<size_type>(r,0,n_rows()));
 
   return iterator(this, rowstart[r]);
 }
@@ -1665,9 +1685,9 @@ SparsityPattern::begin (const unsigned int r) const
 
 inline
 SparsityPattern::iterator
-SparsityPattern::end (const unsigned int r) const
+SparsityPattern::end (const size_type r) const
 {
-  Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()));
+  Assert (r<n_rows(), ExcIndexRangeType<size_type>(r,0,n_rows()));
 
   return iterator(this, rowstart[r+1]);
 }
@@ -1676,9 +1696,9 @@ SparsityPattern::end (const unsigned int r) const
 
 inline
 SparsityPattern::row_iterator
-SparsityPattern::row_begin (const unsigned int r) const
+SparsityPattern::row_begin (const size_type r) const
 {
-  Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()));
+  Assert (r<n_rows(), ExcIndexRangeType<size_type>(r,0,n_rows()));
   return &colnums[rowstart[r]];
 }
 
@@ -1686,16 +1706,16 @@ SparsityPattern::row_begin (const unsigned int r) const
 
 inline
 SparsityPattern::row_iterator
-SparsityPattern::row_end (const unsigned int r) const
+SparsityPattern::row_end (const size_type r) const
 {
-  Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()));
+  Assert (r<n_rows(), ExcIndexRangeType<size_type>(r,0,n_rows()));
   return &colnums[rowstart[r+1]];
 }
 
 
 
 inline
-unsigned int
+SparsityPattern::size_type
 SparsityPattern::n_rows () const
 {
   return rows;
@@ -1703,7 +1723,7 @@ SparsityPattern::n_rows () const
 
 
 inline
-unsigned int
+SparsityPattern::size_type
 SparsityPattern::n_cols () const
 {
   return cols;
@@ -1743,7 +1763,7 @@ SparsityPattern::get_rowstart_indices () const
 
 
 inline
-const unsigned int *
+const SparsityPattern::size_type *
 SparsityPattern::get_column_numbers () const
 {
   return colnums;
@@ -1753,20 +1773,20 @@ SparsityPattern::get_column_numbers () const
 
 inline
 unsigned int
-SparsityPattern::row_length (const unsigned int row) const
+SparsityPattern::row_length (const size_type row) const
 {
-  Assert(row<rows, ExcIndexRange(row,0,rows));
+  Assert(row<rows, ExcIndexRangeType<size_type>(row,0,rows));
   return rowstart[row+1]-rowstart[row];
 }
 
 
 
 inline
-unsigned int
-SparsityPattern::column_number (const unsigned int row,
+SparsityPattern::size_type
+SparsityPattern::column_number (const size_type row,
                                 const unsigned int index) const
 {
-  Assert(row<rows, ExcIndexRange(row,0,rows));
+  Assert(row<rows, ExcIndexRangeType<size_type>(row,0,rows));
   Assert(index<row_length(row), ExcIndexRange(index,0,row_length(row)));
 
   return colnums[rowstart[row]+index];
@@ -1774,7 +1794,7 @@ SparsityPattern::column_number (const unsigned int row,
 
 
 inline
-std::size_t
+SparsityPattern::size_type
 SparsityPattern::n_nonzero_elements () const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
@@ -1811,7 +1831,7 @@ SparsityPattern::load (Archive &ar, const unsigned int)
   ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed &store_diagonal_first_in_row;
 
   rowstart = new std::size_t [max_dim + 1];
-  colnums = new unsigned int [max_vec_len];
+  colnums = new size_type [max_vec_len];
 
   ar &boost::serialization::make_array(rowstart, max_dim + 1);
   ar &boost::serialization::make_array(colnums, max_vec_len);
@@ -1833,11 +1853,11 @@ SparsityPattern::operator == (const SparsityPattern &sp2)  const
       store_diagonal_first_in_row != sp2.store_diagonal_first_in_row)
     return false;
 
-  for (unsigned int i = 0; i < rows+1; ++i)
+  for (size_type i = 0; i < rows+1; ++i)
     if (rowstart[i] != sp2.rowstart[i])
       return false;
 
-  for (unsigned int i = 0; i < rowstart[rows]; ++i)
+  for (size_type i = 0; i < rowstart[rows]; ++i)
     if (colnums[i] != sp2.colnums[i])
       return false;
 
@@ -1850,9 +1870,14 @@ namespace internal
 {
   namespace SparsityPatternTools
   {
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     inline
-    unsigned int
-    get_column_index_from_iterator (const unsigned int i)
+    size_type
+    get_column_index_from_iterator (const size_type i)
     {
       return i;
     }
@@ -1861,8 +1886,8 @@ namespace internal
 
     template <typename value>
     inline
-    unsigned int
-    get_column_index_from_iterator (const std::pair<unsigned int, value> &i)
+    size_type
+    get_column_index_from_iterator (const std::pair<size_type, value> &i)
     {
       return i.first;
     }
@@ -1871,8 +1896,8 @@ namespace internal
 
     template <typename value>
     inline
-    unsigned int
-    get_column_index_from_iterator (const std::pair<const unsigned int, value> &i)
+    size_type
+    get_column_index_from_iterator (const std::pair<const size_type, value> &i)
     {
       return i.first;
     }
@@ -1883,8 +1908,8 @@ namespace internal
 
 template <typename ForwardIterator>
 void
-SparsityPattern::copy_from (const unsigned int    n_rows,
-                            const unsigned int    n_cols,
+SparsityPattern::copy_from (const size_type       n_rows,
+                            const size_type       n_cols,
                             const ForwardIterator begin,
                             const ForwardIterator end,
                             const bool)
@@ -1896,12 +1921,12 @@ SparsityPattern::copy_from (const unsigned int    n_rows,
 
 template <typename ForwardIterator>
 void
-SparsityPattern::copy_from (const unsigned int    n_rows,
-                            const unsigned int    n_cols,
+SparsityPattern::copy_from (const size_type       n_rows,
+                            const size_type       n_cols,
                             const ForwardIterator begin,
                             const ForwardIterator end)
 {
-  Assert (static_cast<unsigned int>(std::distance (begin, end)) == n_rows,
+  Assert (static_cast<size_type>(std::distance (begin, end)) == n_rows,
           ExcIteratorRange (std::distance (begin, end), n_rows));
 
   // first determine row lengths for each row. if the matrix is quadratic,
@@ -1922,15 +1947,15 @@ SparsityPattern::copy_from (const unsigned int    n_rows,
   //
   // for use in the inner loop, we define a typedef to the type of the inner
   // iterators
-  unsigned int row = 0;
+  size_type row = 0;
   typedef typename std::iterator_traits<ForwardIterator>::value_type::const_iterator inner_iterator;
   for (ForwardIterator i=begin; i!=end; ++i, ++row)
     {
-      unsigned int *cols = &colnums[rowstart[row]] + (is_square ? 1 : 0);
+      size_type *cols = &colnums[rowstart[row]] + (is_square ? 1 : 0);
       const inner_iterator end_of_row = i->end();
       for (inner_iterator j=i->begin(); j!=end_of_row; ++j)
         {
-          const unsigned int col
+          const size_type col
             = internal::SparsityPatternTools::get_column_index_from_iterator(*j);
           Assert (col < n_cols, ExcIndexRange(col,0,n_cols));
 
index 38567d370269b61f93b6e55929bd39e4965cf5fb..46b7d07308947b61d37cc22fff82f455c51c18ce 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__sparsity_tools_h
 #define __deal2__sparsity_tools_h
 
@@ -41,6 +46,11 @@ class SparsityPattern;
 */
 namespace SparsityTools
 {
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Use the METIS partitioner to generate
    * a partitioning of the degrees of
@@ -191,8 +201,8 @@ namespace SparsityTools
    */
   void
   reorder_Cuthill_McKee (const SparsityPattern     &sparsity,
-                         std::vector<unsigned int> &new_indices,
-                         const std::vector<unsigned int> &starting_indices = std::vector<unsigned int>());
+                         std::vector<size_type> &new_indices,
+                         const std::vector<size_type> &starting_indices = std::vector<size_type>());
 
 
 #ifdef DEAL_II_WITH_MPI
@@ -237,7 +247,7 @@ namespace SparsityTools
    */
   template <class CSP_t>
   void distribute_sparsity_pattern(CSP_t &csp,
-                                   const std::vector<unsigned int> &rows_per_cpu,
+                                   const std::vector<size_type> &rows_per_cpu,
                                    const MPI_Comm &mpi_comm,
                                    const IndexSet &myrange);
 #endif
index 02db61b6254705d5adfa7dda0e1e5ba397e01c7f..0100ba8b7b822ce9b9ad55a02792b44b2a84efc9 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__swappable_vector_h
 #define __deal2__swappable_vector_h
 
index 8be2192a61bbb6aeaa5336968a2ab05bd64da7bd..b73414b2397166e606643fb5e64f59834d09d381 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__swappable_vector_templates_h
 #define __deal2__swappable_vector_templates_h
 
index eb9e2b78c82db6fefb1b7deb71f96e6469a0c751..6558e6a3b801364a7440cdfe803ee53ebae725e2 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__transpose_matrix_h
 #define __deal2__transpose_matrix_h
 
index 163b2cfa3460bcfd5364ebdbf1d906782ba21fd2..8b31214933cffcf63227321ee0ac889817b33852 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__tridiagonal_matrix_h
 #define __deal2__tridiagonal_matrix_h
 
@@ -45,6 +50,11 @@ template<typename number>
 class TridiagonalMatrix
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * @name Constructors and initalization.
    */
@@ -53,7 +63,7 @@ public:
    * empty matrix of dimension
    * <tt>n</tt>.
    */
-  TridiagonalMatrix(unsigned int n = 0,
+  TridiagonalMatrix(size_type    n = 0,
                     bool symmetric = false);
 
   /**
@@ -62,7 +72,7 @@ public:
    * to zero. The symmetry
    * properties may be set as well.
    */
-  void reinit(unsigned int n,
+  void reinit(size_type n,
               bool symmetric = false);
 
 
@@ -75,14 +85,14 @@ public:
    * To remember: this matrix is an
    * <i>m x m</i>-matrix.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Number of columns of this matrix.
    * To remember: this matrix is an
    * <i>n x n</i>-matrix.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Return whether the matrix
@@ -107,7 +117,7 @@ public:
    * the case where <i>|i-j| <=
    * 1</i>.
    */
-  number operator()(unsigned int i, unsigned int j) const;
+  number operator()(size_type i, size_type j) const;
 
   /**
    * Read-write access to a
@@ -124,7 +134,7 @@ public:
    * for matrix assembling in order
    * not to obtain doubled entries.
    */
-  number &operator()(unsigned int i, unsigned int j);
+  number &operator()(size_type i, size_type j);
 
 //@}
 ///@name Multiplications with vectors
@@ -294,7 +304,7 @@ public:
    * compute_eigenvalues(), you can
    * access each eigenvalue here.
    */
-  number eigenvalue(const unsigned int i) const;
+  number eigenvalue(const size_type i) const;
 //@}
 ///@name Miscellanea
 //@{
@@ -375,7 +385,7 @@ private:
 #ifndef DOXYGEN
 
 template<typename number>
-unsigned int
+types::global_dof_index
 TridiagonalMatrix<number>::m() const
 {
   return diagonal.size();
@@ -384,7 +394,7 @@ TridiagonalMatrix<number>::m() const
 
 
 template<typename number>
-unsigned int
+types::global_dof_index
 TridiagonalMatrix<number>::n() const
 {
   return diagonal.size();
@@ -394,7 +404,7 @@ TridiagonalMatrix<number>::n() const
 template<typename number>
 inline
 number
-TridiagonalMatrix<number>::operator()(unsigned int i, unsigned int j) const
+TridiagonalMatrix<number>::operator()(size_type i, size_type j) const
 {
   Assert(i<n(), ExcIndexRange(i,0,n()));
   Assert(j<n(), ExcIndexRange(j,0,n()));
@@ -422,7 +432,7 @@ TridiagonalMatrix<number>::operator()(unsigned int i, unsigned int j) const
 template<typename number>
 inline
 number &
-TridiagonalMatrix<number>::operator()(unsigned int i, unsigned int j)
+TridiagonalMatrix<number>::operator()(size_type i, size_type j)
 {
   Assert(i<n(), ExcIndexRange(i,0,n()));
   Assert(j<n(), ExcIndexRange(j,0,n()));
@@ -455,7 +465,7 @@ TridiagonalMatrix<number>::print (
   const unsigned int width,
   const unsigned int) const
 {
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     {
       if (i>0)
         s << std::setw(width) << (*this)(i,i-1);
index 1550c8a246ddd73aba7eefd4460acd7e77326bf8..99d19b118a5c6cf3d52f51cb27a2140b31ff63f7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_block_sparse_matrix_h
 #define __deal2__trilinos_block_sparse_matrix_h
 
@@ -176,8 +181,8 @@ namespace TrilinosWrappers
      * user call whatever function
      * she desires.
      */
-    void reinit (const unsigned int n_block_rows,
-                 const unsigned int n_block_columns);
+    void reinit (const size_type n_block_rows,
+                 const size_type n_block_columns);
 
     /**
      * Resize the matrix, by using an
@@ -290,7 +295,7 @@ namespace TrilinosWrappers
      * elements of this
      * matrix.
      */
-    unsigned int n_nonzero_elements () const;
+    size_type n_nonzero_elements () const;
 
     /**
      * Matrix-vector multiplication: let $dst = M*src$ with $M$ being this
@@ -547,8 +552,8 @@ namespace TrilinosWrappers
   {
     Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
 
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         this->block(r,c) = d;
 
     return *this;
@@ -561,8 +566,8 @@ namespace TrilinosWrappers
   BlockSparseMatrix::is_compressed () const
   {
     bool compressed = true;
-    for (unsigned int row=0; row<n_block_rows(); ++row)
-      for (unsigned int col=0; col<n_block_cols(); ++col)
+    for (size_type row=0; row<n_block_rows(); ++row)
+      for (size_type col=0; col<n_block_cols(); ++col)
         if (block(row, col).is_compressed() == false)
           {
             compressed = false;
index 378a4a0d716a46fdc719b23e8b40b5c02127e26b..9006b134c22d983fb62b9fd8dc8c44de4dc0c840 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_block_vector_h
 #define __deal2__trilinos_block_vector_h
 
@@ -146,7 +151,7 @@ namespace TrilinosWrappers
      * fill appropriate data using a
      * reinit of the blocks.
      */
-    explicit BlockVector (const unsigned int num_blocks);
+    explicit BlockVector (const size_type num_blocks);
 
     /**
      * Constructor. Set the number of
@@ -156,7 +161,7 @@ namespace TrilinosWrappers
      *
      * References BlockVector.reinit().
      */
-    explicit BlockVector (const std::vector<unsigned int> &N);
+    explicit BlockVector (const std::vector<size_type> &N);
 
     /**
      * Constructor. Set the number of
@@ -177,9 +182,9 @@ namespace TrilinosWrappers
      * different blocks.
      */
     template <typename InputIterator>
-    BlockVector (const std::vector<unsigned int> &n,
-                 const InputIterator              first,
-                 const InputIterator              end);
+    BlockVector (const std::vector<size_type> &n,
+                 const InputIterator           first,
+                 const InputIterator           end);
 
     /**
      * Destructor. Clears memory
@@ -308,14 +313,12 @@ namespace TrilinosWrappers
      * If <tt>fast==false</tt>, the vector
      * is filled with zeros.
      */
-    void reinit (const std::vector<unsigned int> &N,
-                 const bool                       fast=false);
+    void reinit (const std::vector<size_type> &N,
+                 const bool                    fast=false);
 
     /**
-     * Reinit the function
-     * according to a distributed
-     * block vector. The elements
-     * will be copied in this
+     * Reinitialize the vector in the same way as the given to a
+     * distributed block vector. The elements will be copied in this
      * process.
      */
     void reinit (const MPI::BlockVector &V);
@@ -360,7 +363,7 @@ namespace TrilinosWrappers
      * calls <tt>collect_sizes</tt>
      * afterwards.
      */
-    void reinit (const unsigned int num_blocks);
+    void reinit (const size_type num_blocks);
 
     /**
      * Swap the contents of this
@@ -454,7 +457,7 @@ namespace TrilinosWrappers
 
 
   inline
-  BlockVector::BlockVector (const std::vector<unsigned int> &N)
+  BlockVector::BlockVector (const std::vector<size_type> &N)
   {
     reinit (N);
   }
@@ -462,21 +465,21 @@ namespace TrilinosWrappers
 
 
   template <typename InputIterator>
-  BlockVector::BlockVector (const std::vector<unsigned int> &n,
-                            const InputIterator              first,
-                            const InputIterator              end)
+  BlockVector::BlockVector (const std::vector<size_type> &n,
+                            const InputIterator           first,
+                            const InputIterator           end)
   {
     // first set sizes of blocks, but
     // don't initialize them as we will
     // copy elements soon
     reinit (n, true);
     InputIterator start = first;
-    for (unsigned int b=0; b<n.size(); ++b)
+    for (size_type b=0; b<n.size(); ++b)
       {
         InputIterator end = start;
-        std::advance (end, static_cast<signed int>(n[b]));
+        std::advance (end, static_cast<size_type>(n[b]));
 
-        for (unsigned int i=0; i<n[b]; ++i, ++start)
+        for (size_type i=0; i<n[b]; ++i, ++start)
           this->block(b)(i) = *start;
       }
     Assert (start == end, ExcIteratorRangeDoesNotMatchVectorSize());
@@ -485,7 +488,7 @@ namespace TrilinosWrappers
 
 
   inline
-  BlockVector::BlockVector (const unsigned int num_blocks)
+  BlockVector::BlockVector (const size_type num_blocks)
   {
     reinit (num_blocks);
   }
@@ -514,7 +517,7 @@ namespace TrilinosWrappers
     this->components.resize (v.n_blocks());
     this->block_indices = v.block_indices;
 
-    for (unsigned int i=0; i<this->n_blocks(); ++i)
+    for (size_type i=0; i<this->n_blocks(); ++i)
       this->components[i] = v.components[i];
   }
 
@@ -550,13 +553,13 @@ namespace TrilinosWrappers
   {
     if (n_blocks() != v.n_blocks())
       {
-        std::vector<unsigned int> block_sizes (v.n_blocks(), 0);
+        std::vector<size_type> block_sizes (v.n_blocks(), 0);
         block_indices.reinit (block_sizes);
         if (components.size() != n_blocks())
           components.resize(n_blocks());
       }
 
-    for (unsigned int i=0; i<this->n_blocks(); ++i)
+    for (size_type i=0; i<this->n_blocks(); ++i)
       this->components[i] = v.block(i);
 
     collect_sizes();
index 937640f67293764935a373175fd264751c5f4dc3..f35166b1c376716bd278bc234188a9f1739d03b2 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_parallel_block_vector_h
 #define __deal2__trilinos_parallel_block_vector_h
 
@@ -120,7 +125,7 @@ namespace TrilinosWrappers
        * processes.
        */
       explicit BlockVector (const std::vector<IndexSet> &parallel_partitioning,
-                   const MPI_Comm              &communicator = MPI_COMM_WORLD);
+                            const MPI_Comm              &communicator = MPI_COMM_WORLD);
 
       /**
        * Copy-Constructor. Set all the
@@ -140,7 +145,7 @@ namespace TrilinosWrappers
        * fill appropriate data using a
        * reinit of the blocks.
        */
-      explicit BlockVector (const unsigned int num_blocks);
+      explicit BlockVector (const size_type num_blocks);
 
       /**
        * Destructor. Clears memory
@@ -225,6 +230,14 @@ namespace TrilinosWrappers
       void reinit (const std::vector<IndexSet> &parallel_partitioning,
                    const MPI_Comm              &communicator = MPI_COMM_WORLD,
                    const bool                   fast = false);
+      /**
+       * like above, but with a second set of indices for
+       * ghost entries.
+       */
+      void reinit (const std::vector<IndexSet> &partitioning,
+                   const std::vector<IndexSet> &ghost_values,
+                   const MPI_Comm              &communicator = MPI_COMM_WORLD);
+
 
       /**
        * Change the dimension to that
@@ -266,7 +279,7 @@ namespace TrilinosWrappers
        * calls <tt>collect_sizes</tt>
        * afterwards.
        */
-      void reinit (const unsigned int num_blocks);
+      void reinit (const size_type num_blocks);
 
       /**
        * This reinit function is meant to
@@ -420,7 +433,7 @@ namespace TrilinosWrappers
 
 
     inline
-    BlockVector::BlockVector (const unsigned int num_blocks)
+    BlockVector::BlockVector (const size_type num_blocks)
     {
       reinit (num_blocks);
     }
@@ -435,7 +448,7 @@ namespace TrilinosWrappers
       this->components.resize (v.n_blocks());
       this->block_indices = v.block_indices;
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         this->components[i] = v.components[i];
     }
 
@@ -482,13 +495,13 @@ namespace TrilinosWrappers
     {
       if (n_blocks() != v.n_blocks())
         {
-          std::vector<unsigned int> block_sizes (v.n_blocks(), 0);
+          std::vector<size_type> block_sizes (v.n_blocks(), 0);
           block_indices.reinit (block_sizes);
           if (components.size() != n_blocks())
             components.resize(n_blocks());
         }
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         this->components[i] = v.block(i);
 
       collect_sizes();
index 173648e82746bcefd4cc228ac6f1146f4f91be28..34a6017f4f17b97e648d89b84b15e11a1bfdddd8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_precondition_h
 #define __deal2__trilinos_precondition_h
 
@@ -72,6 +77,10 @@ namespace TrilinosWrappers
   class PreconditionBase : public Subscriptor
   {
   public:
+    /**
+     * Declare the type for container size.
+     */
+    typedef dealii::types::global_dof_index size_type;
 
     /**
      * Standardized data struct to
@@ -1487,7 +1496,7 @@ namespace TrilinosWrappers
      * Prints an estimate of the memory
      * consumption of this class.
      */
-    std::size_t memory_consumption () const;
+    size_type memory_consumption () const;
 
   private:
     /**
@@ -1565,9 +1574,9 @@ namespace TrilinosWrappers
   void PreconditionBase::vmult (dealii::Vector<double>       &dst,
                                 const dealii::Vector<double> &src) const
   {
-    AssertDimension (static_cast<int>(dst.size()),
+    AssertDimension (static_cast<TrilinosWrappers::types::int_type>(dst.size()),
                      preconditioner->OperatorDomainMap().NumMyElements());
-    AssertDimension (static_cast<int>(src.size()),
+    AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.size()),
                      preconditioner->OperatorRangeMap().NumMyElements());
     Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
                             dst.begin());
@@ -1583,9 +1592,9 @@ namespace TrilinosWrappers
   void PreconditionBase::Tvmult (dealii::Vector<double>       &dst,
                                  const dealii::Vector<double> &src) const
   {
-    AssertDimension (static_cast<int>(dst.size()),
+    AssertDimension (static_cast<TrilinosWrappers::types::int_type>(dst.size()),
                      preconditioner->OperatorDomainMap().NumMyElements());
-    AssertDimension (static_cast<int>(src.size()),
+    AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.size()),
                      preconditioner->OperatorRangeMap().NumMyElements());
     Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
                             dst.begin());
@@ -1605,9 +1614,9 @@ namespace TrilinosWrappers
   PreconditionBase::vmult (parallel::distributed::Vector<double>       &dst,
                            const parallel::distributed::Vector<double> &src) const
   {
-    AssertDimension (static_cast<int>(dst.local_size()),
+    AssertDimension (static_cast<TrilinosWrappers::types::int_type>(dst.local_size()),
                      preconditioner->OperatorDomainMap().NumMyElements());
-    AssertDimension (static_cast<int>(src.local_size()),
+    AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.local_size()),
                      preconditioner->OperatorRangeMap().NumMyElements());
     Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
                             dst.begin());
@@ -1623,9 +1632,9 @@ namespace TrilinosWrappers
   PreconditionBase::Tvmult (parallel::distributed::Vector<double>       &dst,
                             const parallel::distributed::Vector<double> &src) const
   {
-    AssertDimension (static_cast<int>(dst.local_size()),
+    AssertDimension (static_cast<TrilinosWrappers::types::int_type>(dst.local_size()),
                      preconditioner->OperatorDomainMap().NumMyElements());
-    AssertDimension (static_cast<int>(src.local_size()),
+    AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.local_size()),
                      preconditioner->OperatorRangeMap().NumMyElements());
     Epetra_Vector tril_dst (View, preconditioner->OperatorDomainMap(),
                             dst.begin());
index a0ed04362361110d832982b8f1bdd66b46d7bfa1..1c4ead78a83c8f93fe3ac26c81ba5791058711dd 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_solver_h
 #define __deal2__trilinos_solver_h
 
@@ -155,6 +160,26 @@ namespace TrilinosWrappers
            const VectorBase       &b,
            const PreconditionBase &preconditioner);
 
+    /**
+     * Solve the linear system
+     * <tt>Ax=b</tt> where <tt>A</tt>
+     * is an operator. This function
+     * can be used for matrix free
+     * computation. Depending on
+     * the information provided by
+     * derived classes and the
+     * object passed as a
+     * preconditioner, one of the
+     * linear solvers and
+     * preconditioners of Trilinos
+     * is chosen.
+     */
+    void
+    solve (Epetra_Operator        &A,
+           VectorBase             &x,
+           const VectorBase       &b,
+           const PreconditionBase &preconditioner);
+
     /**
      * Solve the linear system
      * <tt>Ax=b</tt>. Depending on the
@@ -179,6 +204,32 @@ namespace TrilinosWrappers
            const dealii::Vector<double> &b,
            const PreconditionBase       &preconditioner);
 
+    /**
+     * Solve the linear system
+     * <tt>Ax=b</tt> where <tt>A</tt>
+     * is an operator. This function can
+     * be used for matric free. Depending on the
+     * information provided by derived
+     * classes and the object passed as a
+     * preconditioner, one of the linear
+     * solvers and preconditioners of
+     * Trilinos is chosen. This class
+     * works with matrices according to
+     * the TrilinosWrappers format, but
+     * can take deal.II vectors as
+     * argument. Since deal.II are serial
+     * vectors (not distributed), this
+     * function does only what you expect
+     * in case the matrix is locally
+     * owned. Otherwise, an exception
+     * will be thrown.
+     */
+    void
+    solve (Epetra_Operator              &A,
+           dealii::Vector<double>       &x,
+           const dealii::Vector<double> &b,
+           const PreconditionBase       &preconditioner);
+
     /**
      * Access to object that controls
      * convergence.
@@ -211,6 +262,12 @@ namespace TrilinosWrappers
 
   private:
 
+    /**
+     * The solve function is used to set properly the Epetra_LinearProblem,
+     * once it is done this function solves the linear problem.
+     */
+    void execute_solve(const PreconditionBase &preconditioner);
+
     /**
      * A structure that collects
      * the Trilinos sparse matrix,
index abcab431af8db5e42371c14caba3117f1ec587f0..8349654f99736688f43fd251e35d569417bf2040 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_sparse_matrix_h
 #define __deal2__trilinos_sparse_matrix_h
 
@@ -72,7 +77,7 @@ namespace TrilinosWrappers
      * Exception
      */
     DeclException3 (ExcAccessToNonlocalRow,
-                    int, int, int,
+                    std::size_t, std::size_t, std::size_t,
                     << "You tried to access row " << arg1
                     << " of a distributed sparsity pattern, "
                     << " but only rows " << arg2 << " through " << arg3
@@ -97,30 +102,35 @@ namespace TrilinosWrappers
     class AccessorBase
     {
     public:
+      /**
+       * Declare the type for container size.
+       */
+      typedef dealii::types::global_dof_index size_type;
+
       /**
        * Constructor.
        */
       AccessorBase (SparseMatrix *matrix,
-                    const unsigned int  row,
-                    const unsigned int  index);
+                    const size_type  row,
+                    const size_type  index);
 
       /**
        * Row number of the element
        * represented by this object.
        */
-      unsigned int row() const;
+      size_type row() const;
 
       /**
        * Index in row of the element
        * represented by this object.
        */
-      unsigned int index() const;
+      size_type index() const;
 
       /**
        * Column number of the element
        * represented by this object.
        */
-      unsigned int column() const;
+      size_type column() const;
 
     protected:
       /**
@@ -138,12 +148,12 @@ namespace TrilinosWrappers
       /**
        * Current row number.
        */
-      unsigned int a_row;
+      size_type a_row;
 
       /**
        * Current index in row.
        */
-      unsigned int a_index;
+      size_type a_index;
 
       /**
        * Discard the old row caches
@@ -180,7 +190,7 @@ namespace TrilinosWrappers
        * than one accessor can access
        * this data if necessary.
        */
-      std_cxx1x::shared_ptr<std::vector<unsigned int> > colnum_cache;
+      std_cxx1x::shared_ptr<std::vector<size_type> > colnum_cache;
 
       /**
        * Cache for the values
@@ -234,8 +244,8 @@ namespace TrilinosWrappers
        * pointer is sufficient.
        */
       Accessor (MatrixType *matrix,
-                const unsigned int  row,
-                const unsigned int  index);
+                const size_type  row,
+                const size_type  index);
 
       /**
        * Copy constructor to get from a
@@ -335,8 +345,8 @@ namespace TrilinosWrappers
        * pointer is sufficient.
        */
       Accessor (MatrixType *matrix,
-                const unsigned int  row,
-                const unsigned int  index);
+                const size_type  row,
+                const size_type  index);
 
       /**
        * Value of this matrix entry.
@@ -374,6 +384,11 @@ namespace TrilinosWrappers
     class Iterator
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef dealii::types::global_dof_index size_type;
+
       /**
        * Typedef for the matrix type
        * (including constness) we are to
@@ -388,8 +403,8 @@ namespace TrilinosWrappers
        * the index within it.
        */
       Iterator (MatrixType *matrix,
-                const unsigned int  row,
-                const unsigned int  index);
+                const size_type  row,
+                const size_type  index);
 
       /**
        * Copy constructor with
@@ -449,7 +464,7 @@ namespace TrilinosWrappers
        * Exception
        */
       DeclException2 (ExcInvalidIndexWithinRow,
-                      int, int,
+                      size_type, size_type,
                       << "Attempt to access element " << arg2
                       << " of row " << arg1
                       << " which doesn't have that many elements.");
@@ -500,6 +515,11 @@ namespace TrilinosWrappers
   class SparseMatrix : public Subscriptor
   {
   public:
+    /**
+     * Declare the type for container size.
+     */
+    typedef dealii::types::global_dof_index size_type;
+
     /**
      * A structure that describes
      * some of the traits of this
@@ -560,8 +580,8 @@ namespace TrilinosWrappers
      * row is specified as the maximum
      * number of entries argument.
      */
-    SparseMatrix (const unsigned int  m,
-                  const unsigned int  n,
+    SparseMatrix (const size_type  m,
+                  const size_type  n,
                   const unsigned int  n_max_entries_per_row);
 
     /**
@@ -574,8 +594,8 @@ namespace TrilinosWrappers
      * specifies the number of entries in
      * each row.
      */
-    SparseMatrix (const unsigned int               m,
-                  const unsigned int               n,
+    SparseMatrix (const size_type                  m,
+                  const size_type                  n,
                   const std::vector<unsigned int> &n_entries_per_row);
 
     /**
@@ -729,8 +749,8 @@ namespace TrilinosWrappers
      * memory prior to use (in the
      * compress() step).
      */
-    SparseMatrix (const Epetra_Map   &parallel_partitioning,
-                  const unsigned int  n_max_entries_per_row = 0);
+    SparseMatrix (const Epetra_Map  &parallel_partitioning,
+                  const size_type    n_max_entries_per_row = 0);
 
     /**
      * Same as before, but now set a
@@ -777,9 +797,9 @@ namespace TrilinosWrappers
      * number of columns entries per row
      * that will be allocated.
      */
-    SparseMatrix (const Epetra_Map   &row_parallel_partitioning,
-                  const Epetra_Map   &col_parallel_partitioning,
-                  const unsigned int  n_max_entries_per_row = 0);
+    SparseMatrix (const Epetra_Map &row_parallel_partitioning,
+                  const Epetra_Map &col_parallel_partitioning,
+                  const size_type   n_max_entries_per_row = 0);
 
     /**
      * This constructor is similar to the
@@ -975,9 +995,9 @@ namespace TrilinosWrappers
      * memory prior to use (in the
      * compress() step).
      */
-    SparseMatrix (const IndexSet     &parallel_partitioning,
-                  const MPI_Comm     &communicator = MPI_COMM_WORLD,
-                  const unsigned int  n_max_entries_per_row = 0);
+    SparseMatrix (const IndexSet    &parallel_partitioning,
+                  const MPI_Comm    &communicator = MPI_COMM_WORLD,
+                  const unsigned int n_max_entries_per_row = 0);
 
     /**
      * Same as before, but now set the
@@ -1024,10 +1044,10 @@ namespace TrilinosWrappers
      * structure is reorganized in the
      * compress() call.
      */
-    SparseMatrix (const IndexSet     &row_parallel_partitioning,
-                  const IndexSet     &col_parallel_partitioning,
-                  const MPI_Comm     &communicator = MPI_COMM_WORLD,
-                  const unsigned int  n_max_entries_per_row = 0);
+    SparseMatrix (const IndexSet  &row_parallel_partitioning,
+                  const IndexSet  &col_parallel_partitioning,
+                  const MPI_Comm  &communicator = MPI_COMM_WORLD,
+                  const size_type  n_max_entries_per_row = 0);
 
     /**
      * This constructor is similar to the
@@ -1211,13 +1231,13 @@ namespace TrilinosWrappers
      * Return the number of rows in
      * this matrix.
      */
-    unsigned int m () const;
+    size_type m () const;
 
     /**
      * Return the number of columns
      * in this matrix.
      */
-    unsigned int n () const;
+    size_type n () const;
 
     /**
      * Return the local dimension
@@ -1251,7 +1271,7 @@ namespace TrilinosWrappers
      * where
      * <tt>n=local_size()</tt>.
      */
-    std::pair<unsigned int, unsigned int>
+    std::pair<size_type, size_type>
     local_range () const;
 
     /**
@@ -1259,19 +1279,19 @@ namespace TrilinosWrappers
      * in the local range or not,
      * see also local_range().
      */
-    bool in_local_range (const unsigned int index) const;
+    bool in_local_range (const size_type index) const;
 
     /**
      * Return the number of nonzero
      * elements of this matrix.
      */
-    unsigned int n_nonzero_elements () const;
+    size_type n_nonzero_elements () const;
 
     /**
      * Number of entries in a
      * specific row.
      */
-    unsigned int row_length (const unsigned int row) const;
+    unsigned int row_length (const size_type row) const;
 
     /**
      * Returns the state of the matrix,
@@ -1292,7 +1312,7 @@ namespace TrilinosWrappers
      * returned in case this is called in
      * an MPI-based program.
      */
-    std::size_t memory_consumption () const;
+    size_type memory_consumption () const;
 
 //@}
     /**
@@ -1407,8 +1427,8 @@ namespace TrilinosWrappers
      * the matrix with a sparsity pattern
      * first.
      */
-    void set (const unsigned int i,
-              const unsigned int j,
+    void set (const size_type i,
+              const size_type j,
               const TrilinosScalar value);
 
     /**
@@ -1447,7 +1467,7 @@ namespace TrilinosWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const std::vector<unsigned int>  &indices,
+    void set (const std::vector<size_type>     &indices,
               const FullMatrix<TrilinosScalar> &full_matrix,
               const bool                        elide_zero_values = false);
 
@@ -1458,8 +1478,8 @@ namespace TrilinosWrappers
      * different local-to-global indexing
      * on rows and columns, respectively.
      */
-    void set (const std::vector<unsigned int>  &row_indices,
-              const std::vector<unsigned int>  &col_indices,
+    void set (const std::vector<size_type>     &row_indices,
+              const std::vector<size_type>     &col_indices,
               const FullMatrix<TrilinosScalar> &full_matrix,
               const bool                        elide_zero_values = false);
 
@@ -1490,8 +1510,8 @@ namespace TrilinosWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const unsigned int                row,
-              const std::vector<unsigned int>   &col_indices,
+    void set (const size_type                    row,
+              const std::vector<size_type>      &col_indices,
               const std::vector<TrilinosScalar> &values,
               const bool                         elide_zero_values = false);
 
@@ -1522,9 +1542,9 @@ namespace TrilinosWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const unsigned int    row,
-              const unsigned int    n_cols,
-              const unsigned int   *col_indices,
+    void set (const size_type       row,
+              const size_type       n_cols,
+              const size_type      *col_indices,
               const TrilinosScalar *values,
               const bool            elide_zero_values = false);
 
@@ -1543,8 +1563,8 @@ namespace TrilinosWrappers
      * <tt>value</tt> is not a finite
      * number an exception is thrown.
      */
-    void add (const unsigned int i,
-              const unsigned int j,
+    void add (const size_type      i,
+              const size_type      j,
               const TrilinosScalar value);
 
     /**
@@ -1583,7 +1603,7 @@ namespace TrilinosWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const std::vector<unsigned int>  &indices,
+    void add (const std::vector<size_type>  &indices,
               const FullMatrix<TrilinosScalar> &full_matrix,
               const bool                        elide_zero_values = true);
 
@@ -1594,8 +1614,8 @@ namespace TrilinosWrappers
      * different local-to-global indexing
      * on rows and columns, respectively.
      */
-    void add (const std::vector<unsigned int>  &row_indices,
-              const std::vector<unsigned int>  &col_indices,
+    void add (const std::vector<size_type>     &row_indices,
+              const std::vector<size_type>     &col_indices,
               const FullMatrix<TrilinosScalar> &full_matrix,
               const bool                        elide_zero_values = true);
 
@@ -1625,8 +1645,8 @@ namespace TrilinosWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const unsigned int                row,
-              const std::vector<unsigned int>   &col_indices,
+    void add (const size_type                    row,
+              const std::vector<size_type>      &col_indices,
               const std::vector<TrilinosScalar> &values,
               const bool                         elide_zero_values = true);
 
@@ -1655,9 +1675,9 @@ namespace TrilinosWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const unsigned int    row,
-              const unsigned int    n_cols,
-              const unsigned int   *col_indices,
+    void add (const size_type       row,
+              const size_type       n_cols,
+              const size_type      *col_indices,
               const TrilinosScalar *values,
               const bool            elide_zero_values = true,
               const bool            col_indices_are_sorted = false);
@@ -1734,7 +1754,7 @@ namespace TrilinosWrappers
      * default is to set it to
      * zero.
      */
-    void clear_row (const unsigned int   row,
+    void clear_row (const size_type      row,
                     const TrilinosScalar new_diag_value = 0);
 
     /**
@@ -1753,8 +1773,8 @@ namespace TrilinosWrappers
      * diagonal entries, you have
      * to set them by hand.
      */
-    void clear_rows (const std::vector<unsigned int> &rows,
-                     const TrilinosScalar             new_diag_value = 0);
+    void clear_rows (const std::vector<size_type> &rows,
+                     const TrilinosScalar          new_diag_value = 0);
 
     /**
      * Make an in-place transpose
@@ -1787,8 +1807,8 @@ namespace TrilinosWrappers
      * is not saved on the calling
      * process.
      */
-    TrilinosScalar operator () (const unsigned int i,
-                                const unsigned int j) const;
+    TrilinosScalar operator () (const size_type i,
+                                const size_type j) const;
 
     /**
      * Return the value of the
@@ -1827,8 +1847,8 @@ namespace TrilinosWrappers
      * processor, and possibly so
      * with a nonzero value.
      */
-    TrilinosScalar el (const unsigned int i,
-                       const unsigned int j) const;
+    TrilinosScalar el (const size_type i,
+                       const size_type j) const;
 
     /**
      * Return the main diagonal
@@ -1841,7 +1861,7 @@ namespace TrilinosWrappers
      * See also the comment in
      * trilinos_sparse_matrix.cc.
      */
-    TrilinosScalar diag_element (const unsigned int i) const;
+    TrilinosScalar diag_element (const size_type i) const;
 
 //@}
     /**
@@ -2283,7 +2303,7 @@ namespace TrilinosWrappers
      * that the iterator may not be
      * dereferencable in that case.
      */
-    const_iterator begin (const unsigned int r) const;
+    const_iterator begin (const size_type r) const;
 
     /**
      * Final iterator of row
@@ -2300,7 +2320,7 @@ namespace TrilinosWrappers
      * the end iterator for the
      * last row of a matrix.
      */
-    const_iterator end (const unsigned int r) const;
+    const_iterator end (const size_type r) const;
 
     /**
      * STL-like iterator with the
@@ -2326,7 +2346,7 @@ namespace TrilinosWrappers
      * that the iterator may not be
      * dereferencable in that case.
      */
-    iterator begin (const unsigned int r);
+    iterator begin (const size_type r);
 
     /**
      * Final iterator of row
@@ -2343,7 +2363,7 @@ namespace TrilinosWrappers
      * the end iterator for the
      * last row of a matrix.
      */
-    iterator end (const unsigned int r);
+    iterator end (const size_type r);
 
 //@}
     /**
@@ -2394,7 +2414,7 @@ namespace TrilinosWrappers
      * Exception
      */
     DeclException2 (ExcInvalidIndex,
-                    int, int,
+                    size_type, size_type,
                     << "The entry with index <" << arg1 << ',' << arg2
                     << "> does not exist.");
 
@@ -2412,7 +2432,7 @@ namespace TrilinosWrappers
      * Exception
      */
     DeclException4 (ExcAccessToNonLocalElement,
-                    int, int, int, int,
+                    size_type, size_type, size_type, size_type,
                     << "You tried to access element (" << arg1
                     << "/" << arg2 << ")"
                     << " of a distributed matrix, but only rows "
@@ -2423,7 +2443,7 @@ namespace TrilinosWrappers
      * Exception
      */
     DeclException2 (ExcAccessToNonPresentElement,
-                    int, int,
+                    size_type, size_type,
                     << "You tried to access element (" << arg1
                     << "/" << arg2 << ")"
                     << " of a sparse matrix, but it appears to not"
@@ -2540,7 +2560,7 @@ namespace TrilinosWrappers
   namespace SparseMatrixIterators
   {
     inline
-    AccessorBase::AccessorBase(SparseMatrix *matrix, unsigned int row, unsigned int index)
+    AccessorBase::AccessorBase(SparseMatrix *matrix, size_type row, size_type index)
       :
       matrix(matrix),
       a_row(row),
@@ -2551,7 +2571,7 @@ namespace TrilinosWrappers
 
 
     inline
-    unsigned int
+    AccessorBase::size_type
     AccessorBase::row() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -2560,7 +2580,7 @@ namespace TrilinosWrappers
 
 
     inline
-    unsigned int
+    AccessorBase::size_type
     AccessorBase::column() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -2569,7 +2589,7 @@ namespace TrilinosWrappers
 
 
     inline
-    unsigned int
+    AccessorBase::size_type
     AccessorBase::index() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -2579,8 +2599,8 @@ namespace TrilinosWrappers
 
     inline
     Accessor<true>::Accessor (MatrixType *matrix,
-                              const unsigned int  row,
-                              const unsigned int  index)
+                              const size_type  row,
+                              const size_type  index)
       :
       AccessorBase(const_cast<SparseMatrix *>(matrix), row, index)
     {}
@@ -2674,8 +2694,8 @@ namespace TrilinosWrappers
 
     inline
     Accessor<false>::Accessor (MatrixType *matrix,
-                               const unsigned int  row,
-                               const unsigned int  index)
+                               const size_type  row,
+                               const size_type  index)
       :
       AccessorBase(matrix, row, index)
     {}
@@ -2694,8 +2714,8 @@ namespace TrilinosWrappers
     template <bool Constness>
     inline
     Iterator<Constness>::Iterator(MatrixType *matrix,
-                                  const unsigned int  row,
-                                  const unsigned int  index)
+                                  const size_type  row,
+                                  const size_type  index)
       :
       accessor(matrix, row, index)
     {}
@@ -2835,7 +2855,7 @@ namespace TrilinosWrappers
 
   inline
   SparseMatrix::const_iterator
-  SparseMatrix::begin(const unsigned int r) const
+  SparseMatrix::begin(const size_type r) const
   {
     Assert (r < m(), ExcIndexRange(r, 0, m()));
     if (row_length(r) > 0)
@@ -2848,14 +2868,14 @@ namespace TrilinosWrappers
 
   inline
   SparseMatrix::const_iterator
-  SparseMatrix::end(const unsigned int r) const
+  SparseMatrix::end(const size_type r) const
   {
     Assert (r < m(), ExcIndexRange(r, 0, m()));
 
     // place the iterator on the first entry
     // past this line, or at the end of the
     // matrix
-    for (unsigned int i=r+1; i<m(); ++i)
+    for (size_type i=r+1; i<m(); ++i)
       if (row_length(i) > 0)
         return const_iterator(this, i, 0);
 
@@ -2886,7 +2906,7 @@ namespace TrilinosWrappers
 
   inline
   SparseMatrix::iterator
-  SparseMatrix::begin(const unsigned int r)
+  SparseMatrix::begin(const size_type r)
   {
     Assert (r < m(), ExcIndexRange(r, 0, m()));
     if (row_length(r) > 0)
@@ -2899,14 +2919,14 @@ namespace TrilinosWrappers
 
   inline
   SparseMatrix::iterator
-  SparseMatrix::end(const unsigned int r)
+  SparseMatrix::end(const size_type r)
   {
     Assert (r < m(), ExcIndexRange(r, 0, m()));
 
     // place the iterator on the first entry
     // past this line, or at the end of the
     // matrix
-    for (unsigned int i=r+1; i<m(); ++i)
+    for (size_type i=r+1; i<m(); ++i)
       if (row_length(i) > 0)
         return iterator(this, i, 0);
 
@@ -2919,14 +2939,19 @@ namespace TrilinosWrappers
 
   inline
   bool
-  SparseMatrix::in_local_range (const unsigned int index) const
+  SparseMatrix::in_local_range (const size_type index) const
   {
-    int begin, end;
+    TrilinosWrappers::types::int_type begin, end;
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    begin = matrix->RowMap().MinMyGID();
+    end = matrix->RowMap().MaxMyGID()+1;
+#else
     begin = matrix->RowMap().MinMyGID();
     end = matrix->RowMap().MaxMyGID()+1;
+#endif
 
-    return ((index >= static_cast<unsigned int>(begin)) &&
-            (index < static_cast<unsigned int>(end)));
+    return ((index >= static_cast<size_type>(begin)) &&
+            (index < static_cast<size_type>(end)));
   }
 
 
@@ -2947,26 +2972,26 @@ namespace TrilinosWrappers
 
     Epetra_CombineMode mode = last_action;
     if (last_action == Zero)
-    {
-      if ((operation==::dealii::VectorOperation::add) ||
-          (operation==::dealii::VectorOperation::unknown))
-        mode = Add;
-      else if (operation==::dealii::VectorOperation::insert)
-        mode = Insert;
-    }
+      {
+        if ((operation==::dealii::VectorOperation::add) ||
+            (operation==::dealii::VectorOperation::unknown))
+          mode = Add;
+        else if (operation==::dealii::VectorOperation::insert)
+          mode = Insert;
+      }
     else
-    {
-      Assert(
+      {
+        Assert(
           ((last_action == Add) && (operation!=::dealii::VectorOperation::insert))
           ||
           ((last_action == Insert) && (operation!=::dealii::VectorOperation::add)),
           ExcMessage("operation and argument to compress() do not match"));
-    }
+      }
 
     // flush buffers
     int ierr;
     ierr = matrix->GlobalAssemble (*column_space_map, matrix->RowMap(),
-        true, mode);
+                                   true, mode);
 
     AssertThrow (ierr == 0, ExcTrilinosError(ierr));
 
@@ -3013,8 +3038,8 @@ namespace TrilinosWrappers
   // compile time.
   inline
   void
-  SparseMatrix::set (const unsigned int   i,
-                     const unsigned int   j,
+  SparseMatrix::set (const size_type      i,
+                     const size_type      j,
                      const TrilinosScalar value)
   {
 
@@ -3027,7 +3052,7 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::set (const std::vector<unsigned int>  &indices,
+  SparseMatrix::set (const std::vector<size_type>  &indices,
                      const FullMatrix<TrilinosScalar> &values,
                      const bool                        elide_zero_values)
   {
@@ -3035,7 +3060,7 @@ namespace TrilinosWrappers
             ExcDimensionMismatch(indices.size(), values.m()));
     Assert (values.m() == values.n(), ExcNotQuadratic());
 
-    for (unsigned int i=0; i<indices.size(); ++i)
+    for (size_type i=0; i<indices.size(); ++i)
       set (indices[i], indices.size(), &indices[0], &values(i,0),
            elide_zero_values);
   }
@@ -3044,8 +3069,8 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::set (const std::vector<unsigned int>  &row_indices,
-                     const std::vector<unsigned int>  &col_indices,
+  SparseMatrix::set (const std::vector<size_type>     &row_indices,
+                     const std::vector<size_type>     &col_indices,
                      const FullMatrix<TrilinosScalar> &values,
                      const bool                        elide_zero_values)
   {
@@ -3054,7 +3079,7 @@ namespace TrilinosWrappers
     Assert (col_indices.size() == values.n(),
             ExcDimensionMismatch(col_indices.size(), values.n()));
 
-    for (unsigned int i=0; i<row_indices.size(); ++i)
+    for (size_type i=0; i<row_indices.size(); ++i)
       set (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
            elide_zero_values);
   }
@@ -3063,8 +3088,8 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::set (const unsigned int                 row,
-                     const std::vector<unsigned int>   &col_indices,
+  SparseMatrix::set (const size_type                    row,
+                     const std::vector<size_type>      &col_indices,
                      const std::vector<TrilinosScalar> &values,
                      const bool                         elide_zero_values)
   {
@@ -3079,9 +3104,9 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::set (const unsigned int    row,
-                     const unsigned int    n_cols,
-                     const unsigned int   *col_indices,
+  SparseMatrix::set (const size_type       row,
+                     const size_type       n_cols,
+                     const size_type      *col_indices,
                      const TrilinosScalar *values,
                      const bool            elide_zero_values)
   {
@@ -3096,14 +3121,14 @@ namespace TrilinosWrappers
 
     last_action = Insert;
 
-    int *col_index_ptr;
+    TrilinosWrappers::types::int_type *col_index_ptr;
     TrilinosScalar *col_value_ptr;
-    int n_columns;
+    TrilinosWrappers::types::int_type n_columns;
 
     TrilinosScalar short_val_array[100];
-    int short_index_array[100];
+    TrilinosWrappers::types::int_type short_index_array[100];
     std::vector<TrilinosScalar> long_val_array;
-    std::vector<int> long_index_array;
+    std::vector<TrilinosWrappers::types::int_type> long_index_array;
 
 
     // If we don't elide zeros, the pointers are already available... need to
@@ -3111,8 +3136,8 @@ namespace TrilinosWrappers
     // we will not modify const data)
     if (elide_zero_values == false)
       {
-        col_index_ptr = (int *)col_indices;
-        col_value_ptr = const_cast<TrilinosScalar*>(values);
+        col_index_ptr = (TrilinosWrappers::types::int_type *)col_indices;
+        col_value_ptr = const_cast<TrilinosScalar *>(values);
         n_columns = n_cols;
       }
     else
@@ -3133,7 +3158,7 @@ namespace TrilinosWrappers
           }
 
         n_columns = 0;
-        for (unsigned int j=0; j<n_cols; ++j)
+        for (size_type j=0; j<n_cols; ++j)
           {
             const double value = values[j];
             Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -3145,7 +3170,7 @@ namespace TrilinosWrappers
               }
           }
 
-        Assert(n_columns <= (int)n_cols, ExcInternalError());
+        Assert(n_columns <= (TrilinosWrappers::types::int_type)n_cols, ExcInternalError());
       }
 
 
@@ -3157,13 +3182,14 @@ namespace TrilinosWrappers
     // one is when the pattern is already fixed. In the former case, we add
     // the possibility to insert new values, and in the second we just replace
     // data.
-    if (row_partitioner().MyGID(static_cast<int>(row)) == true)
+    if (row_partitioner().MyGID(static_cast<TrilinosWrappers::types::int_type>(row)) == true)
       {
         if (matrix->Filled() == false)
           {
-            ierr = matrix->Epetra_CrsMatrix::InsertGlobalValues(row, n_columns,
-                                                                col_value_ptr,
-                                                                col_index_ptr);
+            ierr = matrix->Epetra_CrsMatrix::InsertGlobalValues(
+                     static_cast<TrilinosWrappers::types::int_type>(row),
+                     static_cast<int>(n_columns),const_cast<double *>(col_value_ptr),
+                     col_index_ptr);
 
             // When inserting elements, we do not want to create exceptions in
             // the case when inserting non-local data (since that's what we
@@ -3188,7 +3214,8 @@ namespace TrilinosWrappers
 
         if (matrix->Filled() == false)
           {
-            ierr = matrix->InsertGlobalValues (1, (int *)&row,
+            ierr = matrix->InsertGlobalValues (1,
+                                               (TrilinosWrappers::types::int_type *)&row,
                                                n_columns, col_index_ptr,
                                                &col_value_ptr,
                                                Epetra_FECrsMatrix::ROW_MAJOR);
@@ -3196,7 +3223,8 @@ namespace TrilinosWrappers
               ierr = 0;
           }
         else
-          ierr = matrix->ReplaceGlobalValues (1, (int *)&row,
+          ierr = matrix->ReplaceGlobalValues (1,
+                                              (TrilinosWrappers::types::int_type *)&row,
                                               n_columns, col_index_ptr,
                                               &col_value_ptr,
                                               Epetra_FECrsMatrix::ROW_MAJOR);
@@ -3210,8 +3238,8 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::add (const unsigned int   i,
-                     const unsigned int   j,
+  SparseMatrix::add (const size_type      i,
+                     const size_type      j,
                      const TrilinosScalar value)
   {
     Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -3247,7 +3275,7 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::add (const std::vector<unsigned int>  &indices,
+  SparseMatrix::add (const std::vector<size_type>     &indices,
                      const FullMatrix<TrilinosScalar> &values,
                      const bool                        elide_zero_values)
   {
@@ -3255,7 +3283,7 @@ namespace TrilinosWrappers
             ExcDimensionMismatch(indices.size(), values.m()));
     Assert (values.m() == values.n(), ExcNotQuadratic());
 
-    for (unsigned int i=0; i<indices.size(); ++i)
+    for (size_type i=0; i<indices.size(); ++i)
       add (indices[i], indices.size(), &indices[0], &values(i,0),
            elide_zero_values);
   }
@@ -3264,8 +3292,8 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::add (const std::vector<unsigned int>  &row_indices,
-                     const std::vector<unsigned int>  &col_indices,
+  SparseMatrix::add (const std::vector<size_type>  &row_indices,
+                     const std::vector<size_type>  &col_indices,
                      const FullMatrix<TrilinosScalar> &values,
                      const bool                        elide_zero_values)
   {
@@ -3274,7 +3302,7 @@ namespace TrilinosWrappers
     Assert (col_indices.size() == values.n(),
             ExcDimensionMismatch(col_indices.size(), values.n()));
 
-    for (unsigned int i=0; i<row_indices.size(); ++i)
+    for (size_type i=0; i<row_indices.size(); ++i)
       add (row_indices[i], col_indices.size(), &col_indices[0],
            &values(i,0), elide_zero_values);
   }
@@ -3283,8 +3311,8 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::add (const unsigned int                 row,
-                     const std::vector<unsigned int>   &col_indices,
+  SparseMatrix::add (const size_type                    row,
+                     const std::vector<size_type>      &col_indices,
                      const std::vector<TrilinosScalar> &values,
                      const bool                         elide_zero_values)
   {
@@ -3299,9 +3327,9 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparseMatrix::add (const unsigned int    row,
-                     const unsigned int    n_cols,
-                     const unsigned int   *col_indices,
+  SparseMatrix::add (const size_type       row,
+                     const size_type       n_cols,
+                     const size_type      *col_indices,
                      const TrilinosScalar *values,
                      const bool            elide_zero_values,
                      const bool            /*col_indices_are_sorted*/)
@@ -3319,25 +3347,25 @@ namespace TrilinosWrappers
 
     last_action = Add;
 
-    int *col_index_ptr;
+    TrilinosWrappers::types::int_type *col_index_ptr;
     TrilinosScalar *col_value_ptr;
-    int n_columns;
+    TrilinosWrappers::types::int_type n_columns;
 
     double short_val_array[100];
-    int short_index_array[100];
+    TrilinosWrappers::types::int_type short_index_array[100];
     std::vector<TrilinosScalar> long_val_array;
-    std::vector<int> long_index_array;
+    std::vector<TrilinosWrappers::types::int_type> long_index_array;
 
     // If we don't elide zeros, the pointers are already available... need to
     // cast to non-const pointers as that is the format taken by Trilinos (but
     // we will not modify const data)
     if (elide_zero_values == false)
       {
-        col_index_ptr = (int *)col_indices;
-        col_value_ptr = const_cast<TrilinosScalar*>(values);
+        col_index_ptr = (TrilinosWrappers::types::int_type *)col_indices;
+        col_value_ptr = const_cast<TrilinosScalar *>(values);
         n_columns = n_cols;
 #ifdef DEBUG
-        for (unsigned int j=0; j<n_cols; ++j)
+        for (size_type j=0; j<n_cols; ++j)
           Assert (numbers::is_finite(values[j]), ExcNumberNotFinite());
 #endif
       }
@@ -3359,7 +3387,7 @@ namespace TrilinosWrappers
           }
 
         n_columns = 0;
-        for (unsigned int j=0; j<n_cols; ++j)
+        for (size_type j=0; j<n_cols; ++j)
           {
             const double value = values[j];
 
@@ -3372,14 +3400,14 @@ namespace TrilinosWrappers
               }
           }
 
-        Assert(n_columns <= (int)n_cols, ExcInternalError());
+        Assert(n_columns <= (TrilinosWrappers::types::int_type)n_cols, ExcInternalError());
 
       }
 
     // If the calling matrix owns the row to which we want to add values, we
     // can directly call the Epetra_CrsMatrix input function, which is much
     // faster than the Epetra_FECrsMatrix function.
-    if (row_partitioner().MyGID(static_cast<int>(row)) == true)
+    if (row_partitioner().MyGID(static_cast<TrilinosWrappers::types::int_type>(row)) == true)
       {
         ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues(row, n_columns,
                                                              col_value_ptr,
@@ -3395,7 +3423,8 @@ namespace TrilinosWrappers
         // a time).
         compressed = false;
 
-        ierr = matrix->SumIntoGlobalValues (1, (int *)&row, n_columns,
+        ierr = matrix->SumIntoGlobalValues (1,
+                                            (TrilinosWrappers::types::int_type *)&row, n_columns,
                                             col_index_ptr,
                                             &col_value_ptr,
                                             Epetra_FECrsMatrix::ROW_MAJOR);
@@ -3409,15 +3438,15 @@ namespace TrilinosWrappers
         std::cout << "Got error " << ierr << " in row " << row
                   << " of proc " << row_partitioner().Comm().MyPID()
                   << " when trying to add the columns:" << std::endl;
-        for (int i=0; i<n_columns; ++i)
+        for (TrilinosWrappers::types::int_type i=0; i<n_columns; ++i)
           std::cout << col_index_ptr[i] << " ";
         std::cout << std::endl << std::endl;
         std::cout << "Matrix row has the following indices:" << std::endl;
         int n_indices, *indices;
-        trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast<int>(row)),
+        trilinos_sparsity_pattern().ExtractMyRowView(row_partitioner().LID(static_cast<TrilinosWrappers::types::int_type>(row)),
                                                      n_indices,
                                                      indices);
-        for (int i=0; i<n_indices; ++i)
+        for (TrilinosWrappers::types::int_type i=0; i<n_indices; ++i)
           std::cout << indices[i] << " ";
         std::cout << endl << std::endl;
         Assert (ierr <= 0,
@@ -3433,19 +3462,27 @@ namespace TrilinosWrappers
   // called frequently and do only involve
   // a call to some Trilinos function.
   inline
-  unsigned int
+  SparseMatrix::size_type
   SparseMatrix::m () const
   {
-    return matrix -> NumGlobalRows();
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    return matrix->NumGlobalRows();
+#else
+    return matrix->NumGlobalRows64();
+#endif
   }
 
 
 
   inline
-  unsigned int
+  SparseMatrix::size_type
   SparseMatrix::n () const
   {
-    return matrix -> NumGlobalCols();
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    return matrix->NumGlobalCols();
+#else
+    return matrix->NumGlobalCols64();
+#endif
   }
 
 
@@ -3460,12 +3497,17 @@ namespace TrilinosWrappers
 
 
   inline
-  std::pair<unsigned int, unsigned int>
+  std::pair<SparseMatrix::size_type, SparseMatrix::size_type>
   SparseMatrix::local_range () const
   {
-    unsigned int begin, end;
-    begin = matrix -> RowMap().MinMyGID();
-    end = matrix -> RowMap().MaxMyGID()+1;
+    size_type begin, end;
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    begin = matrix->RowMap().MinMyGID();
+    end = matrix->RowMap().MaxMyGID()+1;
+#else
+    begin = matrix->RowMap().MinMyGID64();
+    end = matrix->RowMap().MaxMyGID64()+1;
+#endif
 
     return std::make_pair (begin, end);
   }
@@ -3473,10 +3515,14 @@ namespace TrilinosWrappers
 
 
   inline
-  unsigned int
+  SparseMatrix::size_type
   SparseMatrix::n_nonzero_elements () const
   {
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
     return matrix->NumGlobalNonzeros();
+#else
+    return matrix->NumGlobalNonzeros64();
+#endif
   }
 
 
@@ -3628,6 +3674,9 @@ namespace TrilinosWrappers
                 ExcMessage ("Column map of matrix does not fit with vector map!"));
         Assert (out.vector_partitioner().SameAs(m.RangeMap()) == true,
                 ExcMessage ("Row map of matrix does not fit with vector map!"));
+        (void)m;
+        (void)in;
+        (void)out;
       }
     }
   }
@@ -3641,12 +3690,16 @@ namespace TrilinosWrappers
   {
     Assert (&src != &dst, ExcSourceEqualsDestination());
     Assert (matrix->Filled(), ExcMatrixNotCompressed());
+    (void)src;
+    (void)dst;
 
     internal::SparseMatrix::check_vector_map_equality(*matrix, src, dst);
-    const int dst_local_size = dst.end() - dst.begin();
-    AssertDimension (dst_local_size, matrix->RangeMap().NumMyElements());
-    const int src_local_size = src.end() - src.begin();
-    AssertDimension (src_local_size, matrix->DomainMap().NumMyElements());
+    const size_type dst_local_size = dst.end() - dst.begin();
+    AssertDimension (dst_local_size, static_cast<size_type>(matrix->RangeMap().NumMyElements()));
+    (void)dst_local_size;
+    const size_type src_local_size = src.end() - src.begin();
+    AssertDimension (src_local_size, static_cast<size_type>(matrix->DomainMap().NumMyElements()));
+    (void)src_local_size;
 
     Epetra_MultiVector tril_dst (View, matrix->RangeMap(), dst.begin(),
                                  matrix->DomainMap().NumMyPoints(), 1);
@@ -3660,7 +3713,7 @@ namespace TrilinosWrappers
   }
 
 
+
   template <typename VectorType>
   inline
   void
@@ -3671,10 +3724,10 @@ namespace TrilinosWrappers
     Assert (matrix->Filled(), ExcMatrixNotCompressed());
 
     internal::SparseMatrix::check_vector_map_equality(*matrix, dst, src);
-    const int dst_local_size = dst.end() - dst.begin();
-    AssertDimension (dst_local_size, matrix->DomainMap().NumMyElements());
-    const int src_local_size = src.end() - src.begin();
-    AssertDimension (src_local_size, matrix->RangeMap().NumMyElements());
+    const size_type dst_local_size = dst.end() - dst.begin();
+    AssertDimension (dst_local_size, static_cast<size_type>(matrix->DomainMap().NumMyElements()));
+    const size_type src_local_size = src.end() - src.begin();
+    AssertDimension (src_local_size, static_cast<size_type>(matrix->RangeMap().NumMyElements()));
 
     Epetra_MultiVector tril_dst (View, matrix->DomainMap(), dst.begin(),
                                  matrix->DomainMap().NumMyPoints(), 1);
index 0fc964172728d52f8280a675a5e8673cdfee723f..bd0d7c70ea2f2343aba8f5a95db6348a2ee268a7 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_sparsity_pattern_h
 #define __deal2__trilinos_sparsity_pattern_h
 
@@ -70,30 +75,35 @@ namespace TrilinosWrappers
     class Accessor
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef dealii::types::global_dof_index size_type;
+
       /**
        * Constructor.
        */
       Accessor (const SparsityPattern *sparsity_pattern,
-                const unsigned int     row,
-                const unsigned int     index);
+                const size_type        row,
+                const size_type        index);
 
       /**
        * Row number of the element
        * represented by this object.
        */
-      unsigned int row() const;
+      size_type row() const;
 
       /**
        * Index in row of the element
        * represented by this object.
        */
-      unsigned int index() const;
+      size_type index() const;
 
       /**
        * Column number of the element
        * represented by this object.
        */
-      unsigned int column() const;
+      size_type column() const;
 
       /**
        * Exception
@@ -104,7 +114,7 @@ namespace TrilinosWrappers
        * Exception
        */
       DeclException3 (ExcAccessToNonlocalRow,
-                      int, int, int,
+                      size_type, size_type, size_type,
                       << "You tried to access row " << arg1
                       << " of a distributed sparsity pattern, "
                       << " but only rows " << arg2 << " through " << arg3
@@ -119,12 +129,12 @@ namespace TrilinosWrappers
       /**
        * Current row number.
        */
-      unsigned int a_row;
+      size_type a_row;
 
       /**
        * Current index in row.
        */
-      unsigned int a_index;
+      size_type a_index;
 
       /**
        * Cache where we store the
@@ -151,7 +161,7 @@ namespace TrilinosWrappers
        * than one accessor can access
        * this data if necessary.
        */
-      std_cxx1x::shared_ptr<const std::vector<unsigned int> > colnum_cache;
+      std_cxx1x::shared_ptr<const std::vector<size_type> > colnum_cache;
 
       /**
        * Discard the old row caches
@@ -178,6 +188,10 @@ namespace TrilinosWrappers
     class Iterator
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef dealii::types::global_dof_index size_type;
 
       /**
        * Constructor. Create an
@@ -186,8 +200,8 @@ namespace TrilinosWrappers
        * the index within it.
        */
       Iterator (const SparsityPattern *sparsity_pattern,
-                const unsigned int     row,
-                const unsigned int     index);
+                const size_type        row,
+                const size_type        index);
 
       /**
        * Prefix increment.
@@ -235,7 +249,7 @@ namespace TrilinosWrappers
        * Exception
        */
       DeclException2 (ExcInvalidIndexWithinRow,
-                      int, int,
+                      size_type, size_type,
                       << "Attempt to access element " << arg2
                       << " of row " << arg1
                       << " which doesn't have that many elements.");
@@ -277,6 +291,11 @@ namespace TrilinosWrappers
   {
   public:
 
+    /**
+     * Declare type for container size.
+     */
+    typedef dealii::types::global_dof_index size_type;
+
     /**
      * Declare a typedef for the
      * iterator class.
@@ -321,9 +340,9 @@ namespace TrilinosWrappers
      * will reduce the setup time of the
      * sparsity pattern.
      */
-    SparsityPattern (const unsigned int  m,
-                     const unsigned int  n,
-                     const unsigned int  n_entries_per_row = 0);
+    SparsityPattern (const size_type  m,
+                     const size_type  n,
+                     const size_type  n_entries_per_row = 0);
 
     /**
      * Generate a sparsity pattern that is
@@ -338,9 +357,9 @@ namespace TrilinosWrappers
      * each row (an information usually
      * not available, though).
      */
-    SparsityPattern (const unsigned int               m,
-                     const unsigned int               n,
-                     const std::vector<unsigned int> &n_entries_per_row);
+    SparsityPattern (const size_type               m,
+                     const size_type               n,
+                     const std::vector<size_type> &n_entries_per_row);
 
     /**
      * Copy constructor. Sets the calling
@@ -376,9 +395,9 @@ namespace TrilinosWrappers
      * pattern.
      */
     void
-    reinit (const unsigned int  m,
-            const unsigned int  n,
-            const unsigned int  n_entries_per_row = 0);
+    reinit (const size_type  m,
+            const size_type  n,
+            const size_type  n_entries_per_row = 0);
 
     /**
      * Initialize a sparsity pattern that
@@ -393,9 +412,9 @@ namespace TrilinosWrappers
      * each row.
      */
     void
-    reinit (const unsigned int               m,
-            const unsigned int               n,
-            const std::vector<unsigned int> &n_entries_per_row);
+    reinit (const size_type               m,
+            const size_type               n,
+            const std::vector<size_type> &n_entries_per_row);
 
     /**
      * Copy function. Sets the calling
@@ -488,8 +507,8 @@ namespace TrilinosWrappers
      * increases the performance when
      * creating the sparsity pattern.
      */
-    SparsityPattern (const Epetra_Map   &parallel_partitioning,
-                     const unsigned int  n_entries_per_row = 0);
+    SparsityPattern (const Epetra_Map &parallel_partitioning,
+                     const size_type   n_entries_per_row = 0);
 
     /**
      * Same as before, but now use the
@@ -510,8 +529,8 @@ namespace TrilinosWrappers
      * sparsity pattern is designed to
      * describe.
      */
-    SparsityPattern (const Epetra_Map                &parallel_partitioning,
-                     const std::vector<unsigned int> &n_entries_per_row);
+    SparsityPattern (const Epetra_Map             &parallel_partitioning,
+                     const std::vector<size_type> &n_entries_per_row);
 
     /**
      * This constructor is similar to the
@@ -543,7 +562,7 @@ namespace TrilinosWrappers
      */
     SparsityPattern (const Epetra_Map   &row_parallel_partitioning,
                      const Epetra_Map   &col_parallel_partitioning,
-                     const unsigned int  n_entries_per_row = 0);
+                     const size_type     n_entries_per_row = 0);
 
     /**
      * This constructor is similar to the
@@ -565,9 +584,9 @@ namespace TrilinosWrappers
      * the number of entries in each row of
      * the newly generated matrix.
      */
-    SparsityPattern (const Epetra_Map                &row_parallel_partitioning,
-                     const Epetra_Map                &col_parallel_partitioning,
-                     const std::vector<unsigned int> &n_entries_per_row);
+    SparsityPattern (const Epetra_Map             &row_parallel_partitioning,
+                     const Epetra_Map             &col_parallel_partitioning,
+                     const std::vector<size_type> &n_entries_per_row);
 
     /**
      * Reinitialization function for
@@ -595,8 +614,8 @@ namespace TrilinosWrappers
      * add() function.
      */
     void
-    reinit (const Epetra_Map   &parallel_partitioning,
-            const unsigned int  n_entries_per_row = 0);
+    reinit (const Epetra_Map &parallel_partitioning,
+            const size_type   n_entries_per_row = 0);
 
     /**
      * Same as before, but now use the
@@ -617,8 +636,8 @@ namespace TrilinosWrappers
      * designed to describe.
      */
     void
-    reinit (const Epetra_Map                &parallel_partitioning,
-            const std::vector<unsigned int> &n_entries_per_row);
+    reinit (const Epetra_Map             &parallel_partitioning,
+            const std::vector<size_type> &n_entries_per_row);
 
     /**
      * This reinit function is similar to
@@ -651,7 +670,7 @@ namespace TrilinosWrappers
     void
     reinit (const Epetra_Map   &row_parallel_partitioning,
             const Epetra_Map   &col_parallel_partitioning,
-            const unsigned int  n_entries_per_row = 0);
+            const size_type     n_entries_per_row = 0);
 
     /**
      * This reinit function is similar to
@@ -677,9 +696,9 @@ namespace TrilinosWrappers
      * matrix.
      */
     void
-    reinit (const Epetra_Map                &row_parallel_partitioning,
-            const Epetra_Map                &col_parallel_partitioning,
-            const std::vector<unsigned int> &n_entries_per_row);
+    reinit (const Epetra_Map             &row_parallel_partitioning,
+            const Epetra_Map             &col_parallel_partitioning,
+            const std::vector<size_type> &n_entries_per_row);
 
     /**
      * Reinit function. Takes one of the
@@ -750,9 +769,9 @@ namespace TrilinosWrappers
      * increases the performance when
      * creating the sparsity pattern.
      */
-    SparsityPattern (const IndexSet     &parallel_partitioning,
-                     const MPI_Comm     &communicator = MPI_COMM_WORLD,
-                     const unsigned int  n_entries_per_row = 0);
+    SparsityPattern (const IndexSet  &parallel_partitioning,
+                     const MPI_Comm  &communicator = MPI_COMM_WORLD,
+                     const size_type  n_entries_per_row = 0);
 
     /**
      * Same as before, but now use the
@@ -775,7 +794,7 @@ namespace TrilinosWrappers
      */
     SparsityPattern (const IndexSet                  &parallel_partitioning,
                      const MPI_Comm                  &communicator,
-                     const std::vector<unsigned int> &n_entries_per_row);
+                     const std::vector<size_type> &n_entries_per_row);
 
     /**
      * This constructor is similar to the
@@ -800,10 +819,10 @@ namespace TrilinosWrappers
      * row is specified as the maximum
      * number of entries argument.
      */
-    SparsityPattern (const IndexSet     &row_parallel_partitioning,
-                     const IndexSet     &col_parallel_partitioning,
-                     const MPI_Comm     &communicator = MPI_COMM_WORLD,
-                     const unsigned int  n_entries_per_row = 0);
+    SparsityPattern (const IndexSet  &row_parallel_partitioning,
+                     const IndexSet  &col_parallel_partitioning,
+                     const MPI_Comm  &communicator = MPI_COMM_WORLD,
+                     const size_type  n_entries_per_row = 0);
 
     /**
      * This constructor is similar to the
@@ -825,10 +844,10 @@ namespace TrilinosWrappers
      * the number of entries in each row of
      * the newly generated matrix.
      */
-    SparsityPattern (const IndexSet                  &row_parallel_partitioning,
-                     const IndexSet                  &col_parallel_partitioning,
-                     const MPI_Comm                  &communicator,
-                     const std::vector<unsigned int> &n_entries_per_row);
+    SparsityPattern (const IndexSet               &row_parallel_partitioning,
+                     const IndexSet               &col_parallel_partitioning,
+                     const MPI_Comm               &communicator,
+                     const std::vector<size_type> &n_entries_per_row);
 
     /**
      * Reinitialization function for
@@ -857,9 +876,9 @@ namespace TrilinosWrappers
      * add() function.
      */
     void
-    reinit (const IndexSet     &parallel_partitioning,
-            const MPI_Comm     &communicator = MPI_COMM_WORLD,
-            const unsigned int  n_entries_per_row = 0);
+    reinit (const IndexSet  &parallel_partitioning,
+            const MPI_Comm  &communicator = MPI_COMM_WORLD,
+            const size_type  n_entries_per_row = 0);
 
     /**
      * Same as before, but now use the
@@ -880,9 +899,9 @@ namespace TrilinosWrappers
      * designed to describe.
      */
     void
-    reinit (const IndexSet                  &parallel_partitioning,
-            const MPI_Comm                  &communicator,
-            const std::vector<unsigned int> &n_entries_per_row);
+    reinit (const IndexSet               &parallel_partitioning,
+            const MPI_Comm               &communicator,
+            const std::vector<size_type> &n_entries_per_row);
 
     /**
      * This reinit function is similar to
@@ -914,10 +933,10 @@ namespace TrilinosWrappers
      * <tt>n_entries_per_row</tt>.
      */
     void
-    reinit (const IndexSet     &row_parallel_partitioning,
-            const IndexSet     &col_parallel_partitioning,
-            const MPI_Comm     &communicator = MPI_COMM_WORLD,
-            const unsigned int  n_entries_per_row = 0);
+    reinit (const IndexSet  &row_parallel_partitioning,
+            const IndexSet  &col_parallel_partitioning,
+            const MPI_Comm  &communicator = MPI_COMM_WORLD,
+            const size_type  n_entries_per_row = 0);
 
     /**
      * Same as before, but now using a
@@ -927,10 +946,10 @@ namespace TrilinosWrappers
      * sparsity pattern.
      */
     void
-    reinit (const IndexSet                  &row_parallel_partitioning,
-            const IndexSet                  &col_parallel_partitioning,
-            const MPI_Comm                  &communicator,
-            const std::vector<unsigned int> &n_entries_per_row);
+    reinit (const IndexSet               &row_parallel_partitioning,
+            const IndexSet               &col_parallel_partitioning,
+            const MPI_Comm               &communicator,
+            const std::vector<size_type> &n_entries_per_row);
 
     /**
      * Reinit function. Takes one of the
@@ -1003,13 +1022,13 @@ namespace TrilinosWrappers
      * Return the number of rows in this
      * sparsity pattern.
      */
-    unsigned int n_rows () const;
+    size_type n_rows () const;
 
     /**
      * Return the number of columns in
      * this sparsity pattern.
      */
-    unsigned int n_cols () const;
+    size_type n_cols () const;
 
     /**
      * Return the local dimension of the
@@ -1040,7 +1059,7 @@ namespace TrilinosWrappers
      * it will be a pair (i,i+n), where
      * <tt>n=local_size()</tt>.
      */
-    std::pair<unsigned int, unsigned int>
+    std::pair<size_type, size_type>
     local_range () const;
 
     /**
@@ -1048,19 +1067,19 @@ namespace TrilinosWrappers
      * in the local range or not,
      * see also local_range().
      */
-    bool in_local_range (const unsigned int index) const;
+    bool in_local_range (const size_type index) const;
 
     /**
      * Return the number of nonzero
      * elements of this sparsity pattern.
      */
-    unsigned int n_nonzero_elements () const;
+    size_type n_nonzero_elements () const;
 
     /**
      * Number of entries in a
      * specific row.
      */
-    unsigned int row_length (const unsigned int row) const;
+    size_type row_length (const size_type row) const;
 
     /**
      * Compute the bandwidth of the
@@ -1073,7 +1092,7 @@ namespace TrilinosWrappers
      * bandwidth a $n\times m$ matrix can
      * have is $\max\{n-1,m-1\}$.
      */
-    unsigned int bandwidth () const;
+    size_type bandwidth () const;
 
     /**
      * Return whether the object is
@@ -1089,8 +1108,8 @@ namespace TrilinosWrappers
      * sparsity pattern (i.e., it may be
      * non-zero) or not.
      */
-    bool exists (const unsigned int i,
-                 const unsigned int j) const;
+    bool exists (const size_type i,
+                 const size_type j) const;
 
     /**
      * Determine an estimate for the
@@ -1109,8 +1128,8 @@ namespace TrilinosWrappers
      * Add the element (<i>i,j</i>) to
      * the sparsity pattern.
      */
-    void add (const unsigned int i,
-              const unsigned int j);
+    void add (const size_type i,
+              const size_type j);
 
 
     /**
@@ -1118,10 +1137,10 @@ namespace TrilinosWrappers
      * the sparsity pattern.
      */
     template <typename ForwardIterator>
-    void add_entries (const unsigned int row,
-                      ForwardIterator    begin,
-                      ForwardIterator    end,
-                      const bool         indices_are_sorted = false);
+    void add_entries (const size_type  row,
+                      ForwardIterator  begin,
+                      ForwardIterator  end,
+                      const bool       indices_are_sorted = false);
 //@}
     /**
      * @name Access of underlying Trilinos data
@@ -1216,7 +1235,7 @@ namespace TrilinosWrappers
      * that the iterator may not be
      * dereferencable in that case.
      */
-    const_iterator begin (const unsigned int r) const;
+    const_iterator begin (const size_type r) const;
 
     /**
      * Final iterator of row
@@ -1233,7 +1252,7 @@ namespace TrilinosWrappers
      * the end iterator for the
      * last row of a matrix.
      */
-    const_iterator end (const unsigned int r) const;
+    const_iterator end (const size_type r) const;
 
 //@}
     /**
@@ -1309,7 +1328,7 @@ namespace TrilinosWrappers
      * Exception
      */
     DeclException2 (ExcInvalidIndex,
-                    int, int,
+                    size_type, size_type,
                     << "The entry with index <" << arg1 << ',' << arg2
                     << "> does not exist.");
 
@@ -1322,7 +1341,7 @@ namespace TrilinosWrappers
      * Exception
      */
     DeclException4 (ExcAccessToNonLocalElement,
-                    int, int, int, int,
+                    size_type, size_type, size_type, size_type,
                     << "You tried to access element (" << arg1
                     << "/" << arg2 << ")"
                     << " of a distributed matrix, but only rows "
@@ -1333,7 +1352,7 @@ namespace TrilinosWrappers
      * Exception
      */
     DeclException2 (ExcAccessToNonPresentElement,
-                    int, int,
+                    size_type, size_type,
                     << "You tried to access element (" << arg1
                     << "/" << arg2 << ")"
                     << " of a sparse matrix, but it appears to not"
@@ -1382,8 +1401,8 @@ namespace TrilinosWrappers
 
     inline
     Accessor::Accessor (const SparsityPattern *sp,
-                        const unsigned int     row,
-                        const unsigned int     index)
+                        const size_type        row,
+                        const size_type        index)
       :
       sparsity_pattern(const_cast<SparsityPattern *>(sp)),
       a_row(row),
@@ -1394,7 +1413,7 @@ namespace TrilinosWrappers
 
 
     inline
-    unsigned int
+    Accessor::size_type
     Accessor::row() const
     {
       Assert (a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern());
@@ -1404,7 +1423,7 @@ namespace TrilinosWrappers
 
 
     inline
-    unsigned int
+    Accessor::size_type
     Accessor::column() const
     {
       Assert (a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern());
@@ -1414,7 +1433,7 @@ namespace TrilinosWrappers
 
 
     inline
-    unsigned int
+    Accessor::size_type
     Accessor::index() const
     {
       Assert (a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern());
@@ -1425,8 +1444,8 @@ namespace TrilinosWrappers
 
     inline
     Iterator::Iterator(const SparsityPattern *sp,
-                       const unsigned int     row,
-                       const unsigned int     index)
+                       const size_type        row,
+                       const size_type        index)
       :
       accessor(sp, row, index)
     {}
@@ -1544,9 +1563,9 @@ namespace TrilinosWrappers
 
   inline
   SparsityPattern::const_iterator
-  SparsityPattern::begin(const unsigned int r) const
+  SparsityPattern::begin(const size_type r) const
   {
-    Assert (r < n_rows(), ExcIndexRange(r, 0, n_rows()));
+    Assert (r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
     if (row_length(r) > 0)
       return const_iterator(this, r, 0);
     else
@@ -1557,14 +1576,14 @@ namespace TrilinosWrappers
 
   inline
   SparsityPattern::const_iterator
-  SparsityPattern::end(const unsigned int r) const
+  SparsityPattern::end(const size_type r) const
   {
-    Assert (r < n_rows(), ExcIndexRange(r, 0, n_rows()));
+    Assert (r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
 
     // place the iterator on the first entry
     // past this line, or at the end of the
     // matrix
-    for (unsigned int i=r+1; i<n_rows(); ++i)
+    for (size_type i=r+1; i<n_rows(); ++i)
       if (row_length(i) > 0)
         return const_iterator(this, i, 0);
 
@@ -1577,14 +1596,19 @@ namespace TrilinosWrappers
 
   inline
   bool
-  SparsityPattern::in_local_range (const unsigned int index) const
+  SparsityPattern::in_local_range (const size_type index) const
   {
-    int begin, end;
+    TrilinosWrappers::types::int_type begin, end;
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
     begin = graph->RowMap().MinMyGID();
     end = graph->RowMap().MaxMyGID()+1;
+#else
+    begin = graph->RowMap().MinMyGID64();
+    end = graph->RowMap().MaxMyGID64()+1;
+#endif
 
-    return ((index >= static_cast<unsigned int>(begin)) &&
-            (index < static_cast<unsigned int>(end)));
+    return ((index >= static_cast<size_type>(begin)) &&
+            (index < static_cast<size_type>(end)));
   }
 
 
@@ -1609,8 +1633,8 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparsityPattern::add (const unsigned int i,
-                        const unsigned int j)
+  SparsityPattern::add (const size_type i,
+                        const size_type j)
   {
     add_entries (i, &j, &j+1);
   }
@@ -1620,19 +1644,33 @@ namespace TrilinosWrappers
   template <typename ForwardIterator>
   inline
   void
-  SparsityPattern::add_entries (const unsigned int row,
-                                ForwardIterator    begin,
-                                ForwardIterator    end,
-                                const bool         /*indices_are_sorted*/)
+  SparsityPattern::add_entries (const size_type row,
+                                ForwardIterator begin,
+                                ForwardIterator end,
+                                const bool      /*indices_are_sorted*/)
   {
     if (begin == end)
       return;
 
-    int *col_index_ptr = (int *)(&*begin);
+    // verify that the size of the data type Trilinos expects matches that the
+    // iterator points to. we allow for some slippage between signed and
+    // unsigned and only compare that they are both eiter 32 or 64 bit. to
+    // write this test properly, not that we cannot compare the size of
+    // '*begin' because 'begin' may be an iterator and '*begin' may be an
+    // accessor class. consequently, we need to somehow get an actual value
+    // from it which we can by evaluating an expression such as when
+    // multiplying the value produced by 2
+    Assert (sizeof(TrilinosWrappers::types::int_type) ==
+            sizeof((*begin)*2),
+            ExcNotImplemented());
+
+    TrilinosWrappers::types::int_type *col_index_ptr =
+      (TrilinosWrappers::types::int_type *)(&*begin);
     const int n_cols = static_cast<int>(end - begin);
     compressed = false;
 
-    const int ierr = graph->InsertGlobalIndices (1, (int *)&row,
+    const int ierr = graph->InsertGlobalIndices (1,
+                                                 (TrilinosWrappers::types::int_type *)&row,
                                                  n_cols, col_index_ptr);
 
     AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
@@ -1695,9 +1733,9 @@ namespace TrilinosWrappers
 
 
   inline
-  SparsityPattern::SparsityPattern  (const IndexSet     &parallel_partitioning,
-                                     const MPI_Comm     &communicator,
-                                     const unsigned int  n_entries_per_row)
+  SparsityPattern::SparsityPattern  (const IndexSet  &parallel_partitioning,
+                                     const MPI_Comm  &communicator,
+                                     const size_type  n_entries_per_row)
     :
     compressed (false)
   {
@@ -1711,7 +1749,7 @@ namespace TrilinosWrappers
   inline
   SparsityPattern::SparsityPattern  (const IndexSet     &parallel_partitioning,
                                      const MPI_Comm     &communicator,
-                                     const std::vector<unsigned int> &n_entries_per_row)
+                                     const std::vector<size_type> &n_entries_per_row)
     :
     compressed (false)
   {
@@ -1723,10 +1761,10 @@ namespace TrilinosWrappers
 
 
   inline
-  SparsityPattern::SparsityPattern  (const IndexSet     &row_parallel_partitioning,
-                                     const IndexSet     &col_parallel_partitioning,
-                                     const MPI_Comm     &communicator,
-                                     const unsigned int  n_entries_per_row)
+  SparsityPattern::SparsityPattern  (const IndexSet  &row_parallel_partitioning,
+                                     const IndexSet  &col_parallel_partitioning,
+                                     const MPI_Comm  &communicator,
+                                     const size_type  n_entries_per_row)
     :
     compressed (false)
   {
@@ -1744,7 +1782,7 @@ namespace TrilinosWrappers
   SparsityPattern  (const IndexSet     &row_parallel_partitioning,
                     const IndexSet     &col_parallel_partitioning,
                     const MPI_Comm     &communicator,
-                    const std::vector<unsigned int> &n_entries_per_row)
+                    const std::vector<size_type> &n_entries_per_row)
     :
     compressed (false)
   {
@@ -1759,9 +1797,9 @@ namespace TrilinosWrappers
 
   inline
   void
-  SparsityPattern::reinit (const IndexSet     &parallel_partitioning,
-                           const MPI_Comm     &communicator,
-                           const unsigned int  n_entries_per_row)
+  SparsityPattern::reinit (const IndexSet  &parallel_partitioning,
+                           const MPI_Comm  &communicator,
+                           const size_type  n_entries_per_row)
   {
     Epetra_Map map = parallel_partitioning.make_trilinos_map (communicator,
                                                               false);
@@ -1773,7 +1811,7 @@ namespace TrilinosWrappers
   inline
   void SparsityPattern::reinit (const IndexSet     &parallel_partitioning,
                                 const MPI_Comm     &communicator,
-                                const std::vector<unsigned int> &n_entries_per_row)
+                                const std::vector<size_type> &n_entries_per_row)
   {
     Epetra_Map map = parallel_partitioning.make_trilinos_map (communicator,
                                                               false);
@@ -1783,10 +1821,10 @@ namespace TrilinosWrappers
 
 
   inline
-  void SparsityPattern::reinit (const IndexSet     &row_parallel_partitioning,
-                                const IndexSet     &col_parallel_partitioning,
-                                const MPI_Comm     &communicator,
-                                const unsigned int  n_entries_per_row)
+  void SparsityPattern::reinit (const IndexSet &row_parallel_partitioning,
+                                const IndexSet &col_parallel_partitioning,
+                                const MPI_Comm &communicator,
+                                const size_type  n_entries_per_row)
   {
     Epetra_Map row_map =
       row_parallel_partitioning.make_trilinos_map (communicator, false);
@@ -1801,7 +1839,7 @@ namespace TrilinosWrappers
   SparsityPattern::reinit (const IndexSet     &row_parallel_partitioning,
                            const IndexSet     &col_parallel_partitioning,
                            const MPI_Comm     &communicator,
-                           const std::vector<unsigned int> &n_entries_per_row)
+                           const std::vector<size_type> &n_entries_per_row)
   {
     Epetra_Map row_map =
       row_parallel_partitioning.make_trilinos_map (communicator, false);
index 79bafae4fab6c712901b65735373b21d0b4c68bf..d8b651925b4c0f0bfd7cad1b61b5572a641e99ed 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_vector_h
 #define __deal2__trilinos_vector_h
 
@@ -41,6 +46,28 @@ template <typename> class Vector;
 namespace TrilinosWrappers
 {
   class SparseMatrix;
+
+  namespace
+  {
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    // define a helper function that queries the global ID of local ID of
+    // an Epetra_BlockMap object  by calling either the 32- or 64-bit
+    // function necessary.
+    int gid(const Epetra_BlockMap &map, int i)
+    {
+      return map.GID(i);
+    }
+#else
+    // define a helper function that queries the global ID of local ID of
+    // an Epetra_BlockMap object  by calling either the 32- or 64-bit
+    // function necessary.
+    long long int gid(const Epetra_BlockMap &map, int i)
+    {
+      return map.GID64(i);
+    }
+#endif
+  }
+
   /**
    * Namespace for Trilinos vector classes that work in parallel over
    * MPI. This namespace is restricted to vectors only, whereas matrices
@@ -127,12 +154,12 @@ namespace TrilinosWrappers
      * @code
      * TrilinosWrappers::Vector vector;
      * // do some write operations on the vector
-     * for (unsigned int i=0; i<vector->size(); ++i)
+     * for (size_type i=0; i<vector->size(); ++i)
      *   vector(i) = i;
      *
      *                   // do some additions to vector elements, but
      *                   // only for some elements
-     *   for (unsigned int i=0; i<vector->size(); ++i)
+     *   for (size_type i=0; i<vector->size(); ++i)
      *     if (some_condition(i) == true)
      *       vector(i) += 1;
      *
@@ -166,6 +193,11 @@ namespace TrilinosWrappers
     class Vector : public VectorBase
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef dealii::types::global_dof_index size_type;
+
       /**
        * A variable that indicates whether this vector
        * supports distributed data storage. If true, then
@@ -248,6 +280,16 @@ namespace TrilinosWrappers
       void reinit (const BlockVector &v,
                    const bool         import_data = false);
 
+      /**
+       * Reinit function. Creates a vector
+       * using the IndexSet local as our
+       * own unknowns, add optional ghost
+       * values ghost.
+       */
+      void reinit (const IndexSet &local,
+                   const IndexSet &ghost,
+                   const MPI_Comm &communicator = MPI_COMM_WORLD);
+
       /**
        * Set all components of the
        * vector to the given number @p
@@ -367,7 +409,7 @@ namespace TrilinosWrappers
        * this is all we need to
        * generate a parallel vector.
        */
-      Vector (const Epetra_Map &parallel_partitioning);
+      explicit Vector (const Epetra_Map &parallel_partitioning);
 
       /**
        * Copy constructor from the
@@ -380,8 +422,8 @@ namespace TrilinosWrappers
        * that sets the partitioning
        * details.
        */
-      explicit Vector (const Epetra_Map &parallel_partitioning,
-                       const VectorBase &v);
+      Vector (const Epetra_Map &parallel_partitioning,
+              const VectorBase &v);
 
       /**
        * Reinitialize from a deal.II
@@ -409,8 +451,8 @@ namespace TrilinosWrappers
        * elements.
        */
       template <typename Number>
-      explicit Vector (const Epetra_Map             &parallel_partitioning,
-                       const dealii::Vector<Number> &v);
+      Vector (const Epetra_Map             &parallel_partitioning,
+              const dealii::Vector<Number> &v);
 //@}
       /**
        * @name Initialization with an IndexSet
@@ -426,7 +468,14 @@ namespace TrilinosWrappers
        * need to generate a %parallel
        * vector.
        */
-      Vector (const IndexSet &parallel_partitioning,
+      explicit Vector (const IndexSet &parallel_partitioning,
+                       const MPI_Comm &communicator = MPI_COMM_WORLD);
+
+      /**
+       * Creates a ghosted parallel vector.
+       */
+      Vector (const IndexSet &local,
+              const IndexSet &ghost,
               const MPI_Comm &communicator = MPI_COMM_WORLD);
 
       /**
@@ -440,9 +489,9 @@ namespace TrilinosWrappers
        * communicator that set the
        * partitioning details.
        */
-      explicit Vector (const IndexSet   &parallel_partitioning,
-                       const VectorBase &v,
-                       const MPI_Comm   &communicator = MPI_COMM_WORLD);
+      Vector (const IndexSet   &parallel_partitioning,
+              const VectorBase &v,
+              const MPI_Comm   &communicator = MPI_COMM_WORLD);
 
       /**
        * Copy-constructor from deal.II
@@ -451,9 +500,9 @@ namespace TrilinosWrappers
        * copies all the elements.
        */
       template <typename Number>
-      explicit Vector (const IndexSet               &parallel_partitioning,
-                       const dealii::Vector<Number> &v,
-                       const MPI_Comm               &communicator = MPI_COMM_WORLD);
+      Vector (const IndexSet               &parallel_partitioning,
+              const dealii::Vector<Number> &v,
+              const MPI_Comm               &communicator = MPI_COMM_WORLD);
 
       /**
        * Reinit functionality. This function
@@ -529,7 +578,7 @@ namespace TrilinosWrappers
       // deal.II might not use doubles, so
       // that a direct access is not possible.
       for (int i=0; i<size; ++i)
-        (*vector)[0][i] = v(parallel_partitioner.GID(i));
+        (*vector)[0][i] = v(gid(parallel_partitioner,i));
     }
 
 
@@ -550,7 +599,7 @@ namespace TrilinosWrappers
       if (size() != v.size())
         {
           vector.reset (new Epetra_FEVector(Epetra_Map
-                                            (static_cast<int>(v.size()), 0,
+                                            (static_cast<TrilinosWrappers::types::int_type>(v.size()), 0,
 #ifdef DEAL_II_WITH_MPI
                                              Epetra_MpiComm(MPI_COMM_SELF)
 #else
@@ -584,6 +633,11 @@ namespace TrilinosWrappers
   class Vector : public VectorBase
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef dealii::types::global_dof_index size_type;
+
     /**
      * A variable that indicates whether this vector
      * supports distributed data storage. If true, then
@@ -614,7 +668,7 @@ namespace TrilinosWrappers
      * input the number of elements
      * in the vector.
      */
-    Vector (const unsigned int n);
+    explicit Vector (const size_type n);
 
     /**
      * This constructor takes as
@@ -628,7 +682,7 @@ namespace TrilinosWrappers
      * map will be generated
      * internally.
      */
-    Vector (const Epetra_Map &partitioning);
+    explicit Vector (const Epetra_Map &partitioning);
 
     /**
      * This constructor takes as input
@@ -641,8 +695,8 @@ namespace TrilinosWrappers
      * taken and a localized version will
      * be generated internally.
      */
-    Vector (const IndexSet &partitioning,
-            const MPI_Comm &communicator = MPI_COMM_WORLD);
+    explicit Vector (const IndexSet &partitioning,
+                     const MPI_Comm &communicator = MPI_COMM_WORLD);
 
     /**
      * This constructor takes a
@@ -667,8 +721,8 @@ namespace TrilinosWrappers
      * the vector to the size
      * specified by <tt>n</tt>.
      */
-    void reinit (const unsigned int n,
-                 const bool         fast = false);
+    void reinit (const size_type n,
+                 const bool      fast = false);
 
     /**
      * Initialization with an
@@ -799,7 +853,7 @@ namespace TrilinosWrappers
   template <typename number>
   Vector::Vector (const dealii::Vector<number> &v)
   {
-    Epetra_LocalMap map ((int)v.size(), 0, Utilities::Trilinos::comm_self());
+    Epetra_LocalMap map ((TrilinosWrappers::types::int_type)v.size(), 0, Utilities::Trilinos::comm_self());
     vector.reset (new Epetra_FEVector(map));
     *this = v;
   }
@@ -825,13 +879,13 @@ namespace TrilinosWrappers
       {
         vector.reset();
 
-        Epetra_LocalMap map ((int)v.size(), 0,
+        Epetra_LocalMap map ((TrilinosWrappers::types::int_type)v.size(), 0,
                              Utilities::Trilinos::comm_self());
         vector.reset (new Epetra_FEVector(map));
       }
 
     const Epetra_Map &map = vector_partitioner();
-    const int size = map.NumMyElements();
+    const TrilinosWrappers::types::int_type size = map.NumMyElements();
 
     Assert (map.MaxLID() == size-1,
             ExcDimensionMismatch(map.MaxLID(), size-1));
@@ -839,7 +893,7 @@ namespace TrilinosWrappers
     // Need to copy out values, since the
     // deal.II might not use doubles, so
     // that a direct access is not possible.
-    for (int i=0; i<size; ++i)
+    for (TrilinosWrappers::types::int_type i=0; i<size; ++i)
       (*vector)[0][i] = v(i);
 
     return *this;
index 05d5f2411716271c932b32204cc68206ba133916..674b6ca0d4f208d816bab78d8c7e3f343082ed25 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__trilinos_vector_base_h
 #define __deal2__trilinos_vector_base_h
 
@@ -52,7 +57,6 @@ namespace TrilinosWrappers
   // forward declaration
   class VectorBase;
 
-
   /**
    * @cond internal
    */
@@ -65,6 +69,11 @@ namespace TrilinosWrappers
    */
   namespace internal
   {
+    /**
+     * Declare type for container size.
+     */
+    typedef dealii::types::global_dof_index size_type;
+
     /**
      * This class implements a
      * wrapper for accessing the
@@ -90,10 +99,11 @@ namespace TrilinosWrappers
        * the actual vector class to
        * create it.
        */
-      VectorReference (VectorBase        &vector,
-                       const unsigned int index);
+      VectorReference (VectorBase     &vector,
+                       const size_type  index);
 
     public:
+
       /**
        * This looks like a copy
        * operator, but does something
@@ -187,7 +197,7 @@ namespace TrilinosWrappers
        * Exception
        */
       DeclException3 (ExcAccessToNonLocalElement,
-                      int, int, int,
+                      size_type, size_type, size_type,
                       << "You tried to access element " << arg1
                       << " of a distributed vector, but it is not stored on "
                       << "the current processor. Note: the elements stored "
@@ -208,7 +218,7 @@ namespace TrilinosWrappers
        * Index of the referenced element
        * of the vector.
        */
-      const unsigned int  index;
+      const size_type  index;
 
       /**
        * Make the vector class a
@@ -269,7 +279,7 @@ namespace TrilinosWrappers
      */
     typedef TrilinosScalar                  value_type;
     typedef TrilinosScalar                  real_type;
-    typedef std::size_t                     size_type;
+    typedef dealii::types::global_dof_index size_type;
     typedef value_type                     *iterator;
     typedef const value_type               *const_iterator;
     typedef internal::VectorReference       reference;
@@ -457,7 +467,7 @@ namespace TrilinosWrappers
      * Return the global dimension of
      * the vector.
      */
-    unsigned int size () const;
+    size_type size () const;
 
     /**
      * Return the local dimension of
@@ -477,7 +487,7 @@ namespace TrilinosWrappers
      * elements, they are included in
      * this number.
      */
-    unsigned int local_size () const;
+    size_type local_size () const;
 
     /**
      * Return a pair of indices
@@ -509,7 +519,7 @@ namespace TrilinosWrappers
      * trigger an assertion if the local portion of the vector
      * is not contiguous.
      */
-    std::pair<unsigned int, unsigned int> local_range () const;
+    std::pair<size_type, size_type> local_range () const;
 
     /**
      * Return whether @p index is in
@@ -519,7 +529,7 @@ namespace TrilinosWrappers
      * @note The same limitation for the applicability of this
      * function applies as listed in the documentation of local_range().
      */
-    bool in_local_range (const unsigned int index) const;
+    bool in_local_range (const size_type index) const;
 
     /**
      * Return an index set that describes which elements of this vector
@@ -635,7 +645,7 @@ namespace TrilinosWrappers
      * element, both read and write.
      */
     reference
-    operator () (const unsigned int index);
+    operator () (const size_type index);
 
     /**
      * Provide read-only access to an
@@ -643,7 +653,7 @@ namespace TrilinosWrappers
      * the <code>el()</code> command.
      */
     TrilinosScalar
-    operator () (const unsigned int index) const;
+    operator () (const size_type index) const;
 
     /**
      * Provide access to a given
@@ -652,7 +662,7 @@ namespace TrilinosWrappers
      * Exactly the same as operator().
      */
     reference
-    operator [] (const unsigned int index);
+    operator [] (const size_type index);
 
     /**
      * Provide read-only access to an
@@ -662,7 +672,7 @@ namespace TrilinosWrappers
      * Exactly the same as operator().
      */
     TrilinosScalar
-    operator [] (const unsigned int index) const;
+    operator [] (const size_type index) const;
 
     /**
      * Return the value of the vector
@@ -675,12 +685,12 @@ namespace TrilinosWrappers
      * elements sits on another
      * process.
      */
-    TrilinosScalar el (const unsigned int index) const;
+    TrilinosScalar el (const size_type index) const;
 
     /**
      * Make the Vector class a bit like the <tt>vector<></tt> class of
      * the C++ standard library by returning iterators to the start and end
-     * of the locally owned elements of this vector. The ordering of local elements corresponds to the one given 
+     * of the locally owned elements of this vector. The ordering of local elements corresponds to the one given
      *
      * It holds that end() - begin() == local_size().
      */
@@ -715,7 +725,7 @@ namespace TrilinosWrappers
      * argument, the corresponding
      * values in the second.
      */
-    void set (const std::vector<unsigned int>    &indices,
+    void set (const std::vector<size_type>    &indices,
               const std::vector<TrilinosScalar>  &values);
 
     /**
@@ -725,7 +735,7 @@ namespace TrilinosWrappers
      * takes a deal.II vector of
      * values.
      */
-    void set (const std::vector<unsigned int>        &indices,
+    void set (const std::vector<size_type>        &indices,
               const ::dealii::Vector<TrilinosScalar> &values);
     //@}
 
@@ -745,8 +755,8 @@ namespace TrilinosWrappers
      * the number of elements to be
      * set.
      */
-    void set (const unsigned int    n_elements,
-              const unsigned int   *indices,
+    void set (const size_type       n_elements,
+              const size_type      *indices,
               const TrilinosScalar *values);
 
     /**
@@ -757,7 +767,7 @@ namespace TrilinosWrappers
      * components specified by @p
      * indices.
      */
-    void add (const std::vector<unsigned int>   &indices,
+    void add (const std::vector<size_type>      &indices,
               const std::vector<TrilinosScalar> &values);
 
     /**
@@ -767,7 +777,7 @@ namespace TrilinosWrappers
      * takes a deal.II vector of
      * values.
      */
-    void add (const std::vector<unsigned int>        &indices,
+    void add (const std::vector<size_type>           &indices,
               const ::dealii::Vector<TrilinosScalar> &values);
 
     /**
@@ -779,8 +789,8 @@ namespace TrilinosWrappers
      * other two <tt>add()</tt>
      * functions above.
      */
-    void add (const unsigned int    n_elements,
-              const unsigned int   *indices,
+    void add (const size_type       n_elements,
+              const size_type      *indices,
               const TrilinosScalar *values);
 
     /**
@@ -1043,7 +1053,7 @@ namespace TrilinosWrappers
      * Exception
      */
     DeclException3 (ExcAccessToNonlocalElement,
-                    int, int, int,
+                    size_type, size_type, size_type,
                     << "You tried to access element " << arg1
                     << " of a distributed vector, but only entries "
                     << arg2 << " through " << arg3
@@ -1134,8 +1144,8 @@ namespace TrilinosWrappers
   namespace internal
   {
     inline
-    VectorReference::VectorReference (VectorBase        &vector,
-                                      const unsigned int index)
+    VectorReference::VectorReference (VectorBase      &vector,
+                                      const size_type  index)
       :
       vector (vector),
       index (index)
@@ -1233,9 +1243,9 @@ namespace TrilinosWrappers
 
   inline
   bool
-  VectorBase::in_local_range (const unsigned int index) const
+  VectorBase::in_local_range (const size_type index) const
   {
-    const std::pair<unsigned int, unsigned int> range = local_range();
+    std::pair<size_type, size_type> range = local_range();
 
     return ((index >= range.first) && (index <  range.second));
   }
@@ -1248,11 +1258,23 @@ namespace TrilinosWrappers
   {
     IndexSet is (size());
 
-    // TODO: Trilinos does allow non-contiguous ranges for locally
-    // owned elements. if that is the case for the current
-    // vector, local_range() will throw an exception. Fix this.
-    const std::pair<unsigned int, unsigned int> x = local_range();
-    is.add_range (x.first, x.second);
+    // easy case: local range is contiguous
+    if (vector->Map().LinearMap())
+      {
+        const std::pair<size_type, size_type> x = local_range();
+        is.add_range (x.first, x.second);
+      }
+    else if (vector->Map().NumMyElements() > 0)
+      {
+        const size_type n_indices = vector->Map().NumMyElements();
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+        unsigned int *vector_indices = (unsigned int *)vector->Map().MyGlobalElements();
+#else
+        size_type *vector_indices = (size_type *)vector->Map().MyGlobalElements64();
+#endif
+        is.add_indices(vector_indices, vector_indices+n_indices);
+        is.compress();
+      }
 
     return is;
   }
@@ -1270,7 +1292,7 @@ namespace TrilinosWrappers
 
   inline
   internal::VectorReference
-  VectorBase::operator () (const unsigned int index)
+  VectorBase::operator () (const size_type index)
   {
     return internal::VectorReference (*this, index);
   }
@@ -1279,7 +1301,7 @@ namespace TrilinosWrappers
 
   inline
   internal::VectorReference
-  VectorBase::operator [] (const unsigned int index)
+  VectorBase::operator [] (const size_type index)
   {
     return operator() (index);
   }
@@ -1287,7 +1309,7 @@ namespace TrilinosWrappers
 
   inline
   TrilinosScalar
-  VectorBase::operator [] (const unsigned int index) const
+  VectorBase::operator [] (const size_type index) const
   {
     return operator() (index);
   }
@@ -1445,7 +1467,7 @@ namespace TrilinosWrappers
 
   inline
   void
-  VectorBase::set (const std::vector<unsigned int>    &indices,
+  VectorBase::set (const std::vector<size_type>      &indices,
                    const std::vector<TrilinosScalar>  &values)
   {
     // if we have ghost values, do not allow
@@ -1462,7 +1484,7 @@ namespace TrilinosWrappers
 
   inline
   void
-  VectorBase::set (const std::vector<unsigned int>        &indices,
+  VectorBase::set (const std::vector<size_type>           &indices,
                    const ::dealii::Vector<TrilinosScalar> &values)
   {
     // if we have ghost values, do not allow
@@ -1479,8 +1501,8 @@ namespace TrilinosWrappers
 
   inline
   void
-  VectorBase::set (const unsigned int    n_elements,
-                   const unsigned int   *indices,
+  VectorBase::set (const size_type       n_elements,
+                   const size_type      *indices,
                    const TrilinosScalar *values)
   {
     // if we have ghost values, do not allow
@@ -1493,14 +1515,14 @@ namespace TrilinosWrappers
     if (last_action != Insert)
       last_action = Insert;
 
-    for (unsigned int i=0; i<n_elements; ++i)
+    for (size_type i=0; i<n_elements; ++i)
       {
-        const unsigned int row = indices[i];
-        const int local_row = vector->Map().LID(static_cast<int>(row));
+        const size_type row = indices[i];
+        const TrilinosWrappers::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(row));
         if (local_row == -1)
           {
             const int ierr = vector->ReplaceGlobalValues (1,
-                                                          (const int *)(&row),
+                                                          (const TrilinosWrappers::types::int_type *)(&row),
                                                           &values[i]);
             AssertThrow (ierr == 0, ExcTrilinosError(ierr));
             compressed = false;
@@ -1514,7 +1536,7 @@ namespace TrilinosWrappers
 
   inline
   void
-  VectorBase::add (const std::vector<unsigned int>    &indices,
+  VectorBase::add (const std::vector<size_type>      &indices,
                    const std::vector<TrilinosScalar>  &values)
   {
     // if we have ghost values, do not allow
@@ -1530,7 +1552,7 @@ namespace TrilinosWrappers
 
   inline
   void
-  VectorBase::add (const std::vector<unsigned int>        &indices,
+  VectorBase::add (const std::vector<size_type>           &indices,
                    const ::dealii::Vector<TrilinosScalar> &values)
   {
     // if we have ghost values, do not allow
@@ -1546,8 +1568,8 @@ namespace TrilinosWrappers
 
   inline
   void
-  VectorBase::add (const unsigned int    n_elements,
-                   const unsigned int   *indices,
+  VectorBase::add (const size_type       n_elements,
+                   const size_type      *indices,
                    const TrilinosScalar *values)
   {
     // if we have ghost values, do not allow
@@ -1561,14 +1583,14 @@ namespace TrilinosWrappers
         last_action = Add;
       }
 
-    for (unsigned int i=0; i<n_elements; ++i)
+    for (size_type i=0; i<n_elements; ++i)
       {
-        const unsigned int row = indices[i];
-        const int local_row = vector->Map().LID(static_cast<int>(row));
+        const size_type row = indices[i];
+        const TrilinosWrappers::types::int_type local_row = vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(row));
         if (local_row == -1)
           {
             const int ierr = vector->SumIntoGlobalValues (1,
-                                                          (const int *)(&row),
+                                                          (const TrilinosWrappers::types::int_type *)(&row),
                                                           &values[i]);
             AssertThrow (ierr == 0, ExcTrilinosError(ierr));
             compressed = false;
@@ -1581,31 +1603,38 @@ namespace TrilinosWrappers
 
 
   inline
-  unsigned int
+  VectorBase::size_type
   VectorBase::size () const
   {
-    return (unsigned int) (vector->Map().MaxAllGID() + 1 -
-                           vector->Map().MinAllGID());
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    return (size_type) (vector->Map().MaxAllGID() + 1 - vector->Map().MinAllGID());
+#else
+    return (size_type) (vector->Map().MaxAllGID64() + 1 - vector->Map().MinAllGID64());
+#endif
   }
 
 
 
   inline
-  unsigned int
+  VectorBase::size_type
   VectorBase::local_size () const
   {
-    return (unsigned int) vector->Map().NumMyElements();
+    return (size_type) vector->Map().NumMyElements();
   }
 
 
 
   inline
-  std::pair<unsigned int, unsigned int>
+  std::pair<VectorBase::size_type, VectorBase::size_type>
   VectorBase::local_range () const
   {
-    int begin, end;
-    begin = vector->Map().MinMyGID();
-    end = vector->Map().MaxMyGID()+1;
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    const TrilinosWrappers::types::int_type begin = vector->Map().MinMyGID();
+    const TrilinosWrappers::types::int_type end = vector->Map().MaxMyGID()+1;
+#else
+    const TrilinosWrappers::types::int_type begin = vector->Map().MinMyGID64();
+    const TrilinosWrappers::types::int_type end = vector->Map().MaxMyGID64()+1;
+#endif
 
     Assert (end-begin == vector->Map().NumMyElements(),
             ExcMessage ("This function only makes sense if the elements that this "
@@ -1711,11 +1740,11 @@ namespace TrilinosWrappers
 
     TrilinosScalar norm = 0;
     TrilinosScalar sum=0;
-    const unsigned int n_local = local_size();
+    const size_type n_local = local_size();
 
     // loop over all the elements because
     // Trilinos does not support lp norms
-    for (unsigned int i=0; i<n_local; i++)
+    for (size_type i=0; i<n_local; i++)
       sum += std::pow(std::fabs((*vector)[0][i]), p);
 
     norm = std::pow(sum, static_cast<TrilinosScalar>(1./p));
@@ -1823,8 +1852,8 @@ namespace TrilinosWrappers
     Assert (!has_ghost_elements(), ExcGhostsPresent());
     Assert (numbers::is_finite(s), ExcNumberNotFinite());
 
-    unsigned int n_local = local_size();
-    for (unsigned int i=0; i<n_local; i++)
+    size_type n_local = local_size();
+    for (size_type i=0; i<n_local; i++)
       (*vector)[0][i] += s;
   }
 
index 6c7fe3e9ced2288f81db3ba729e7fbd44b88ec1d..6866873d44641e46d87147218df312a7a3a71814 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__vector_h
 #define __deal2__vector_h
 
@@ -118,7 +123,7 @@ public:
   typedef const value_type                                 *const_iterator;
   typedef value_type                                       &reference;
   typedef const value_type                                 &const_reference;
-  typedef std::size_t                                       size_type;
+  typedef types::global_dof_index                           size_type;
 
   /**
    * Declare a type that has holds
@@ -286,7 +291,7 @@ public:
    * i.e. the vector is replaced by
    * one of length zero.
    */
-  explicit Vector (const unsigned int n);
+  explicit Vector (const size_type n);
 
   /**
    * Initialize the vector with a
@@ -313,7 +318,7 @@ public:
    * @p PETScWrappers::Vector class.
    *
    * For the PETSc vector wrapper class,
-   * thios function compresses the
+   * this function compresses the
    * underlying representation of the PETSc
    * object, i.e. flushes the buffers of
    * the vector object if it has any. This
@@ -354,8 +359,8 @@ public:
    * classes to handle memory
    * separately.
    */
-  virtual void reinit (const unsigned int N,
-                       const bool         fast=false);
+  virtual void reinit (const size_type N,
+                       const bool      fast=false);
 
   /**
    * Change the dimension to that of the
@@ -599,7 +604,7 @@ public:
    * Since this is not a distributed
    * vector the method always returns true.
    */
-  bool in_local_range (const types::global_dof_index global_index) const;
+  bool in_local_range (const size_type global_index) const;
 
   /**
    * Return an index set that describes which elements of this vector
@@ -624,7 +629,7 @@ public:
   /**
    * Return dimension of the vector.
    */
-  unsigned int size () const;
+  std::size_t size () const;
 
   /**
    * Return whether the vector contains only
@@ -689,13 +694,13 @@ public:
    * Access the value of the @p ith
    * component.
    */
-  Number operator() (const unsigned int i) const;
+  Number operator() (const size_type i) const;
 
   /**
    * Access the @p ith component
    * as a writeable reference.
    */
-  Number &operator() (const unsigned int i);
+  Number &operator() (const size_type i);
 
   /**
    * Access the value of the @p ith
@@ -703,7 +708,7 @@ public:
    *
    * Exactly the same as operator().
    */
-  Number operator[] (const unsigned int i) const;
+  Number operator[] (const size_type i) const;
 
   /**
    * Access the @p ith component
@@ -711,7 +716,7 @@ public:
    *
    * Exactly the same as operator().
    */
-  Number &operator[] (const unsigned int i);
+  Number &operator[] (const size_type i);
   //@}
 
 
@@ -741,7 +746,7 @@ public:
    * indices.
    */
   template <typename OtherNumber>
-  void add (const std::vector<unsigned int> &indices,
+  void add (const std::vector<size_type>   &indices,
             const std::vector<OtherNumber>  &values);
 
   /**
@@ -752,8 +757,8 @@ public:
    * values.
    */
   template <typename OtherNumber>
-  void add (const std::vector<unsigned int> &indices,
-            const Vector<OtherNumber>       &values);
+  void add (const std::vector<size_type> &indices,
+            const Vector<OtherNumber>    &values);
 
   /**
    * Take an address where
@@ -765,8 +770,8 @@ public:
    * functions above.
    */
   template <typename OtherNumber>
-  void add (const unsigned int  n_elements,
-            const unsigned int *indices,
+  void add (const size_type    n_elements,
+            const size_type   *indices,
             const OtherNumber  *values);
 
   /**
@@ -1059,7 +1064,7 @@ protected:
    * vector.  Get this number by
    * calling <tt>size()</tt>.
    */
-  unsigned int vec_size;
+  size_type vec_size;
 
   /**
    * Amount of memory actually
@@ -1073,7 +1078,7 @@ protected:
    * memory when the number of
    * needed elements is reduced.
    */
-  unsigned int max_vec_size;
+  size_type max_vec_size;
 
   /**
    * Pointer to the array of
@@ -1137,7 +1142,7 @@ Vector<Number>::Vector (const InputIterator first, const InputIterator last)
 
 template <typename Number>
 inline
-Vector<Number>::Vector (const unsigned int n)
+Vector<Number>::Vector (const size_type n)
   :
   vec_size(0),
   max_vec_size(0),
@@ -1163,7 +1168,7 @@ Vector<Number>::~Vector ()
 
 template <typename Number>
 inline
-void Vector<Number>::reinit (const unsigned int n, const bool fast)
+void Vector<Number>::reinit (const size_type n, const bool fast)
 {
   if (n==0)
     {
@@ -1225,7 +1230,7 @@ Vector<Number>::operator = (const Vector<Number2> &v)
 
 template <typename Number>
 inline
-unsigned int Vector<Number>::size () const
+std::size_t Vector<Number>::size () const
 {
   return vec_size;
 }
@@ -1234,7 +1239,7 @@ unsigned int Vector<Number>::size () const
 template <typename Number>
 inline
 bool Vector<Number>::in_local_range
-(const types::global_dof_index) const
+(const size_type) const
 {
   return true;
 }
@@ -1283,7 +1288,7 @@ Vector<Number>::end () const
 
 template <typename Number>
 inline
-Number Vector<Number>::operator() (const unsigned int i) const
+Number Vector<Number>::operator() (const size_type i) const
 {
   Assert (i<vec_size, ExcIndexRange(i,0,vec_size));
   return val[i];
@@ -1293,9 +1298,9 @@ Number Vector<Number>::operator() (const unsigned int i) const
 
 template <typename Number>
 inline
-Number &Vector<Number>::operator() (const unsigned int i)
+Number &Vector<Number>::operator() (const size_type i)
 {
-  Assert (i<vec_size, ExcIndexRange(i,0,vec_size));
+  Assert (i<vec_size, ExcIndexRangeType<size_type>(i,0,vec_size));
   return val[i];
 }
 
@@ -1303,7 +1308,7 @@ Number &Vector<Number>::operator() (const unsigned int i)
 
 template <typename Number>
 inline
-Number Vector<Number>::operator[] (const unsigned int i) const
+Number Vector<Number>::operator[] (const size_type i) const
 {
   return operator()(i);
 }
@@ -1312,7 +1317,7 @@ Number Vector<Number>::operator[] (const unsigned int i) const
 
 template <typename Number>
 inline
-Number &Vector<Number>::operator[] (const unsigned int i)
+Number &Vector<Number>::operator[] (const size_type i)
 {
   return operator()(i);
 }
@@ -1337,7 +1342,7 @@ template <typename Number>
 template <typename OtherNumber>
 inline
 void
-Vector<Number>::add (const std::vector<unsigned int> &indices,
+Vector<Number>::add (const std::vector<size_type> &indices,
                      const std::vector<OtherNumber>  &values)
 {
   Assert (indices.size() == values.size(),
@@ -1351,8 +1356,8 @@ template <typename Number>
 template <typename OtherNumber>
 inline
 void
-Vector<Number>::add (const std::vector<unsigned int> &indices,
-                     const Vector<OtherNumber>       &values)
+Vector<Number>::add (const std::vector<size_type> &indices,
+                     const Vector<OtherNumber>    &values)
 {
   Assert (indices.size() == values.size(),
           ExcDimensionMismatch(indices.size(), values.size()));
@@ -1365,11 +1370,11 @@ template <typename Number>
 template <typename OtherNumber>
 inline
 void
-Vector<Number>::add (const unsigned int  n_indices,
-                     const unsigned int *indices,
+Vector<Number>::add (const size_type  n_indices,
+                     const size_type *indices,
                      const OtherNumber  *values)
 {
-  for (unsigned int i=0; i<n_indices; ++i)
+  for (size_type i=0; i<n_indices; ++i)
     {
       Assert (indices[i] < vec_size, ExcIndexRange(indices[i],0,vec_size));
       Assert (numbers::is_finite(values[i]),
index 5cb3ba459aed03a972071a0a252bebf18e168248..8aa37a63963842a9324500e8dec50334bafaff80 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__vector_templates_h
 #define __deal2__vector_templates_h
 
@@ -295,7 +300,7 @@ Vector<Number>::all_zero () const
 {
   Assert (vec_size!=0, ExcEmptyObject());
 
-  for (unsigned int i=0; i<vec_size; ++i)
+  for (size_type i=0; i<vec_size; ++i)
     if (val[i] != Number(0))
       return false;
   return true;
@@ -309,7 +314,7 @@ Vector<Number>::is_non_negative () const
 {
   Assert (vec_size!=0, ExcEmptyObject());
 
-  for (unsigned int i=0; i<vec_size; ++i)
+  for (size_type i=0; i<vec_size; ++i)
     if ( ! internal::is_non_negative (val[i]))
       return false;
 
@@ -322,10 +327,12 @@ namespace internal
 {
   namespace Vector
   {
+    typedef types::global_dof_index size_type;
+
     template<typename T>
     void set_subrange (const T            s,
-                       const unsigned int begin,
-                       const unsigned int end,
+                       const size_type begin,
+                       const size_type end,
                        dealii::Vector<T> &dst)
     {
       if (s == T())
@@ -335,8 +342,8 @@ namespace internal
     }
 
     template<typename T>
-    void copy_subrange (const unsigned int       begin,
-                        const unsigned int       end,
+    void copy_subrange (const size_type         begin,
+                        const size_type         end,
                         const dealii::Vector<T> &src,
                         dealii::Vector<T>       &dst)
     {
@@ -345,8 +352,8 @@ namespace internal
     }
 
     template<typename T, typename U>
-    void copy_subrange (const unsigned int       begin,
-                        const unsigned int       end,
+    void copy_subrange (const size_type         begin,
+                        const size_type         end,
                         const dealii::Vector<T> &src,
                         dealii::Vector<U>       &dst)
     {
@@ -358,8 +365,8 @@ namespace internal
     }
 
     template<typename T, typename U>
-    void copy_subrange_wrap (const unsigned int       begin,
-                             const unsigned int       end,
+    void copy_subrange_wrap (const size_type         begin,
+                             const size_type         end,
                              const dealii::Vector<T> &src,
                              dealii::Vector<U>       &dst)
     {
@@ -373,8 +380,8 @@ namespace internal
       if (PointerComparison::equal(&src, &dst))
         return;
 
-      const unsigned int vec_size = src.size();
-      const unsigned int dst_size = dst.size();
+      const size_type vec_size = src.size();
+      const size_type dst_size = dst.size();
       if (dst_size != vec_size)
         dst.reinit (vec_size, true);
       if (vec_size>internal::Vector::minimum_parallel_grain_size)
@@ -576,7 +583,7 @@ namespace internal
                      const Number      *X,
                      const Number2     *Y,
                      const ResultType   power,
-                     const unsigned int vec_size,
+                     const size_type    vec_size,
                      ResultType        &result)
     {
       if (vec_size <= 4096)
@@ -586,24 +593,24 @@ namespace internal
           // order to obtain known loop bounds for most of the work.
           const Number *X_original = X;
           ResultType outer_results [128];
-          unsigned int n_chunks = vec_size / 32;
-          const unsigned int remainder = vec_size % 32;
+          size_type n_chunks = vec_size / 32;
+          const size_type remainder = vec_size % 32;
           Assert (remainder == 0 || n_chunks < 128, ExcInternalError());
 
-          for (unsigned int i=0; i<n_chunks; ++i)
+          for (size_type i=0; i<n_chunks; ++i)
             {
               ResultType r0 = op(X, Y, power);
-              for (unsigned int j=1; j<8; ++j)
+              for (size_type j=1; j<8; ++j)
                 r0 += op(X, Y, power);
               ResultType r1 = op(X, Y, power);
-              for (unsigned int j=1; j<8; ++j)
+              for (size_type j=1; j<8; ++j)
                 r1 += op(X, Y, power);
               r0 += r1;
               r1 = op(X, Y, power);
-              for (unsigned int j=1; j<8; ++j)
+              for (size_type j=1; j<8; ++j)
                 r1 += op(X, Y, power);
               ResultType r2 = op(X, Y, power);
-              for (unsigned int j=1; j<8; ++j)
+              for (size_type j=1; j<8; ++j)
                 r2 += op(X, Y, power);
               r1 += r2;
               r0 += r1;
@@ -615,31 +622,31 @@ namespace internal
           // fall-through to work on these values.
           if (remainder > 0)
             {
-              const unsigned int inner_chunks = remainder / 8;
+              const size_type inner_chunks = remainder / 8;
               Assert (inner_chunks <= 3, ExcInternalError());
-              const unsigned int remainder_inner = remainder % 8;
+              const size_type remainder_inner = remainder % 8;
               ResultType r0 = ResultType(), r1 = ResultType(),
                          r2 = ResultType();
               switch (inner_chunks)
                 {
                 case 3:
                   r2 = op(X, Y, power);
-                  for (unsigned int j=1; j<8; ++j)
+                  for (size_type j=1; j<8; ++j)
                     r2 += op(X, Y, power);
                   // no break
                 case 2:
                   r1 = op(X, Y, power);
-                  for (unsigned int j=1; j<8; ++j)
+                  for (size_type j=1; j<8; ++j)
                     r1 += op(X, Y, power);
                   r1 += r2;
                   // no break
                 case 1:
                   r2 = op(X, Y, power);
-                  for (unsigned int j=1; j<8; ++j)
+                  for (size_type j=1; j<8; ++j)
                     r2 += op(X, Y, power);
                   // no break
                 default:
-                  for (unsigned int j=0; j<remainder_inner; ++j)
+                  for (size_type j=0; j<remainder_inner; ++j)
                     r0 += op(X, Y, power);
                   r0 += r2;
                   r0 += r1;
@@ -648,7 +655,7 @@ namespace internal
                 }
               n_chunks++;
             }
-          AssertDimension(static_cast<unsigned int>(X - X_original), vec_size);
+          AssertDimension(static_cast<size_type> (X - X_original), vec_size);
 
           // now sum the results from the chunks
           // recursively
@@ -656,7 +663,7 @@ namespace internal
             {
               if (n_chunks % 2 == 1)
                 outer_results[n_chunks++] = ResultType();
-              for (unsigned int i=0; i<n_chunks; i+=2)
+              for (size_type i=0; i<n_chunks; i+=2)
                 outer_results[i/2] = outer_results[i] + outer_results[i+1];
               n_chunks /= 2;
             }
@@ -668,7 +675,7 @@ namespace internal
           // split the vector into smaller pieces to be
           // worked on recursively and create tasks for
           // them. Make pieces divisible by 1024.
-          const unsigned int new_size = (vec_size / 4096) * 1024;
+          const size_type new_size = (vec_size / 4096) * 1024;
           ResultType r0, r1, r2, r3;
           Threads::TaskGroup<> task_group;
           task_group += Threads::new_task(&accumulate<Operation,Number,Number2,
@@ -697,7 +704,7 @@ namespace internal
           // split vector into four pieces and work on
           // the pieces recursively. Make pieces (except last)
           // divisible by 1024.
-          const unsigned int new_size = (vec_size / 4096) * 1024;
+          const size_type new_size = (vec_size / 4096) * 1024;
           ResultType r0, r1, r2, r3;
           accumulate (op, X, Y, power, new_size, r0);
           accumulate (op, X+new_size, Y+new_size, power, new_size, r1);
@@ -800,7 +807,7 @@ Vector<Number>::l2_norm () const
     {
       real_type scale = 0.;
       real_type sum = 1.;
-      for (unsigned int i=0; i<vec_size; ++i)
+      for (size_type i=0; i<vec_size; ++i)
         {
           if (val[i] != Number())
             {
@@ -843,7 +850,7 @@ Vector<Number>::lp_norm (const real_type p) const
     {
       real_type scale = 0.;
       real_type sum = 1.;
-      for (unsigned int i=0; i<vec_size; ++i)
+      for (size_type i=0; i<vec_size; ++i)
         {
           if (val[i] != Number())
             {
@@ -872,7 +879,7 @@ Vector<Number>::linfty_norm () const
 
   real_type max = 0.;
 
-  for (unsigned int i=0; i<vec_size; ++i)
+  for (size_type i=0; i<vec_size; ++i)
     max = std::max (numbers::NumberTraits<Number>::abs(val[i]), max);
 
   return max;
@@ -903,7 +910,7 @@ Vector<Number> &Vector<Number>::operator -= (const Vector<Number> &v)
                          (boost::lambda::_1 - boost::lambda::_2),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] -= v.val[i];
 
   return *this;
@@ -922,7 +929,7 @@ void Vector<Number>::add (const Number v)
                          (boost::lambda::_1 + v),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] += v;
 }
 
@@ -941,7 +948,7 @@ void Vector<Number>::add (const Vector<Number> &v)
                          (boost::lambda::_1 + boost::lambda::_2),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] += v.val[i];
 }
 
@@ -966,7 +973,7 @@ void Vector<Number>::add (const Number a, const Vector<Number> &v,
                          (boost::lambda::_1 + a*boost::lambda::_2 + b*boost::lambda::_3),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] += a * v.val[i] + b * w.val[i];
 }
 
@@ -988,7 +995,7 @@ void Vector<Number>::sadd (const Number x,
                          (x*boost::lambda::_1 + boost::lambda::_2),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] = x * val[i] + v.val[i];
 }
 
@@ -1016,7 +1023,7 @@ void Vector<Number>::sadd (const Number x, const Number a,
                          (x*boost::lambda::_1 + a*boost::lambda::_2 + b*boost::lambda::_3),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] = x*val[i] + a * v.val[i] + b * w.val[i];
 }
 
@@ -1047,7 +1054,7 @@ void Vector<Number>::scale (const Vector<Number> &s)
                          (boost::lambda::_1*boost::lambda::_2),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] *= s.val[i];
 }
 
@@ -1060,7 +1067,7 @@ void Vector<Number>::scale (const Vector<Number2> &s)
   Assert (vec_size!=0, ExcEmptyObject());
   Assert (vec_size == s.vec_size, ExcDimensionMismatch(vec_size, s.vec_size));
 
-  for (unsigned int i=0; i<vec_size; ++i)
+  for (size_type i=0; i<vec_size; ++i)
     val[i] *= s.val[i];
 }
 
@@ -1082,7 +1089,7 @@ void Vector<Number>::equ (const Number a,
                          (a*boost::lambda::_1),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] = a * u.val[i];
 }
 
@@ -1104,7 +1111,7 @@ void Vector<Number>::equ (const Number a,
   // because
   // operator*(complex<float>,complex<double>)
   // is not defined by default
-  for (unsigned int i=0; i<vec_size; ++i)
+  for (size_type i=0; i<vec_size; ++i)
     val[i] = a * Number(u.val[i]);
 }
 
@@ -1129,7 +1136,7 @@ void Vector<Number>::equ (const Number a, const Vector<Number> &u,
                          (a*boost::lambda::_1 + b*boost::lambda::_2),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] = a * u.val[i] + b * v.val[i];
 }
 
@@ -1153,7 +1160,7 @@ void Vector<Number>::equ (const Number a, const Vector<Number> &u,
                          (a*boost::lambda::_1 + b*boost::lambda::_2 + c*boost::lambda::_3),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] = a * u.val[i] + b * v.val[i] + c * w.val[i];
 }
 
@@ -1178,7 +1185,7 @@ void Vector<Number>::ratio (const Vector<Number> &a,
                          (boost::lambda::_1 / boost::lambda::_2),
                          internal::Vector::minimum_parallel_grain_size);
   else if (vec_size > 0)
-    for (unsigned int i=0; i<vec_size; ++i)
+    for (size_type i=0; i<vec_size; ++i)
       val[i] = a.val[i]/b.val[i];
 }
 
@@ -1191,9 +1198,9 @@ Vector<Number>::operator = (const BlockVector<Number> &v)
   if (v.size() != vec_size)
     reinit (v.size(), true);
 
-  unsigned int this_index = 0;
-  for (unsigned int b=0; b<v.n_blocks(); ++b)
-    for (unsigned int i=0; i<v.block(b).size(); ++i, ++this_index)
+  size_type this_index = 0;
+  for (size_type b=0; b<v.n_blocks(); ++b)
+    for (size_type i=0; i<v.block(b).size(); ++i, ++this_index)
       val[this_index] = v.block(b)(i);
 
   return *this;
@@ -1299,7 +1306,7 @@ Vector<Number>::operator == (const Vector<Number2> &v) const
   // because
   // operator==(complex<float>,complex<double>)
   // is not defined by default
-  for (unsigned int i=0; i<vec_size; ++i)
+  for (size_type i=0; i<vec_size; ++i)
     if (val[i] != Number(v.val[i]))
       return false;
 
@@ -1313,7 +1320,7 @@ void Vector<Number>::print (const char *format) const
 {
   Assert (vec_size!=0, ExcEmptyObject());
 
-  for (unsigned int j=0; j<size(); ++j)
+  for (size_type j=0; j<size(); ++j)
     internal::print (val[j], format);
   std::printf ("\n");
 }
@@ -1339,10 +1346,10 @@ void Vector<Number>::print (std::ostream      &out,
     out.setf (std::ios::fixed, std::ios::floatfield);
 
   if (across)
-    for (unsigned int i=0; i<size(); ++i)
+    for (size_type i=0; i<size(); ++i)
       out << val[i] << ' ';
   else
-    for (unsigned int i=0; i<size(); ++i)
+    for (size_type i=0; i<size(); ++i)
       out << val[i] << std::endl;
   out << std::endl;
 
@@ -1361,10 +1368,10 @@ Vector<Number>::print (LogStream &out, const unsigned int width, const bool acro
   Assert (vec_size!=0, ExcEmptyObject());
 
   if (across)
-    for (unsigned int i=0; i<size(); ++i)
+    for (size_type i=0; i<size(); ++i)
       out << std::setw(width) << val[i] << ' ';
   else
-    for (unsigned int i=0; i<size(); ++i)
+    for (size_type i=0; i<size(); ++i)
       out << val[i] << std::endl;
   out << std::endl;
 }
@@ -1381,10 +1388,14 @@ void Vector<Number>::block_write (std::ostream &out) const
   // some resources that lead to
   // problems in a multithreaded
   // environment
-  const unsigned int sz = size();
+  const size_type sz = size();
   char buf[16];
 
-  std::sprintf(buf, "%d", sz);
+#ifdef DEAL_II_USE_LARGE_INDEX_TYPE
+  std::sprintf(buf, "%llu", sz);
+#else
+  std::sprintf(buf, "%u", sz);
+#endif
   std::strcat(buf, "\n[");
 
   out.write(buf, std::strlen(buf));
@@ -1406,7 +1417,7 @@ void Vector<Number>::block_read (std::istream &in)
 {
   AssertThrow (in, ExcIO());
 
-  unsigned int sz;
+  size_type sz;
 
   char buf[16];
 
index a5f35ac422eb423489940d96824b69c4d759de52..069ce99e8599e33f245cfd9bb24923ce2a2ab95f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__vector_memory_h
 #define __deal2__vector_memory_h
 
@@ -253,13 +258,18 @@ template<class VECTOR = dealii::Vector<double> >
 class GrowingVectorMemory : public VectorMemory<VECTOR>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor.  The argument
    * allows to preallocate a
    * certain number of vectors. The
    * default is not to do this.
    */
-  GrowingVectorMemory (const unsigned int initial_size = 0,
+  GrowingVectorMemory (const size_type initial_size = 0,
                        const bool log_statistics = false);
 
   /**
@@ -356,7 +366,7 @@ private:
      * nothing after first
      * initialization
      */
-    void initialize(const unsigned int size);
+    void initialize(const size_type size);
     /**
      * Pointer to the storage
      * object
@@ -376,13 +386,13 @@ private:
    * output at the end of an
    * object's lifetime.
    */
-  unsigned int total_alloc;
+  size_type total_alloc;
   /**
    * Number of vectors currently
    * allocated in this object; used
    * for detecting memory leaks.
    */
-  unsigned int current_alloc;
+  size_type current_alloc;
 
   /**
    * A flag controlling the logging
index 7c875227cdb831de15dcece123c6d5bab0b3d154..de704a2e44d8e10722cff7e63283cd9ec8b12aa5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __dealii__vector_view_h
 #define __dealii__vector_view_h
 
@@ -132,6 +137,12 @@ template<typename Number>
 class VectorView : public Vector<Number>
 {
 public:
+
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Read write constructor. Takes the size
    * of the vector, just like the standard
@@ -139,7 +150,7 @@ public:
    * from the location of the pointer @p
    * ptr.
    */
-  VectorView(const unsigned int new_size, Number *ptr);
+  VectorView(const size_type new_size, Number *ptr);
 
   /**
    * The constant constructor is the same
@@ -154,7 +165,7 @@ public:
    * construct it as a non const object or
    * attempt to write on it.
    */
-  VectorView(const unsigned int new_size, const Number *ptr);
+  VectorView(const size_type new_size, const Number *ptr);
 
   /**
    * This desctructor will only reset the
@@ -211,7 +222,7 @@ public:
    * view_of_long_vector(i), with i>0 might
    * cause an attempt to access invalid
    * areas of memory, or might function
-   * properly, depending on wether or not
+   * properly, depending on whether or not
    * the system was able to allocate some
    * memory consecutively after the
    * original allocation.
@@ -221,7 +232,7 @@ public:
    * call this reinit function if you
    * really know what you are doing.
    */
-  virtual void reinit (const unsigned int N,
+  virtual void reinit (const size_type N,
                        const bool         fast=false);
 
   /** This reinit function is
@@ -229,7 +240,7 @@ public:
       new object with the given
       size, starting from the
       pointer ptr. */
-  void reinit(const unsigned int N, Number *ptr);
+  void reinit(const size_type N, Number *ptr);
 
   /** This reinit function is
       equivalent to constructing a
@@ -238,7 +249,7 @@ public:
       pointer ptr. The same
       considerations made for the
       constructor apply here. */
-  void reinit(const unsigned int N, const Number *ptr);
+  void reinit(const size_type N, const Number *ptr);
 
   /**
    * This function is here to prevent
@@ -257,7 +268,7 @@ public:
 
 template<typename Number>
 inline
-VectorView<Number>::VectorView(const unsigned int new_size, Number *ptr)
+VectorView<Number>::VectorView(const size_type new_size, Number *ptr)
 {
   this->vec_size      = new_size;
   this->max_vec_size  = new_size;
@@ -268,7 +279,7 @@ VectorView<Number>::VectorView(const unsigned int new_size, Number *ptr)
 
 template<typename Number>
 inline
-VectorView<Number>::VectorView(const unsigned int new_size, const Number *ptr)
+VectorView<Number>::VectorView(const size_type new_size, const Number *ptr)
 {
   this->vec_size      = new_size;
   this->max_vec_size  = new_size;
@@ -291,7 +302,7 @@ VectorView<Number>::~VectorView()
 
 template<typename Number>
 inline
-void VectorView<Number>::reinit(const unsigned int N, const bool fast)
+void VectorView<Number>::reinit(const size_type N, const bool fast)
 {
   this->vec_size = N;
   this->max_vec_size = N;
@@ -302,7 +313,7 @@ void VectorView<Number>::reinit(const unsigned int N, const bool fast)
 
 template<typename Number>
 inline
-void VectorView<Number>::reinit(const unsigned int new_size, Number *ptr)
+void VectorView<Number>::reinit(const size_type new_size, Number *ptr)
 {
   this->vec_size      = new_size;
   this->max_vec_size  = new_size;
@@ -312,7 +323,7 @@ void VectorView<Number>::reinit(const unsigned int new_size, Number *ptr)
 
 template<typename Number>
 inline
-void VectorView<Number>::reinit(const unsigned int new_size, const Number *ptr)
+void VectorView<Number>::reinit(const size_type new_size, const Number *ptr)
 {
   this->vec_size      = new_size;
   this->max_vec_size  = new_size;
index b7a791dd2bc4b75e8fd2249d35f5f5f5c676571a..d6a4e2661228af7ff4646645252a4269a5d05fc6 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011-2012 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__matrix_free_dof_info_h
 #define __deal2__matrix_free_dof_info_h
@@ -22,6 +26,8 @@
 #include <deal.II/dofs/dof_handler.h>
 #include <deal.II/matrix_free/helper_functions.h>
 
+#include <deal.II/base/std_cxx1x/array.h>
+
 #include <memory>
 
 
@@ -66,6 +72,7 @@ namespace internal
        */
       void clear ();
 
+
       /**
        * Returns a pointer to the first index in the DoF row @p row.
        */
@@ -140,7 +147,7 @@ namespace internal
        * assigned the correct index after all the ghost indices have been
        * collected by the call to @p assign_ghosts.
        */
-      void read_dof_indices (const std::vector<unsigned int> &local_indices,
+      void read_dof_indices (const std::vector<types::global_dof_index> &local_indices,
                              const std::vector<unsigned int> &lexicographic_inv,
                              const ConstraintMatrix          &constraints,
                              const unsigned int               cell_number,
@@ -265,7 +272,7 @@ namespace internal
       /**
        * Renumbers the degrees of freedom to give good access for this class.
        */
-      void renumber_dofs (std::vector<unsigned int> &renumbering);
+      void renumber_dofs (std::vector<types::global_dof_index> &renumbering);
 
       /**
        * Returns the memory consumption in bytes of this class.
@@ -299,13 +306,19 @@ namespace internal
        * certain structure in the indices, like indices for vector-valued
        * problems or for cells where not all vector components are filled.
        */
-      std::vector<std_cxx1x::tuple<unsigned int,
-          unsigned int,
-          unsigned int> > row_starts;
+      std::vector<std_cxx1x::array<unsigned int, 3> > row_starts;
 
       /**
-       * Stores the indices of the degrees of freedom for each cell. This
-       * array also includes the indirect contributions from constraints,
+       * Stores the indices of the degrees of freedom for each cell. These
+       * indices are computed in MPI-local index space, i.e., each processor
+       * stores the locally owned indices as numbers between <tt>0</tt> and
+       * <tt>n_locally_owned_dofs-1</tt> and ghost indices in the range
+       * <tt>n_locally_owned_dofs</tt> to
+       * <tt>n_locally_owned_dofs+n_ghost_dofs</tt>. The translation between
+       * this MPI-local index space and the global numbering of degrees of
+       * freedom is stored in the @p vector_partitioner data structure.
+
+       * This array also includes the indirect contributions from constraints,
        * which are described by the @p constraint_indicator field. Because of
        * variable lengths of rows, this would be a vector of a
        * vector. However, we use one contiguous memory region and store the
@@ -340,7 +353,7 @@ namespace internal
 
       /**
        * Stores the rowstart indices of the compressed row storage in the @p
-       * dof_indices_plain fields.
+       * plain_dof_indices fields.
        */
       std::vector<unsigned int> row_starts_plain_indices;
 
@@ -405,7 +418,7 @@ namespace internal
        * calling @p assign_ghosts. Then, all information is collected by the
        * partitioner.
        */
-      std::vector<unsigned int> ghost_dofs;
+      std::vector<types::global_dof_index> ghost_dofs;
     };
 
 
@@ -418,7 +431,7 @@ namespace internal
     DoFInfo::begin_indices (const unsigned int row) const
     {
       AssertIndexRange (row, row_starts.size()-1);
-      const unsigned int index = std_cxx1x::get<0>(row_starts[row]);
+      const unsigned int index = row_starts[row][0];
       AssertIndexRange(index, dof_indices.size()+1);
       return dof_indices.empty() ? 0 : &dof_indices[0] + index;
     }
@@ -430,7 +443,7 @@ namespace internal
     DoFInfo::end_indices (const unsigned int row) const
     {
       AssertIndexRange (row, row_starts.size()-1);
-      const unsigned int index = std_cxx1x::get<0>(row_starts[row+1]);
+      const unsigned int index = row_starts[row+1][0];
       AssertIndexRange(index, dof_indices.size()+1);
       return dof_indices.empty() ? 0 : &dof_indices[0] + index;
     }
@@ -442,8 +455,7 @@ namespace internal
     DoFInfo::row_length_indices (const unsigned int row) const
     {
       AssertIndexRange (row, row_starts.size()-1);
-      return (std_cxx1x::get<0>(row_starts[row+1]) -
-              std_cxx1x::get<0>(row_starts[row]));
+      return (row_starts[row+1][0] - row_starts[row][0]);
     }
 
 
@@ -453,7 +465,7 @@ namespace internal
     DoFInfo::begin_indicators (const unsigned int row) const
     {
       AssertIndexRange (row, row_starts.size()-1);
-      const unsigned int index = std_cxx1x::get<1>(row_starts[row]);
+      const unsigned int index = row_starts[row][1];
       AssertIndexRange (index, constraint_indicator.size()+1);
       return constraint_indicator.empty() ? 0 : &constraint_indicator[0] + index;
     }
@@ -465,7 +477,7 @@ namespace internal
     DoFInfo::end_indicators (const unsigned int row) const
     {
       AssertIndexRange (row, row_starts.size()-1);
-      const unsigned int index = std_cxx1x::get<1>(row_starts[row+1]);
+      const unsigned int index = row_starts[row+1][1];
       AssertIndexRange (index, constraint_indicator.size()+1);
       return constraint_indicator.empty() ? 0 : &constraint_indicator[0] + index;
     }
@@ -477,8 +489,7 @@ namespace internal
     DoFInfo::row_length_indicators (const unsigned int row) const
     {
       AssertIndexRange (row, row_starts.size()-1);
-      return (std_cxx1x::get<1>(row_starts[row+1]) -
-              std_cxx1x::get<1>(row_starts[row]));
+      return (row_starts[row+1][1] - row_starts[row][1]);
     }
 
 
@@ -490,7 +501,7 @@ namespace internal
       // if we have no constraints, should take the data from dof_indices
       if (row_length_indicators(row) == 0)
         {
-          Assert (row_starts_plain_indices[row] == numbers::invalid_unsigned_int,
+          Assert (row_starts_plain_indices[row]==numbers::invalid_unsigned_int,
                   ExcInternalError());
           return begin_indices(row);
         }
index 64623405d56d36f5231f3866a8d3658f5c33c070..16c53c268d5b8b3493aa8c1afbe5c0ce794c5ba8 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/multithread_info.h>
@@ -27,8 +31,8 @@ namespace internal
 
     struct ConstraintComparator
     {
-      bool operator()(const std::pair<unsigned int,double> &p1,
-                      const std::pair<unsigned int,double> &p2) const
+      bool operator()(const std::pair<types::global_dof_index,double> &p1,
+                      const std::pair<types::global_dof_index,double> &p2) const
       {
         return p1.second < p2.second;
       }
@@ -51,12 +55,13 @@ namespace internal
        * access later on.
        */
       unsigned short
-      insert_entries (const std::vector<std::pair<unsigned int,double> > &entries);
+      insert_entries (const std::vector<std::pair<types::global_dof_index,double> > &entries);
+
+      std::vector<std::pair<types::global_dof_index, double> > constraint_entries;
+      std::vector<types::global_dof_index> constraint_indices;
 
-      std::vector<std::pair<unsigned int, double> > constraint_entries;
-      std::vector<unsigned int> constraint_indices;
-      std::pair<std::vector<Number>,unsigned int> next_constraint;
-      std::map<std::vector<Number>,unsigned int,FPArrayComparator<double> > constraints;
+      std::pair<std::vector<Number>, types::global_dof_index> next_constraint;
+      std::map<std::vector<Number>, types::global_dof_index, FPArrayComparator<double> > constraints;
     };
 
 
@@ -69,7 +74,7 @@ namespace internal
     template <typename Number>
     unsigned short
     ConstraintValues<Number>::
-    insert_entries (const std::vector<std::pair<unsigned int,double> > &entries)
+    insert_entries (const std::vector<std::pair<types::global_dof_index,double> > &entries)
     {
       next_constraint.first.resize(entries.size());
       if (entries.size() > 0)
@@ -78,7 +83,7 @@ namespace internal
           constraint_entries = entries;
           std::sort(constraint_entries.begin(), constraint_entries.end(),
                     ConstraintComparator());
-          for (unsigned int j=0; j<constraint_entries.size(); j++)
+          for (types::global_dof_index j=0; j<constraint_entries.size(); j++)
             {
               // copy the indices of the constraint entries after sorting.
               constraint_indices[j] = constraint_entries[j].first;
@@ -96,10 +101,11 @@ namespace internal
       // equal. this was quite lenghty and now we use a std::map with a
       // user-defined comparator to compare floating point arrays to a
       // tolerance 1e-13.
-      std::pair<typename std::map<std::vector<double>, unsigned int,
+      std::pair<typename std::map<std::vector<double>, types::global_dof_index,
           FPArrayComparator<double> >::iterator,
           bool> it = constraints.insert(next_constraint);
-      unsigned int insert_position = deal_II_numbers::invalid_unsigned_int;
+
+      types::global_dof_index insert_position = deal_II_numbers::invalid_dof_index;
       if (it.second == false)
         insert_position = it.first->second;
       else
@@ -167,7 +173,7 @@ namespace internal
 
 
     void
-    DoFInfo::read_dof_indices (const std::vector<unsigned int> &local_indices,
+    DoFInfo::read_dof_indices (const std::vector<types::global_dof_index> &local_indices,
                                const std::vector<unsigned int> &lexicographic_inv,
                                const ConstraintMatrix          &constraints,
                                const unsigned int               cell_number,
@@ -176,8 +182,11 @@ namespace internal
     {
       Assert (vector_partitioner.get() !=0, ExcInternalError());
       const unsigned int n_mpi_procs = vector_partitioner->n_mpi_processes();
-      const unsigned int first_owned = vector_partitioner->local_range().first;
-      const unsigned int last_owned  = vector_partitioner->local_range().second;
+      const types::global_dof_index first_owned = vector_partitioner->local_range().first;
+      const types::global_dof_index last_owned  = vector_partitioner->local_range().second;
+      Assert (last_owned-first_owned < std::numeric_limits<unsigned int>::max(),
+              ExcMessage("The size local range of owned indices must not "
+                         "exceed the size of unsigned int"));
       const unsigned int n_owned     = last_owned - first_owned;
       std::pair<unsigned short,unsigned short> constraint_iterator (0,0);
 
@@ -185,9 +194,9 @@ namespace internal
                                     dofs_per_cell[0] : dofs_per_cell[cell_active_fe_index[cell_number]];
       for (unsigned int i=0; i<dofs_this_cell; i++)
         {
-          unsigned int current_dof =
+          types::global_dof_index current_dof =
             local_indices[lexicographic_inv[i]];
-          const std::vector<std::pair<unsigned int,double> >
+          const std::vector<std::pair<types::global_dof_index,double> >
           *entries_ptr =
             constraints.get_constraint_entries(current_dof);
 
@@ -206,9 +215,9 @@ namespace internal
               // check whether this dof is identity constrained to another
               // dof. then we can simply insert that dof and there is no need
               // to actually resolve the constraint entries
-              const std::vector<std::pair<unsigned int,double> >
+              const std::vector<std::pair<types::global_dof_index,double> >
               &entries = *entries_ptr;
-              const unsigned int n_entries = entries.size();
+              const types::global_dof_index n_entries = entries.size();
               if (n_entries == 1 && std::fabs(entries[0].second-1.)<1e-14)
                 {
                   current_dof = entries[0].first;
@@ -228,7 +237,7 @@ namespace internal
               // space or mark it as ghost if necessary
               if (n_entries > 0)
                 {
-                  const std::vector<unsigned int> &constraint_indices =
+                  const std::vector<types::global_dof_index> &constraint_indices =
                     constraint_values.constraint_indices;
                   for (unsigned int j=0; j<n_entries; ++j)
                     {
@@ -236,8 +245,7 @@ namespace internal
                           (constraint_indices[j] < first_owned ||
                            constraint_indices[j] >= last_owned))
                         {
-                          dof_indices.push_back
-                          (n_owned + ghost_dofs.size());
+                          dof_indices.push_back (n_owned + ghost_dofs.size());
 
                           // collect ghosts so that we can later construct an
                           // IndexSet for them. also store whether the current
@@ -249,7 +257,8 @@ namespace internal
                         // not ghost, so transform to the local index space
                         // directly
                         dof_indices.push_back
-                        (constraint_indices[j] - first_owned);
+                        (static_cast<unsigned int>(constraint_indices[j] -
+                                                   first_owned));
                     }
                 }
             }
@@ -270,7 +279,7 @@ no_constraint:
               else
                 current_dof -= first_owned;
 
-              dof_indices.push_back (current_dof);
+              dof_indices.push_back (static_cast<unsigned int>(current_dof));
 
               // make sure constraint_iterator.first is always within the
               // bounds of unsigned short
@@ -280,9 +289,9 @@ no_constraint:
               constraint_iterator.first++;
             }
         }
-      row_starts[cell_number+1] = std_cxx1x::tuple<unsigned int,unsigned int,
-                                  unsigned int>
-                                  (dof_indices.size(), constraint_indicator.size(), 0);
+      row_starts[cell_number+1][0] = dof_indices.size();
+      row_starts[cell_number+1][1] = constraint_indicator.size();
+      row_starts[cell_number+1][2] = 0;
 
       // now to the plain indices: in case we have constraints on this cell,
       // store the indices without the constraints resolve once again
@@ -291,14 +300,13 @@ no_constraint:
           if (cell_number == 0)
             row_starts_plain_indices.resize (row_starts.size());
           row_starts_plain_indices[cell_number] = plain_dof_indices.size();
-          bool cell_has_constraints =
-            std_cxx1x::get<1>(row_starts[cell_number+1]) >
-            std_cxx1x::get<1>(row_starts[cell_number]);
+          bool cell_has_constraints = (row_starts[cell_number+1][1] >
+                                       row_starts[cell_number][1]);
           if (cell_has_constraints == true)
             {
               for (unsigned int i=0; i<dofs_this_cell; ++i)
                 {
-                  unsigned int current_dof =
+                  types::global_dof_index current_dof =
                     local_indices[lexicographic_inv[i]];
                   if (n_mpi_procs > 1 &&
                       (current_dof < first_owned ||
@@ -310,7 +318,8 @@ no_constraint:
                     }
                   else
                     current_dof -= first_owned;
-                  plain_dof_indices.push_back (current_dof);
+                  plain_dof_indices.push_back (static_cast<unsigned int>
+                                               (current_dof));
                 }
             }
         }
@@ -326,8 +335,8 @@ no_constraint:
       // sort ghost dofs and compress out duplicates
       const unsigned int n_owned  = (vector_partitioner->local_range().second-
                                      vector_partitioner->local_range().first);
-      const unsigned int n_ghosts = ghost_dofs.size();
-      unsigned int       n_unique_ghosts= 0;
+      const std::size_t n_ghosts = ghost_dofs.size();
+      unsigned int      n_unique_ghosts= 0;
 #ifdef DEBUG
       for (std::vector<unsigned int>::iterator dof = dof_indices.begin();
            dof!=dof_indices.end(); ++dof)
@@ -341,18 +350,19 @@ no_constraint:
           // since we need to go back to the local_to_global indices and
           // replace the temporary numbering of ghosts by the real number in
           // the index set, we need to store these values
-          std::vector<std::pair<unsigned int,unsigned int> > ghost_origin(n_ghosts);
-          for (unsigned int i=0; i<n_ghosts; ++i)
+          std::vector<std::pair<types::global_dof_index,unsigned int> > ghost_origin(n_ghosts);
+          for (std::size_t i=0; i<n_ghosts; ++i)
             {
               ghost_origin[i].first = ghost_dofs[i];
               ghost_origin[i].second = i;
             }
           std::sort (ghost_origin.begin(), ghost_origin.end());
-          unsigned int last_contiguous_start = ghost_origin[0].first;
+
+          types::global_dof_index last_contiguous_start = ghost_origin[0].first;
           ghost_numbering[ghost_origin[0].second] = 0;
-          for (unsigned int i=1; i<n_ghosts; i++)
+          for (std::size_t i=1; i<n_ghosts; i++)
             {
-              if (ghost_origin[i].first>ghost_origin[i-1].first+1)
+              if (ghost_origin[i].first > ghost_origin[i-1].first+1)
                 {
                   ghost_indices.add_range (last_contiguous_start,
                                            ghost_origin[i-1].first+1);
@@ -371,7 +381,7 @@ no_constraint:
           // dofs. the ghost index set should store the same number
           {
             AssertDimension (n_unique_ghosts, ghost_indices.n_elements());
-            for (unsigned int i=0; i<n_ghosts; ++i)
+            for (std::size_t i=0; i<n_ghosts; ++i)
               Assert (ghost_numbering[i] ==
                       ghost_indices.index_within_set(ghost_dofs[i]),
                       ExcInternalError());
@@ -384,9 +394,9 @@ no_constraint:
           const unsigned int n_boundary_cells = boundary_cells.size();
           for (unsigned int i=0; i<n_boundary_cells; ++i)
             {
-              unsigned int *data_ptr = const_cast<unsigned int *>
-                                       (begin_indices(boundary_cells[i]));
-              const unsigned int   *row_end = end_indices(boundary_cells[i]);
+              unsigned int *data_ptr = const_cast<unsigned int *> (begin_indices(boundary_cells[i]));
+
+              const unsigned int *row_end = end_indices(boundary_cells[i]);
               for ( ; data_ptr != row_end; ++data_ptr)
                 *data_ptr = ((*data_ptr < n_owned)
                              ?
@@ -400,10 +410,8 @@ no_constraint:
                 {
                   if (row_length_indicators(boundary_cells[i]) > 0)
                     {
-                      unsigned int *data_ptr = const_cast<unsigned int *>
-                                               (begin_indices_plain(boundary_cells[i]));
-                      const unsigned int *row_end =
-                        (end_indices_plain(boundary_cells[i]));
+                      unsigned int *data_ptr = const_cast<unsigned int *> (begin_indices_plain(boundary_cells[i]));
+                      const unsigned int *row_end = end_indices_plain(boundary_cells[i]);
                       for ( ; data_ptr != row_end; ++data_ptr)
                         *data_ptr = ((*data_ptr < n_owned)
                                      ?
@@ -416,8 +424,8 @@ no_constraint:
             }
         }
 
-      std::vector<unsigned int> new_ghosts;
-      ghost_dofs.swap(new_ghosts);
+      std::vector<types::global_dof_index> empty;
+      ghost_dofs.swap(empty);
 
       // set the ghost indices now. need to cast away constness here, but that
       // is uncritical since we reset the Partitioner in the same initialize
@@ -601,8 +609,7 @@ no_constraint:
           std::swap (new_active_fe_index, cell_active_fe_index);
         }
 
-      std::vector<std_cxx1x::tuple<unsigned int,unsigned int,
-          unsigned int> > new_row_starts;
+      std::vector<std_cxx1x::array<unsigned int, 3> > new_row_starts;
       std::vector<unsigned int> new_dof_indices;
       std::vector<std::pair<unsigned short,unsigned short> >
       new_constraint_indicator;
@@ -633,10 +640,9 @@ no_constraint:
           const unsigned int dofs_mcell =
             dofs_per_cell[cell_active_fe_index.size() == 0 ? 0 :
                           cell_active_fe_index[i]] * vectorization_length;
-          new_row_starts[i] =
-            std_cxx1x::tuple<unsigned int,unsigned int,unsigned int>
-            (new_dof_indices.size(), new_constraint_indicator.size(),
-             irregular_cells[i]);
+          new_row_starts[i][0] = new_dof_indices.size();
+          new_row_starts[i][1] = new_constraint_indicator.size();
+          new_row_starts[i][2] = irregular_cells[i];
 
           const unsigned int n_comp = (irregular_cells[i]>0 ?
                                        irregular_cells[i] : vectorization_length);
@@ -694,7 +700,7 @@ no_constraint:
                   }
                 else
                   {
-                    const unsigned int constraint_loc = constr_ind[j]->second;
+                    const unsigned short constraint_loc = constr_ind[j]->second;
                     new_constraint_indicator.push_back
                     (std::pair<unsigned short,unsigned short> (m_index, constraint_loc));
                     for (unsigned int k=constraint_pool_row_index[constraint_loc];
@@ -717,9 +723,9 @@ no_constraint:
         }
       AssertDimension (position_cell+1, row_starts.size());
 
-      new_row_starts[size_info.n_macro_cells] =
-        std_cxx1x::tuple<unsigned int,unsigned int,unsigned int>
-        (new_dof_indices.size(), new_constraint_indicator.size(), 0);
+      new_row_starts[size_info.n_macro_cells][0] = new_dof_indices.size();
+      new_row_starts[size_info.n_macro_cells][1] = new_constraint_indicator.size();
+      new_row_starts[size_info.n_macro_cells][2] = 0;
 
       AssertDimension(dof_indices.size(), new_dof_indices.size());
       AssertDimension(constraint_indicator.size(),
@@ -736,8 +742,8 @@ no_constraint:
       // locally owned plus the number of ghosts
       const unsigned int index_range = (vector_partitioner->local_range().second-
                                         vector_partitioner->local_range().first)
-                                       + vector_partitioner->ghost_indices().n_elements();
-      for (unsigned int i=0; i<dof_indices.size(); ++i)
+                                        + vector_partitioner->ghost_indices().n_elements();
+      for (std::size_t i=0; i<dof_indices.size(); ++i)
         AssertIndexRange (dof_indices[i], index_range);
 
       // sanity check 2: for the constraint indicators, the first index should
@@ -1638,7 +1644,7 @@ not_connect:
     namespace internal
     {
       // rudimentary version of a vector that keeps entries always ordered
-      class ordered_vector : public std::vector<unsigned int>
+      class ordered_vector : public std::vector<types::global_dof_index>
       {
       public:
         ordered_vector ()
@@ -1646,20 +1652,20 @@ not_connect:
           reserve (2000);
         }
 
-        void reserve (const unsigned int size)
+        void reserve (const std::size_t size)
         {
           if (size > 0)
-            this->std::vector<unsigned int>::reserve (size);
+            this->std::vector<types::global_dof_index>::reserve (size);
         }
 
 
         // insert a given entry. dat is a pointer within this vector (the user
         // needs to make sure that it really stays there)
         void insert (const unsigned int entry,
-                     std::vector<unsigned int>::iterator &dat)
+                     std::vector<types::global_dof_index>::iterator &dat)
         {
-          AssertIndexRange (static_cast<unsigned int>(dat - begin()), size()+1);
-          AssertIndexRange (static_cast<unsigned int>(end() - dat), size()+1);
+          AssertIndexRange (static_cast<std::size_t>(dat - begin()), size()+1);
+          AssertIndexRange (static_cast<std::size_t>(end() - dat), size()+1);
           AssertIndexRange (size(), capacity());
           while (dat != end() && *dat < entry)
             ++dat;
@@ -1671,7 +1677,7 @@ not_connect:
             }
           else if (*dat > entry)
             {
-              dat = this->std::vector<unsigned int>::insert (dat, entry);
+              dat = this->std::vector<types::global_dof_index>::insert (dat, entry);
               ++dat;
             }
           else
@@ -1691,9 +1697,10 @@ not_connect:
      CompressedSimpleSparsityPattern &connectivity) const
     {
       AssertDimension (row_starts.size()-1, size_info.n_active_cells);
-      const unsigned int n_rows = (vector_partitioner->local_range().second-
-                                   vector_partitioner->local_range().first)
-                                  + vector_partitioner->ghost_indices().n_elements();
+      const unsigned int n_rows =
+        (vector_partitioner->local_range().second-
+         vector_partitioner->local_range().first)
+        + vector_partitioner->ghost_indices().n_elements();
       const unsigned int n_blocks = (do_blocking == true) ?
                                     task_info.n_blocks : size_info.n_active_cells;
 
@@ -1824,7 +1831,7 @@ not_connect:
                             if (connectivity_dof.n_rows()==connectivity_dof.n_cols())
                               ++sp;
                             row_entries.reserve (row_entries.size() + end_cell - it);
-                            std::vector<unsigned int>::iterator insert_pos = row_entries.begin();
+                            std::vector<types::global_dof_index>::iterator insert_pos = row_entries.begin();
                             for ( ; sp != connectivity_dof.end(*it); ++sp)
                               if (sp->column() >= block)
                                 break;
@@ -1839,7 +1846,7 @@ not_connect:
           else
             {
               const unsigned int *it = begin_indices (block),
-                                  * end_cell = end_indices (block);
+                                 * end_cell = end_indices (block);
               for ( ; it != end_cell; ++it)
                 if (row_lengths[*it] > 0)
                   {
@@ -1848,7 +1855,7 @@ not_connect:
                     if (connectivity_dof.n_rows()==connectivity_dof.n_cols())
                       ++sp;
                     row_entries.reserve (row_entries.size() + end_cell - it);
-                    std::vector<unsigned int>::iterator insert_pos = row_entries.begin();
+                    std::vector<types::global_dof_index>::iterator insert_pos = row_entries.begin();
                     for ( ; sp != connectivity_dof.end(*it); ++sp)
                       if (sp->column() >= block)
                         break;
@@ -1863,45 +1870,50 @@ not_connect:
 
 
 
-    void DoFInfo::renumber_dofs (std::vector<unsigned int> &renumbering)
+    void DoFInfo::renumber_dofs (std::vector<types::global_dof_index> &renumbering)
     {
       // first renumber all locally owned degrees of freedom
       AssertDimension (vector_partitioner->local_size(),
                        vector_partitioner->size());
       const unsigned int local_size = vector_partitioner->local_size();
       renumbering.resize (0);
-      renumbering.resize (local_size, numbers::invalid_unsigned_int);
-      unsigned int counter = 0;
+      renumbering.resize (local_size, numbers::invalid_dof_index);
+
+      types::global_dof_index counter = 0;
       std::vector<unsigned int>::iterator dof_ind = dof_indices.begin(),
                                           end_ind = dof_indices.end();
       for ( ; dof_ind != end_ind; ++dof_ind)
         {
           if (*dof_ind < local_size)
             {
-              if (renumbering[*dof_ind] == numbers::invalid_unsigned_int)
+              if (renumbering[*dof_ind] == numbers::invalid_dof_index)
                 renumbering[*dof_ind] = counter++;
               *dof_ind = renumbering[*dof_ind];
             }
         }
 
       AssertIndexRange (counter, local_size+1);
-      for (unsigned int i=0; i<renumbering.size(); ++i)
-        if (renumbering[i] == numbers::invalid_unsigned_int)
+      for (std::size_t i=0; i<renumbering.size(); ++i)
+        if (renumbering[i] == numbers::invalid_dof_index)
           renumbering[i] = counter++;
 
       // adjust the constrained DoFs
       std::vector<unsigned int> new_constrained_dofs (constrained_dofs.size());
-      for (unsigned int i=0; i<constrained_dofs.size(); ++i)
+      for (std::size_t i=0; i<constrained_dofs.size(); ++i)
         new_constrained_dofs[i] = renumbering[constrained_dofs[i]];
 
       // the new constrained DoFs should be sorted already as they are not
       // contained in dof_indices and then get contiguous numbers
 #ifdef DEBUG
-      for (unsigned int i=1; i<new_constrained_dofs.size(); ++i)
+      for (std::size_t i=1; i<new_constrained_dofs.size(); ++i)
         Assert (new_constrained_dofs[i] > new_constrained_dofs[i-1], ExcInternalError());
 #endif
       std::swap (constrained_dofs, new_constrained_dofs);
 
+      // transform indices to global index space
+      for (std::size_t i=0; i<renumbering.size(); ++i)
+        renumbering[i] = vector_partitioner->local_to_global(renumbering[i]);
+
       AssertDimension (counter, renumbering.size());
     }
 
@@ -1911,8 +1923,7 @@ not_connect:
     DoFInfo::memory_consumption () const
     {
       std::size_t memory = sizeof(*this);
-      memory += (row_starts.capacity()*sizeof(std_cxx1x::tuple<unsigned int,
-                                              unsigned int, unsigned int>));
+      memory += (row_starts.capacity()*sizeof(std_cxx1x::array<unsigned int,3>));
       memory += MemoryConsumption::memory_consumption (dof_indices);
       memory += MemoryConsumption::memory_consumption (row_starts_plain_indices);
       memory += MemoryConsumption::memory_consumption (plain_dof_indices);
@@ -1930,8 +1941,7 @@ not_connect:
     {
       out << "       Memory row starts indices:    ";
       size_info.print_memory_statistics
-      (out, (row_starts.capacity()*sizeof(std_cxx1x::tuple<unsigned int,
-                                          unsigned int, unsigned int>)));
+      (out, (row_starts.capacity()*sizeof(std_cxx1x::array<unsigned int, 3>)));
       out << "       Memory dof indices:           ";
       size_info.print_memory_statistics
       (out, MemoryConsumption::memory_consumption (dof_indices));
@@ -1959,9 +1969,8 @@ not_connect:
       for (unsigned int row=0 ; row<n_rows ; ++row)
         {
           out << "Entries row " << row << ": ";
-          const unsigned int
-          *glob_indices = begin_indices(row),
-           *end_row = end_indices(row);
+          const unsigned int *glob_indices = begin_indices(row),
+            *end_row = end_indices(row);
           unsigned int index = 0;
           const std::pair<unsigned short,unsigned short>
           *con_it = begin_indicators(row),
index 187716af64e9a9e3fb2ab7bac8f7453071014419..0e46cdb59cc0d8502e4997b643075dd6cbd08d2f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__matrix_free_fe_evaluation_h
 #define __deal2__matrix_free_fe_evaluation_h
@@ -1770,7 +1774,7 @@ namespace internal
   {
     typedef typename VectorType::BlockType BaseVectorType;
 
-    static BaseVectorTypeget_vector_component (VectorType &vec,
+    static BaseVectorType *get_vector_component (VectorType &vec,
                                                  const unsigned int component)
     {
       AssertIndexRange (component, vec.n_blocks());
@@ -1783,7 +1787,7 @@ namespace internal
   {
     typedef VectorType BaseVectorType;
 
-    static BaseVectorTypeget_vector_component (VectorType &vec,
+    static BaseVectorType *get_vector_component (VectorType &vec,
                                                  const unsigned int)
     {
       return &vec;
@@ -1824,8 +1828,7 @@ FEEvaluationBase<dim,dofs_per_cell_,n_q_points_,n_components_,Number>
     dof_info.end_indicators(cell);
   unsigned int ind_local = 0;
 
-  const unsigned int n_irreg_components_filled =
-    std_cxx1x::get<2>(dof_info.row_starts[cell]);
+  const unsigned int n_irreg_components_filled = dof_info.row_starts[cell][2];
   const bool at_irregular_cell = n_irreg_components_filled > 0;
 
   // scalar case (or case when all components have the same degrees of freedom
@@ -2127,7 +2130,7 @@ FEEvaluationBase<dim,dofs_per_cell_,n_q_points_,n_components_,Number>
   // select between block vectors and non-block vectors. Note that the number
   // of components is checked in the internal data
   typename internal::BlockVectorSelector<VectorType,
-    IsBlockVector<VectorType>::value>::BaseVectorType *src_data[n_components];
+           IsBlockVector<VectorType>::value>::BaseVectorType *src_data[n_components];
   for (unsigned int d=0; d<n_components; ++d)
     src_data[d] = internal::BlockVectorSelector<VectorType, IsBlockVector<VectorType>::value>::get_vector_component(const_cast<VectorType &>(src), d);
 
@@ -2210,7 +2213,7 @@ FEEvaluationBase<dim,dofs_per_cell_,n_q_points_,n_components_,Number>
   // select between block vectors and non-block vectors. Note that the number
   // of components is checked in the internal data
   const typename internal::BlockVectorSelector<VectorType,
-    IsBlockVector<VectorType>::value>::BaseVectorType *src_data[n_components];
+        IsBlockVector<VectorType>::value>::BaseVectorType *src_data[n_components];
   for (unsigned int d=0; d<n_components; ++d)
     src_data[d] = internal::BlockVectorSelector<VectorType, IsBlockVector<VectorType>::value>::get_vector_component(const_cast<VectorType &>(src), d);
 
@@ -2277,7 +2280,7 @@ FEEvaluationBase<dim,dofs_per_cell_,n_q_points_,n_components_,Number>
   // select between block vectors and non-block vectors. Note that the number
   // of components is checked in the internal data
   typename internal::BlockVectorSelector<VectorType,
-    IsBlockVector<VectorType>::value>::BaseVectorType *dst_data[n_components];
+           IsBlockVector<VectorType>::value>::BaseVectorType *dst_data[n_components];
   for (unsigned int d=0; d<n_components; ++d)
     dst_data[d] = internal::BlockVectorSelector<VectorType, IsBlockVector<VectorType>::value>::get_vector_component(dst, d);
 
@@ -2355,7 +2358,7 @@ FEEvaluationBase<dim,dofs_per_cell_,n_q_points_,n_components_,Number>
   // select between block vectors and non-block vectors. Note that the number
   // of components is checked in the internal data
   typename internal::BlockVectorSelector<VectorType,
-    IsBlockVector<VectorType>::value>::BaseVectorType *dst_data[n_components];
+           IsBlockVector<VectorType>::value>::BaseVectorType *dst_data[n_components];
   for (unsigned int d=0; d<n_components; ++d)
     dst_data[d] = internal::BlockVectorSelector<VectorType, IsBlockVector<VectorType>::value>::get_vector_component(dst, d);
 
@@ -2441,8 +2444,7 @@ FEEvaluationBase<dim,dofs_per_cell_,n_q_points_,n_components_,Number>
   // points to the global indices stored in index_local_to_global
   const unsigned int *dof_indices = dof_info.begin_indices_plain(cell);
 
-  const unsigned int n_irreg_components_filled =
-    std_cxx1x::get<2>(dof_info.row_starts[cell]);
+  const unsigned int n_irreg_components_filled = dof_info.row_starts[cell][2];
   const bool at_irregular_cell = n_irreg_components_filled > 0;
 
   // scalar case (or case when all components have the same degrees of freedom
@@ -3878,12 +3880,12 @@ namespace internal
   inline
   void
   apply_tensor_product_values (const VectorizedArray<Number> *shape_values,
-                              const VectorizedArray<Number> in [],
-                              VectorizedArray<Number>       out [])
+                               const VectorizedArray<Number> in [],
+                               VectorizedArray<Number>       out [])
   {
     AssertIndexRange (direction, dim);
     const int mm     = dof_to_quad ? (fe_degree+1) : n_q_points_1d,
-      nn     = dof_to_quad ? n_q_points_1d : (fe_degree+1);
+              nn     = dof_to_quad ? n_q_points_1d : (fe_degree+1);
     const int n_cols = nn / 2;
     const int mid    = mm / 2;
 
@@ -3897,132 +3899,132 @@ namespace internal
           {
             for (int col=0; col<n_cols; ++col)
               {
-               VectorizedArray<Number> val0, val1, in0, in1, res0, res1;
-               if (dof_to_quad == true)
-                 {
-                   val0 = shape_values[col];
-                   val1 = shape_values[nn-1-col];
-                 }
-               else
-                 {
-                   val0 = shape_values[col*n_q_points_1d];
-                   val1 = shape_values[(col+1)*n_q_points_1d-1];
-                 }
-               if (mid > 0)
-                 {
-                   in0 = in[0];
-                   in1 = in[stride*(mm-1)];
-                   res0 = val0 * in0;
-                   res1 = val1 * in0;
-                   res0 += val1 * in1;
-                   res1 += val0 * in1;
-                   for (int ind=1; ind<mid; ++ind)
-                     {
-                       if (dof_to_quad == true)
-                         {
-                           val0 = shape_values[ind*n_q_points_1d+col];
-                           val1 = shape_values[ind*n_q_points_1d+nn-1-col];
-                         }
-                       else
-                         {
-                           val0 = shape_values[col*n_q_points_1d+ind];
-                           val1 = shape_values[(col+1)*n_q_points_1d-1-ind];
-                         }
-                       in0 = in[stride*ind];
-                       in1 = in[stride*(mm-1-ind)];
-                       res0 += val0 * in0;
-                       res1 += val1 * in0;
-                       res0 += val1 * in1;
-                       res1 += val0 * in1;
-                     }
-                 }
-               else
-                 res0 = res1 = VectorizedArray<Number>();
-               if (dof_to_quad == true)
-                 {
-                   if (mm % 2 == 1)
-                     {
-                       val0 = shape_values[mid*n_q_points_1d+col];
-                       val1 = val0 * in[stride*mid];
-                       res0 += val1;
-                       res1 += val1;
-                     }
-                 }
-               else
-                 {
-                   if (mm % 2 == 1 && nn % 2 == 0)
-                     {
-                       val0 = shape_values[col*n_q_points_1d+mid];
-                       val1 = val0 * in[stride*mid];
-                       res0 += val1;
-                       res1 += val1;
-                     }
-                 }
-               if (add == false)
-                 {
-                   out[stride*col]         = res0;
-                   out[stride*(nn-1-col)]  = res1;
-                 }
-               else
-                 {
-                   out[stride*col]        += res0;
-                   out[stride*(nn-1-col)] += res1;
-                 }
+                VectorizedArray<Number> val0, val1, in0, in1, res0, res1;
+                if (dof_to_quad == true)
+                  {
+                    val0 = shape_values[col];
+                    val1 = shape_values[nn-1-col];
+                  }
+                else
+                  {
+                    val0 = shape_values[col*n_q_points_1d];
+                    val1 = shape_values[(col+1)*n_q_points_1d-1];
+                  }
+                if (mid > 0)
+                  {
+                    in0 = in[0];
+                    in1 = in[stride*(mm-1)];
+                    res0 = val0 * in0;
+                    res1 = val1 * in0;
+                    res0 += val1 * in1;
+                    res1 += val0 * in1;
+                    for (int ind=1; ind<mid; ++ind)
+                      {
+                        if (dof_to_quad == true)
+                          {
+                            val0 = shape_values[ind*n_q_points_1d+col];
+                            val1 = shape_values[ind*n_q_points_1d+nn-1-col];
+                          }
+                        else
+                          {
+                            val0 = shape_values[col*n_q_points_1d+ind];
+                            val1 = shape_values[(col+1)*n_q_points_1d-1-ind];
+                          }
+                        in0 = in[stride*ind];
+                        in1 = in[stride*(mm-1-ind)];
+                        res0 += val0 * in0;
+                        res1 += val1 * in0;
+                        res0 += val1 * in1;
+                        res1 += val0 * in1;
+                      }
+                  }
+                else
+                  res0 = res1 = VectorizedArray<Number>();
+                if (dof_to_quad == true)
+                  {
+                    if (mm % 2 == 1)
+                      {
+                        val0 = shape_values[mid*n_q_points_1d+col];
+                        val1 = val0 * in[stride*mid];
+                        res0 += val1;
+                        res1 += val1;
+                      }
+                  }
+                else
+                  {
+                    if (mm % 2 == 1 && nn % 2 == 0)
+                      {
+                        val0 = shape_values[col*n_q_points_1d+mid];
+                        val1 = val0 * in[stride*mid];
+                        res0 += val1;
+                        res1 += val1;
+                      }
+                  }
+                if (add == false)
+                  {
+                    out[stride*col]         = res0;
+                    out[stride*(nn-1-col)]  = res1;
+                  }
+                else
+                  {
+                    out[stride*col]        += res0;
+                    out[stride*(nn-1-col)] += res1;
+                  }
               }
             if ( dof_to_quad == true && nn%2==1 && mm%2==1 )
               {
-               if (add==false)
-                 out[stride*n_cols]  = in[stride*mid];
-               else
-                 out[stride*n_cols] += in[stride*mid];
+                if (add==false)
+                  out[stride*n_cols]  = in[stride*mid];
+                else
+                  out[stride*n_cols] += in[stride*mid];
               }
             else if (dof_to_quad == true && nn%2==1)
               {
-               VectorizedArray<Number> res0;
-               VectorizedArray<Number> val0  = shape_values[n_cols];
-               if (mid > 0)
-                 {
-                   res0  = in[0] + in[stride*(mm-1)];
-                   res0 *= val0;
-                   for (int ind=1; ind<mid; ++ind)
-                     {
-                       val0  = shape_values[ind*n_q_points_1d+n_cols];
-                       VectorizedArray<Number> val1  = in[stride*ind] + in[stride*(mm-1-ind)];
-                       val1 *= val0;
-                       res0 += val1;
-                     }
-                 }
-               else
-                 res0 = VectorizedArray<Number>();
-               if (add == false)
-                 out[stride*n_cols]  = res0;
-               else
-                 out[stride*n_cols] += res0;
+                VectorizedArray<Number> res0;
+                VectorizedArray<Number> val0  = shape_values[n_cols];
+                if (mid > 0)
+                  {
+                    res0  = in[0] + in[stride*(mm-1)];
+                    res0 *= val0;
+                    for (int ind=1; ind<mid; ++ind)
+                      {
+                        val0  = shape_values[ind*n_q_points_1d+n_cols];
+                        VectorizedArray<Number> val1  = in[stride*ind] + in[stride*(mm-1-ind)];
+                        val1 *= val0;
+                        res0 += val1;
+                      }
+                  }
+                else
+                  res0 = VectorizedArray<Number>();
+                if (add == false)
+                  out[stride*n_cols]  = res0;
+                else
+                  out[stride*n_cols] += res0;
               }
             else if (dof_to_quad == false && nn%2 == 1)
               {
-               VectorizedArray<Number> res0;
-               if (mid > 0)
-                 {
-                   VectorizedArray<Number> val0 = shape_values[n_cols*n_q_points_1d];
-                   res0 = in[0] + in[stride*(mm-1)];
-                   res0 *= val0;
-                   for (int ind=1; ind<mid; ++ind)
-                     {
-                       val0  = shape_values[n_cols*n_q_points_1d+ind];
-                       VectorizedArray<Number> val1 = in[stride*ind] + in[stride*(mm-1-ind)];
-                       val1 *= val0;
-                       res0 += val1;
-                     }
-                   if (mm % 2)
-                     res0 += in[stride*mid];
-                 }
-               else
-                 res0 = in[0];
-               if (add == false)
-                 out[stride*n_cols]  = res0;
-               else
-                 out[stride*n_cols] += res0;
+                VectorizedArray<Number> res0;
+                if (mid > 0)
+                  {
+                    VectorizedArray<Number> val0 = shape_values[n_cols*n_q_points_1d];
+                    res0 = in[0] + in[stride*(mm-1)];
+                    res0 *= val0;
+                    for (int ind=1; ind<mid; ++ind)
+                      {
+                        val0  = shape_values[n_cols*n_q_points_1d+ind];
+                        VectorizedArray<Number> val1 = in[stride*ind] + in[stride*(mm-1-ind)];
+                        val1 *= val0;
+                        res0 += val1;
+                      }
+                    if (mm % 2)
+                      res0 += in[stride*mid];
+                  }
+                else
+                  res0 = in[0];
+                if (add == false)
+                  out[stride*n_cols]  = res0;
+                else
+                  out[stride*n_cols] += res0;
               }
 
             // increment: in regular case, just go to the next point in
@@ -4031,16 +4033,16 @@ namespace internal
             switch (direction)
               {
               case 0:
-               in += mm;
-               out += nn;
-               break;
+                in += mm;
+                out += nn;
+                break;
               case 1:
               case 2:
-               ++in;
-               ++out;
-               break;
+                ++in;
+                ++out;
+                break;
               default:
-               Assert (false, ExcNotImplemented());
+                Assert (false, ExcNotImplemented());
               }
           }
         if (direction == 1)
@@ -4081,12 +4083,12 @@ namespace internal
   inline
   void
   apply_tensor_product_gradients (const VectorizedArray<Number> *shape_gradients,
-                                 const VectorizedArray<Number> in [],
-                                 VectorizedArray<Number>       out [])
+                                  const VectorizedArray<Number> in [],
+                                  VectorizedArray<Number>       out [])
   {
     AssertIndexRange (direction, dim);
     const int mm     = dof_to_quad ? (fe_degree+1) : n_q_points_1d,
-      nn     = dof_to_quad ? n_q_points_1d : (fe_degree+1);
+              nn     = dof_to_quad ? n_q_points_1d : (fe_degree+1);
     const int n_cols = nn / 2;
     const int mid    = mm / 2;
 
@@ -4225,12 +4227,12 @@ namespace internal
   inline
   void
   apply_tensor_product_hessians (const VectorizedArray<Number> *shape_hessians,
-                                const VectorizedArray<Number> in [],
-                                VectorizedArray<Number>       out [])
+                                 const VectorizedArray<Number> in [],
+                                 VectorizedArray<Number>       out [])
   {
     AssertIndexRange (direction, dim);
     const int mm     = dof_to_quad ? (fe_degree+1) : n_q_points_1d,
-      nn     = dof_to_quad ? n_q_points_1d : (fe_degree+1);
+              nn     = dof_to_quad ? n_q_points_1d : (fe_degree+1);
     const int n_cols = nn / 2;
     const int mid    = mm / 2;
 
@@ -4399,8 +4401,8 @@ namespace internal
   inline
   void
   apply_tensor_product_gradients_gl (const VectorizedArray<Number> *shape_gradients,
-                                    const VectorizedArray<Number> in [],
-                                    VectorizedArray<Number>       out [])
+                                     const VectorizedArray<Number> in [],
+                                     VectorizedArray<Number>       out [])
   {
     AssertIndexRange (direction, dim);
     const int mm     = fe_degree+1;
index 630178b7b1120618ba221abba1f51ff8957dd14f..e5e0d6d75a832104f3eca25d243319f7199dffcc 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__matrix_free_helper_functions_h
 #define __deal2__matrix_free_helper_functions_h
index 4eb7cab71131dbd24b0831da794632196b9710ed..692cf4de579286a6c819c600e0630b06accb32fd 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011-2012 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__matrix_free_mapping_info_h
 #define __deal2__matrix_free_mapping_info_h
index 7c7a57292b8d780642123415662719a72862f4dd..f19e7be6c54a8247217059f1b34ff4f79fc58248 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011-2012 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/memory_consumption.h>
index 1cee5ba92b257fe788b6677c8d11a388956a7a80..c3fe2de0f111f080a7235db803e8084bf5a60cb2 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__matrix_free_h
 #define __deal2__matrix_free_h
@@ -554,18 +558,21 @@ public:
 
   /**
    * Returns a list of all degrees of freedom that are constrained. The list
-   * is returned in local index space for the locally owned range of the
-   * vector, not in global numbers. In addition, it only returns the indices
-   * for degrees of freedom that are owned locally, not for ghosts.
+   * is returned in MPI-local index space for the locally owned range of the
+   * vector, not in global MPI index space that spans all MPI processors. To
+   * get numbers in global index space, call
+   * <tt>get_vector_partitioner()->local_to_global</tt> on an entry of the
+   * vector. In addition, it only returns the indices for degrees of freedom
+   * that are owned locally, not for ghosts.
    */
   const std::vector<unsigned int> &
   get_constrained_dofs (const unsigned int fe_component = 0) const;
 
   /**
-   * Calls renumber_dofs function in dof info which renumbers the degrees
+   * Calls renumber_dofs function in dof_info which renumbers the degrees
    * of freedom according to the ordering for parallelization.
    */
-  void renumber_dofs (std::vector<unsigned int> &renumbering,
+  void renumber_dofs (std::vector<types::global_dof_index> &renumbering,
                       const unsigned int vector_component = 0);
 
   //@}
@@ -1159,7 +1166,7 @@ MatrixFree<dim,Number>::create_cell_subrange_hp_by_index
 template <int dim, typename Number>
 inline
 void
-MatrixFree<dim,Number>::renumber_dofs (std::vector<unsigned int> &renumbering,
+MatrixFree<dim,Number>::renumber_dofs (std::vector<types::global_dof_index> &renumbering,
                                        const unsigned int vector_component)
 {
   AssertIndexRange(vector_component, dof_info.size());
@@ -1203,8 +1210,7 @@ MatrixFree<dim,Number>::get_cell_iterator(const unsigned int macro_cell_number,
   AssertIndexRange (dof_index, dof_handlers.n_dof_handlers);
   AssertIndexRange (macro_cell_number, size_info.n_macro_cells);
   AssertIndexRange (vector_number, vectorization_length);
-  const unsigned int irreg_filled =
-    std_cxx1x::get<2>(dof_info[dof_index].row_starts[macro_cell_number]);
+  const unsigned int irreg_filled = dof_info[dof_index].row_starts[macro_cell_number][2];
   if (irreg_filled > 0)
     AssertIndexRange (vector_number, irreg_filled);
 #endif
@@ -1242,8 +1248,7 @@ MatrixFree<dim,Number>::get_hp_cell_iterator(const unsigned int macro_cell_numbe
   AssertIndexRange (dof_index, dof_handlers.n_dof_handlers);
   AssertIndexRange (macro_cell_number, size_info.n_macro_cells);
   AssertIndexRange (vector_number, vectorization_length);
-  const unsigned int irreg_filled =
-    std_cxx1x::get<2>(dof_info[dof_index].row_starts[macro_cell_number]);
+  const unsigned int irreg_filled = dof_info[dof_index].row_starts[macro_cell_number][2];
   if (irreg_filled > 0)
     AssertIndexRange (vector_number, irreg_filled);
 #endif
@@ -1265,7 +1270,7 @@ bool
 MatrixFree<dim,Number>::at_irregular_cell (const unsigned int macro_cell) const
 {
   AssertIndexRange (macro_cell, size_info.n_macro_cells);
-  return std_cxx1x::get<2>(dof_info[0].row_starts[macro_cell]) > 0;
+  return dof_info[0].row_starts[macro_cell][2] > 0;
 }
 
 
@@ -1276,8 +1281,7 @@ unsigned int
 MatrixFree<dim,Number>::n_components_filled (const unsigned int macro_cell) const
 {
   AssertIndexRange (macro_cell, size_info.n_macro_cells);
-  const unsigned int n_filled =
-    std_cxx1x::get<2>(dof_info[0].row_starts[macro_cell]);
+  const unsigned int n_filled = dof_info[0].row_starts[macro_cell][2];
   if (n_filled == 0)
     return VectorizedArray<Number>::n_array_elements;
   else
index 301920ad234d595d7c72929dd746cd0fef4bc32d..4e3d3c463a80a32d1a95cab03a29133186afd85a 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2012 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/memory_consumption.h>
@@ -174,7 +178,7 @@ internal_reinit(const Mapping<dim>                          &mapping,
           dof_info[i].n_components = dof_handler[i]->get_fe().element_multiplicity(0);
           dof_info[i].dofs_per_cell.push_back(dof_handler[i]->get_fe().dofs_per_cell);
           dof_info[i].row_starts.resize(size_info.n_macro_cells+1);
-          std_cxx1x::get<2>(dof_info[i].row_starts.back()) =
+          dof_info[i].row_starts.back()[2] =
             cell_level_index.size() % VectorizedArray<Number>::n_array_elements;
 
           // if indices are not initialized, the cell_level_index might not be
@@ -296,7 +300,7 @@ internal_reinit(const Mapping<dim>                            &mapping,
           dof_info[i].n_components = dof_handler[i]->get_fe()[0].element_multiplicity(0);
           dof_info[i].dofs_per_cell.push_back(dof_handler[i]->get_fe()[0].dofs_per_cell);
           dof_info[i].row_starts.resize(size_info.n_macro_cells+1);
-          std_cxx1x::get<2>(dof_info[i].row_starts.back()) =
+          dof_info[i].row_starts.back()[2] =
             cell_level_index.size() % VectorizedArray<Number>::n_array_elements;
 
           // if indices are not initialized, the cell_level_index might not be
@@ -459,14 +463,12 @@ void MatrixFree<dim,Number>::initialize_indices
 {
   const unsigned int n_fe = dof_handlers.n_dof_handlers;
   const unsigned int n_active_cells = cell_level_index.size();
-  const unsigned int n_mpi_procs = size_info.n_procs;
 
   AssertDimension (n_active_cells, cell_level_index.size());
   AssertDimension (n_fe, locally_owned_set.size());
   AssertDimension (n_fe, constraint.size());
 
-  std::vector<unsigned int> local_dof_indices;
-  std::vector<std::vector<unsigned int> > ghost_dofs(n_fe);
+  std::vector<types::global_dof_index> local_dof_indices;
   std::vector<std::vector<std::vector<unsigned int> > > lexicographic_inv(n_fe);
 
   internal::MatrixFreeFunctions::ConstraintValues<double> constraint_values;
@@ -526,7 +528,7 @@ void MatrixFree<dim,Number>::initialize_indices
             dynamic_cast<const FE_Poly<TensorProductPolynomials<dim>,dim,dim>*>
             (&fe.base_element(0));
           const FE_Poly<TensorProductPolynomials<dim,Polynomials::
-            PiecewisePolynomial<double> >,dim,dim> *fe_poly_piece =
+          PiecewisePolynomial<double> >,dim,dim> *fe_poly_piece =
             dynamic_cast<const FE_Poly<TensorProductPolynomials<dim,
             Polynomials::PiecewisePolynomial<double> >,dim,dim>*>
             (&fe.base_element(0));
@@ -577,23 +579,22 @@ void MatrixFree<dim,Number>::initialize_indices
 
       // initialize the arrays for indices
       dof_info[no].row_starts.resize (n_active_cells+1);
-      dof_info[no].row_starts[0] = std_cxx1x::tuple<unsigned int,unsigned int,
-                                   unsigned int> (0,0,0);
+      dof_info[no].row_starts[0][0] = 0;
+      dof_info[no].row_starts[0][1] = 0;
+      dof_info[no].row_starts[0][2] = 0;
       dof_info[no].dof_indices.reserve
       ((n_active_cells*dof_info[no].dofs_per_cell[0]*3)/2);
 
       // cache the constrained indices for use in matrix-vector products
       {
-        const unsigned int
+        const types::global_dof_index
         start_index = dof_info[no].vector_partitioner->local_range().first,
         end_index   = dof_info[no].vector_partitioner->local_range().second;
-        for (unsigned int i=start_index; i<end_index; ++i)
+        for (types::global_dof_index i=start_index; i<end_index; ++i)
           if (constraint[no]->is_constrained(i)==true)
-            dof_info[no].constrained_dofs.push_back(i-start_index);
+            dof_info[no].constrained_dofs.
+              push_back(static_cast<unsigned int>(i-start_index));
       }
-
-      if (n_mpi_procs > 1)
-        ghost_dofs[no].reserve (locally_owned_set[no].n_elements()/10+1);
     }
 
   // extract all the global indices associated with the computation, and form
@@ -749,7 +750,7 @@ void MatrixFree<dim,Number>::initialize_indices
   }
 
   // set constraint pool from the std::map and reorder the indices
-  typename std::map<std::vector<double>, unsigned int,
+  typename std::map<std::vector<double>, types::global_dof_index,
            internal::MatrixFreeFunctions::FPArrayComparator<double> >::iterator
            it = constraint_values.constraints.begin(),
            end = constraint_values.constraints.end();
index 654db99e4851ec62b46d16eb0f07e3ccf24a8af1..ea987f2d253a51926684baafb4640e51d7d3d295 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__matrix_free_shape_info_h
 #define __deal2__matrix_free_shape_info_h
index 77386ed65d608c927cbf831c53c6531609c13106..1f9147f828c242dc7ad932887fb7804d7470ea05 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011, 2013 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/memory_consumption.h>
@@ -61,13 +65,13 @@ namespace internal
         const FE_Poly<TensorProductPolynomials<dim>,dim,dim> *fe_poly =
           dynamic_cast<const FE_Poly<TensorProductPolynomials<dim>,dim,dim>*>(&fe);
         const FE_Poly<TensorProductPolynomials<dim,Polynomials::
-          PiecewisePolynomial<double> >,dim,dim> *fe_poly_piece =
+        PiecewisePolynomial<double> >,dim,dim> *fe_poly_piece =
           dynamic_cast<const FE_Poly<TensorProductPolynomials<dim,
           Polynomials::PiecewisePolynomial<double> >,dim,dim>*> (&fe);
         Assert (fe_poly != 0 || fe_poly_piece, ExcNotImplemented());
         lexicographic = fe_poly != 0 ?
-          fe_poly->get_poly_space_numbering_inverse() :
-          fe_poly_piece->get_poly_space_numbering_inverse();
+                        fe_poly->get_poly_space_numbering_inverse() :
+                        fe_poly_piece->get_poly_space_numbering_inverse();
 
         // to evaluate 1D polynomials, evaluate along the line where y=z=0,
         // assuming that shape_value(0,Point<dim>()) == 1. otherwise, need
index 76fef0934ebecb749c7e42bcb8df1f8e46e15531..6135a031f4fb65745327ddc17fd3886c85413abb 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_assembler_h
 #define __deal2__mesh_worker_assembler_h
@@ -154,7 +159,7 @@ namespace MeshWorker
        */
       void assemble(VECTOR &global,
                     const BlockVector<double> &local,
-                    const std::vector<unsigned int> &dof);
+                    const std::vector<types::global_dof_index> &dof);
 
       /**
        * The global matrices,
@@ -270,10 +275,10 @@ namespace MeshWorker
       void assemble(
         MatrixBlock<MATRIX> &global,
         const FullMatrix<number> &local,
-        unsigned int block_row,
-        unsigned int block_col,
-        const std::vector<unsigned int> &dof1,
-        const std::vector<unsigned int> &dof2);
+        const unsigned int block_row,
+        const unsigned int block_col,
+        const std::vector<types::global_dof_index> &dof1,
+        const std::vector<types::global_dof_index> &dof2);
 
       /**
        * The global matrices,
@@ -428,12 +433,12 @@ namespace MeshWorker
       void assemble(
         MATRIX &global,
         const FullMatrix<number> &local,
-        unsigned int block_row,
-        unsigned int block_col,
-        const std::vector<unsigned int> &dof1,
-        const std::vector<unsigned int> &dof2,
-        unsigned int level1,
-        unsigned int level2,
+        const unsigned int block_row,
+        const unsigned int block_col,
+        const std::vector<types::global_dof_index> &dof1,
+        const std::vector<types::global_dof_index> &dof2,
+        const unsigned int level1,
+        const unsigned int level2,
         bool transpose = false);
 
       /**
@@ -443,12 +448,12 @@ namespace MeshWorker
       void assemble_fluxes(
         MATRIX &global,
         const FullMatrix<number> &local,
-        unsigned int block_row,
-        unsigned int block_col,
-        const std::vector<unsigned int> &dof1,
-        const std::vector<unsigned int> &dof2,
-        unsigned int level1,
-        unsigned int level2);
+        const unsigned int block_row,
+        const unsigned int block_col,
+        const std::vector<types::global_dof_index> &dof1,
+        const std::vector<types::global_dof_index> &dof2,
+        const unsigned int level1,
+        const unsigned int level2);
 
       /**
        * Assemble a single local
@@ -457,12 +462,12 @@ namespace MeshWorker
       void assemble_up(
         MATRIX &global,
         const FullMatrix<number> &local,
-        unsigned int block_row,
-        unsigned int block_col,
-        const std::vector<unsigned int> &dof1,
-        const std::vector<unsigned int> &dof2,
-        unsigned int level1,
-        unsigned int level2);
+        const unsigned int block_row,
+        const unsigned int block_col,
+        const std::vector<types::global_dof_index> &dof1,
+        const std::vector<types::global_dof_index> &dof2,
+        const unsigned int level1,
+        const unsigned int level2);
 
       /**
        * Assemble a single local
@@ -471,12 +476,12 @@ namespace MeshWorker
       void assemble_down(
         MATRIX &global,
         const FullMatrix<number> &local,
-        unsigned int block_row,
-        unsigned int block_col,
-        const std::vector<unsigned int> &dof1,
-        const std::vector<unsigned int> &dof2,
-        unsigned int level1,
-        unsigned int level2);
+        const unsigned int block_row,
+        const unsigned int block_col,
+        const std::vector<types::global_dof_index> &dof1,
+        const std::vector<types::global_dof_index> &dof2,
+        const unsigned int level1,
+        const unsigned int level2);
 
       /**
        * Assemble a single local
@@ -485,12 +490,12 @@ namespace MeshWorker
       void assemble_in(
         MATRIX &global,
         const FullMatrix<number> &local,
-        unsigned int block_row,
-        unsigned int block_col,
-        const std::vector<unsigned int> &dof1,
-        const std::vector<unsigned int> &dof2,
-        unsigned int level1,
-        unsigned int level2);
+        const unsigned int block_row,
+        const unsigned int block_col,
+        const std::vector<types::global_dof_index> &dof1,
+        const std::vector<types::global_dof_index> &dof2,
+        const unsigned int level1,
+        const unsigned int level2);
 
       /**
        * Assemble a single local
@@ -499,12 +504,12 @@ namespace MeshWorker
       void assemble_out(
         MATRIX &global,
         const FullMatrix<number> &local,
-        unsigned int block_row,
-        unsigned int block_col,
-        const std::vector<unsigned int> &dof1,
-        const std::vector<unsigned int> &dof2,
-        unsigned int level1,
-        unsigned int level2);
+        const unsigned int block_row,
+        const unsigned int block_col,
+        const std::vector<types::global_dof_index> &dof1,
+        const std::vector<types::global_dof_index> &dof2,
+        const unsigned int level1,
+        const unsigned int level2);
 
       /**
        * The level matrices,
@@ -599,7 +604,7 @@ namespace MeshWorker
     ResidualLocalBlocksToGlobalBlocks<VECTOR>::assemble(
       VECTOR &global,
       const BlockVector<double> &local,
-      const std::vector<unsigned int> &dof)
+      const std::vector<types::global_dof_index> &dof)
     {
       if (constraints == 0)
         {
@@ -699,10 +704,10 @@ namespace MeshWorker
     MatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(
       MatrixBlock<MATRIX> &global,
       const FullMatrix<number> &local,
-      unsigned int block_row,
-      unsigned int block_col,
-      const std::vector<unsigned int> &dof1,
-      const std::vector<unsigned int> &dof2)
+      const unsigned int block_row,
+      const unsigned int block_col,
+      const std::vector<types::global_dof_index> &dof1,
+      const std::vector<types::global_dof_index> &dof2)
     {
       if (constraints == 0)
         {
@@ -727,11 +732,11 @@ namespace MeshWorker
       else
         {
           const BlockIndices &bi = this->block_info->local();
-          std::vector<unsigned int> sliced_row_indices (bi.block_size(block_row));
+          std::vector<types::global_dof_index> sliced_row_indices (bi.block_size(block_row));
           for (unsigned int i=0; i<sliced_row_indices.size(); ++i)
             sliced_row_indices[i] = dof1[bi.block_start(block_row)+i];
 
-          std::vector<unsigned int> sliced_col_indices (bi.block_size(block_col));
+          std::vector<types::global_dof_index> sliced_col_indices (bi.block_size(block_col));
           for (unsigned int i=0; i<sliced_col_indices.size(); ++i)
             sliced_col_indices[i] = dof2[bi.block_start(block_col)+i];
 
@@ -751,8 +756,8 @@ namespace MeshWorker
         {
           // Row and column index of
           // the block we are dealing with
-          const unsigned int row = matrices->block(i).row;
-          const unsigned int col = matrices->block(i).column;
+          const types::global_dof_index row = matrices->block(i).row;
+          const types::global_dof_index col = matrices->block(i).column;
 
           assemble(matrices->block(i), info.matrix(i,false).matrix, row, col, info.indices, info.indices);
         }
@@ -770,8 +775,8 @@ namespace MeshWorker
         {
           // Row and column index of
           // the block we are dealing with
-          const unsigned int row = matrices->block(i).row;
-          const unsigned int col = matrices->block(i).column;
+          const types::global_dof_index row = matrices->block(i).row;
+          const types::global_dof_index col = matrices->block(i).column;
 
           assemble(matrices->block(i), info1.matrix(i,false).matrix, row, col, info1.indices, info1.indices);
           assemble(matrices->block(i), info1.matrix(i,true).matrix, row, col, info1.indices, info2.indices);
@@ -852,12 +857,12 @@ namespace MeshWorker
     MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble(
       MATRIX &global,
       const FullMatrix<number> &local,
-      unsigned int block_row,
-      unsigned int block_col,
-      const std::vector<unsigned int> &dof1,
-      const std::vector<unsigned int> &dof2,
-      unsigned int level1,
-      unsigned int level2,
+      const unsigned int block_row,
+      const unsigned int block_col,
+      const std::vector<types::global_dof_index> &dof1,
+      const std::vector<types::global_dof_index> &dof2,
+      const unsigned int level1,
+      const unsigned int level2,
       bool transpose)
     {
       for (unsigned int j=0; j<local.n_rows(); ++j)
@@ -931,12 +936,12 @@ namespace MeshWorker
     MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_fluxes(
       MATRIX &global,
       const FullMatrix<number> &local,
-      unsigned int block_row,
-      unsigned int block_col,
-      const std::vector<unsigned int> &dof1,
-      const std::vector<unsigned int> &dof2,
-      unsigned int level1,
-      unsigned int level2)
+      const unsigned int block_row,
+      const unsigned int block_col,
+      const std::vector<types::global_dof_index> &dof1,
+      const std::vector<types::global_dof_index> &dof2,
+      const unsigned int level1,
+      const unsigned int level2)
     {
       for (unsigned int j=0; j<local.n_rows(); ++j)
         for (unsigned int k=0; k<local.n_cols(); ++k)
@@ -984,12 +989,12 @@ namespace MeshWorker
     MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_up(
       MATRIX &global,
       const FullMatrix<number> &local,
-      unsigned int block_row,
-      unsigned int block_col,
-      const std::vector<unsigned int> &dof1,
-      const std::vector<unsigned int> &dof2,
-      unsigned int level1,
-      unsigned int level2)
+      const unsigned int block_row,
+      const unsigned int block_col,
+      const std::vector<types::global_dof_index> &dof1,
+      const std::vector<types::global_dof_index> &dof2,
+      const unsigned int level1,
+      const unsigned int level2)
     {
       for (unsigned int j=0; j<local.n_rows(); ++j)
         for (unsigned int k=0; k<local.n_cols(); ++k)
@@ -1037,12 +1042,12 @@ namespace MeshWorker
     MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_down(
       MATRIX &global,
       const FullMatrix<number> &local,
-      unsigned int block_row,
-      unsigned int block_col,
-      const std::vector<unsigned int> &dof1,
-      const std::vector<unsigned int> &dof2,
-      unsigned int level1,
-      unsigned int level2)
+      const unsigned int block_row,
+      const unsigned int block_col,
+      const std::vector<types::global_dof_index> &dof1,
+      const std::vector<types::global_dof_index> &dof2,
+      const unsigned int level1,
+      const unsigned int level2)
     {
       for (unsigned int j=0; j<local.n_rows(); ++j)
         for (unsigned int k=0; k<local.n_cols(); ++k)
@@ -1090,12 +1095,12 @@ namespace MeshWorker
     MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_in(
       MATRIX &global,
       const FullMatrix<number> &local,
-      unsigned int block_row,
-      unsigned int block_col,
-      const std::vector<unsigned int> &dof1,
-      const std::vector<unsigned int> &dof2,
-      unsigned int level1,
-      unsigned int level2)
+      const unsigned int block_row,
+      const unsigned int block_col,
+      const std::vector<types::global_dof_index> &dof1,
+      const std::vector<types::global_dof_index> &dof2,
+      const unsigned int level1,
+      const unsigned int level2)
     {
 //      AssertDimension(local.n(), dof1.size());
 //      AssertDimension(local.m(), dof2.size());
@@ -1155,12 +1160,12 @@ namespace MeshWorker
     MGMatrixLocalBlocksToGlobalBlocks<MATRIX, number>::assemble_out(
       MATRIX &global,
       const FullMatrix<number> &local,
-      unsigned int block_row,
-      unsigned int block_col,
-      const std::vector<unsigned int> &dof1,
-      const std::vector<unsigned int> &dof2,
-      unsigned int level1,
-      unsigned int level2)
+      const unsigned int block_row,
+      const unsigned int block_col,
+      const std::vector<types::global_dof_index> &dof1,
+      const std::vector<types::global_dof_index> &dof2,
+      const unsigned int level1,
+      const unsigned int level2)
     {
 //      AssertDimension(local.n(), dof1.size());
 //      AssertDimension(local.m(), dof2.size());
index cc12fedd04c0151973f228763d68b995de2a0d4f..402f7822ea1751240586290ddb213f47c8de1c1d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_dof_info_h
 #define __deal2__mesh_worker_dof_info_h
@@ -97,13 +102,13 @@ namespace MeshWorker
      * The DoF indices of the
      * current cell
      */
-    std::vector<unsigned int> indices;
+    std::vector<types::global_dof_index> indices;
 
     /**
      * The DoF indices on the current cell, organized by local blocks.
      * The size of this vector is zero, unless local blocks are used.
      */
-    std::vector<std::vector<unsigned int> > indices_by_block;
+    std::vector<std::vector<types::global_dof_index> > indices_by_block;
 
     /**
      * Constructor setting the
@@ -117,7 +122,7 @@ namespace MeshWorker
      * pointer empty, but setting
      * the #aux_local_indices.
      */
-    DoFInfo (const DoFHandler<dim, spacedim>dof_handler);
+    DoFInfo (const DoFHandler<dim, spacedim> &dof_handler);
 
     /**
      * Set the current cell and
@@ -132,7 +137,7 @@ namespace MeshWorker
     template <class DHCellIterator, class DHFaceIterator>
     void reinit(const DHCellIterator &c,
                 const DHFaceIterator &f,
-                const unsigned int n);
+                const unsigned int face_no);
 
     /**
      * Set the current subface and fill @p indices if the #cell
@@ -141,8 +146,8 @@ namespace MeshWorker
     template <class DHCellIterator, class DHFaceIterator>
     void reinit(const DHCellIterator &c,
                 const DHFaceIterator &f,
-                const unsigned int n,
-                const unsigned int s);
+                const unsigned int face_no,
+                const unsigned int subface_no);
 
     /**
      * Switch to a new face of the same cell. Does not change @p
@@ -150,16 +155,16 @@ namespace MeshWorker
      */
     template <class DHFaceIterator>
     void set_face (const DHFaceIterator &f,
-                   const unsigned int n);
-    
+                   const unsigned int face_no);
+
     /**
      * Switch to a new subface of the same cell. Does not change @p
      * indices and does not reset data in LocalResults.
      */
     template <class DHFaceIterator>
     void set_subface (const DHFaceIterator &f,
-                      const unsigned int n,
-                      const unsigned int s);
+                      const unsigned int face_no,
+                      const unsigned int subface_no);
 
     const BlockIndices &local_indices() const;
 
@@ -183,7 +188,7 @@ namespace MeshWorker
     void get_indices(const DHCellIterator &c);
 
     /// Auxiliary vector
-    std::vector<unsigned int> indices_org;
+    std::vector<types::global_dof_index> indices_org;
 
     /**
      * An auxiliary local
@@ -282,7 +287,7 @@ namespace MeshWorker
   template <int dim, int spacedim, typename number>
   DoFInfo<dim,spacedim,number>::DoFInfo(const DoFHandler<dim,spacedim> &dof_handler)
   {
-    std::vector<unsigned int> aux(1);
+    std::vector<types::global_dof_index> aux(1);
     aux[0] = dof_handler.get_fe().dofs_per_cell;
     aux_local_indices.reinit(aux);
   }
@@ -313,7 +318,7 @@ namespace MeshWorker
     get_indices(c);
     level_cell = c->is_level_cell();
 
-    cell = static_cast<typename Triangulation<dim,spacedim>::cell_iterator> (c);
+    cell = typename Triangulation<dim,spacedim>::cell_iterator(*c);
     face_number = deal_II_numbers::invalid_unsigned_int;
     sub_number = deal_II_numbers::invalid_unsigned_int;
     if (block_info)
@@ -328,10 +333,10 @@ namespace MeshWorker
   inline void
   DoFInfo<dim,spacedim,number>::set_face(
     const DHFaceIterator &f,
-    unsigned int n)
+    const unsigned int face_no)
   {
     face = static_cast<typename Triangulation<dim>::face_iterator> (f);
-    face_number = n;
+    face_number = face_no;
     sub_number = deal_II_numbers::invalid_unsigned_int;
   }
 
@@ -342,15 +347,15 @@ namespace MeshWorker
   DoFInfo<dim,spacedim,number>::reinit(
     const DHCellIterator &c,
     const DHFaceIterator &f,
-    unsigned int n)
+    const unsigned int face_no)
   {
     if ((cell.state() != IteratorState::valid)
-        ||  cell != static_cast<typename Triangulation<dim>::cell_iterator> (c))
+        ||  cell != typename Triangulation<dim>::cell_iterator(*c))
       get_indices(c);
     level_cell = c->is_level_cell();
 
-    cell = static_cast<typename Triangulation<dim>::cell_iterator> (c);
-    set_face(f,n);
+    cell = typename Triangulation<dim>::cell_iterator(*c);
+    set_face(f,face_no);
 
     if (block_info)
       LocalResults<number>::reinit(block_info->local());
@@ -364,12 +369,12 @@ namespace MeshWorker
   inline void
   DoFInfo<dim,spacedim,number>::set_subface(
     const DHFaceIterator &f,
-    unsigned int n,
-    unsigned int s)
+    const unsigned int face_no,
+    const unsigned int subface_no)
   {
     face = static_cast<typename Triangulation<dim>::face_iterator> (f);
-    face_number = n;
-    sub_number = s;
+    face_number = face_no;
+    sub_number = subface_no;
   }
 
 
@@ -379,8 +384,8 @@ namespace MeshWorker
   DoFInfo<dim,spacedim,number>::reinit(
     const DHCellIterator &c,
     const DHFaceIterator &f,
-    unsigned int n,
-    unsigned int s)
+    const unsigned int face_no,
+    const unsigned int subface_no)
   {
     if (cell.state() != IteratorState::valid
         || cell != static_cast<typename Triangulation<dim>::cell_iterator> (c))
@@ -388,7 +393,7 @@ namespace MeshWorker
     level_cell = c->is_level_cell();
 
     cell = static_cast<typename Triangulation<dim>::cell_iterator> (c);
-    set_subface(f,n,s);
+    set_subface(f, face_no, subface_no);
 
     if (block_info)
       LocalResults<number>::reinit(block_info->local());
index b3eefcfcdd73f1cf7c4311dda37e505dbc549785..91c25acbc547021fb92e4f177edafe8b1bbfcdb7 100644 (file)
@@ -1,15 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/meshworker/dof_info.h>
 #include <deal.II/base/quadrature_lib.h>
index 08546b1ba9306668f03f7c86b4024b55a79ddb94..a651ba1acc6b7788c05bdd93bc638bdb7259c00c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_functional_h
 #define __deal2__mesh_worker_functional_h
index aa220d1f6ba1b1d8a363c1697edd536b6ad68666..4323bbf83a7a2d02e5ecac47f64bdeb6abbf5617 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_integration_info_h
 #define __deal2__mesh_worker_integration_info_h
index 93b5d01f07eed597517e87d93f5bb09e490a4809..b1e1c21932a1e9d9e9aabe47d840a1d1f74dd718 100644 (file)
@@ -1,15 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/meshworker/dof_info.h>
 #include <deal.II/meshworker/integration_info.h>
index c46173eb2127093eb9238f1a22f93dda38968d69..2516135024ec87b08e3cc9955cd0d1767de787f9 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_local_integrator_h
 #define __deal2__mesh_worker_local_integrator_h
@@ -35,6 +40,10 @@ namespace MeshWorker
    * integrate on boundary and interior faces. Thes flags are true by
    * default, but can be modified by applications to speed up the loop.
    *
+   * If a function is not overloaded in a derived class, but its usage
+   * flag is true, the function will cause an exception
+   * ExcPureFunction.
+   *
    * @ingroup MeshWorker
    * @author Guido Kanschat
    * @date 2012
@@ -44,64 +53,68 @@ namespace MeshWorker
   {
   public:
     /**
-    * The constructor setting
-    * default values.
+    * The constructor setting default values, namely all integration flags to true.
     */
     LocalIntegrator();
 
+    /**
+    * The constructor setting integration flags to specified values.
+    */
+    LocalIntegrator(bool use_cell, bool use_boundary, bool use_face);
+
     /**
     * The empty virtual destructor.
     */
     ~LocalIntegrator();
 
     /**
-    * Virtual function for
-    * integrating on cells.
+    * Virtual function for integrating on cells. Throws exception
+    * PureFunctionCalled if not overloaded by a derived class.
     */
     virtual void cell(DoFInfo<dim, spacedim, number> &dinfo,
-                      IntegrationInfo<dim, spacedim> &info) const = 0;
+                      IntegrationInfo<dim, spacedim> &info) const;
     /**
-    * Virtual function for
-    * integrating on boundary faces.
+    * Virtual function for integrating on boundary faces. Throws exception
+    * PureFunctionCalled if not overloaded by a derived class.
     */
     virtual void boundary(DoFInfo<dim, spacedim, number> &dinfo,
-                          IntegrationInfo<dim, spacedim> &info) const = 0;
+                          IntegrationInfo<dim, spacedim> &info) const;
     /**
-    * Virtual function for
-    * integrating on interior faces.
+    * Virtual function for integrating on interior faces. Throws exception
+    * PureFunctionCalled if not overloaded by a derived class.
     */
     virtual void face(DoFInfo<dim, spacedim, number> &dinfo1,
                       DoFInfo<dim, spacedim, number> &dinfo2,
                       IntegrationInfo<dim, spacedim> &info1,
-                      IntegrationInfo<dim, spacedim> &info2) const = 0;
+                      IntegrationInfo<dim, spacedim> &info2) const;
 
     /**
-    * The flag indicating whether
-    * the cell integrator cell()
-    * is to be used in the
-    * loop. Defaults to
-    * <tt>true</tt>.
+    * The flag indicating whether the cell integrator cell() is to be
+    * used in the loop. Defaults to <tt>true</tt>.
     */
     bool use_cell;
 
     /**
-    * The flag indicating whether
-    * the boundary integrator
-    * boundary() is to be
-    * used in the loop. Defaults
-    * to <tt>true</tt>.
+    * The flag indicating whether the boundary integrator boundary()
+    * is to be used in the loop. Defaults to <tt>true</tt>.
     */
     bool use_boundary;
 
     /**
-    * The flag indicating whether
-    * the interior face integrator
-    * face() is to be used in the
-    * loop. Defaults to
-    * <tt>true</tt>.
+    * The flag indicating whether the interior face integrator face()
+    * is to be used in the loop. Defaults to <tt>true</tt>.
     */
     bool use_face;
 
+    /**
+     * This error is thrown if one of the virtual functions cell(),
+     * boundary(), or face() is called without being overloaded in a
+     * derived class. Consider setting #use_cell, #use_boundary, and
+     * #use_face to false, respectively.
+     *
+     * @ingroup Exceptions
+     */
+    DeclException0(ExcPureFunction);
   };
 }
 
index 718d683b368afaec3939997c74d22a5dbad2f7be..828632548a3d1d5c126fb19bbeb474dd5d0dd481 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_local_results_h
 #define __deal2__mesh_worker_local_results_h
@@ -320,14 +325,14 @@ namespace MeshWorker
      * @note This function is usually only called by the assembler.
      */
     void initialize_numbers(const unsigned int n);
-    
+
     /**
      * Initialize the vector with vector values.
      *
      * @note This function is usually only called by the assembler.
      */
     void initialize_vectors(const unsigned int n);
-    
+
     /**
      * Allocate @p n local matrices. Additionally, set their block row
      * and column coordinates to zero. The matrices themselves are
index b4429031f7b371aeb2bb8b91a8151ef4a6e26876..73ed8f5bd7ba8a33110f99ee674b20d56b99bff4 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_loop_h
 #define __deal2__mesh_worker_loop_h
@@ -28,6 +33,7 @@
 DEAL_II_NAMESPACE_OPEN
 
 template <typename> class TriaActiveIterator;
+template <typename> class FilteredIterator;
 
 namespace internal
 {
@@ -46,6 +52,12 @@ namespace internal
     return true;
   }
 
+  template <class ACCESSOR>
+  inline bool is_active_iterator(const FilteredIterator<TriaActiveIterator<ACCESSOR> > &)
+  {
+    return true;
+  }
+
   template<int dim, class DOFINFO, class A>
   void assemble(const MeshWorker::DoFInfoBox<dim, DOFINFO> &dinfo, A *assembler)
   {
@@ -250,7 +262,8 @@ namespace MeshWorker
                                             typename INFOBOX::CellInfo &,
                                             typename INFOBOX::CellInfo &)>& face_worker,
             ASSEMBLER &assembler,
-            bool cells_first = true)
+            bool cells_first = true,
+            bool unique_faces_only = true)
   {
     DoFInfoBox<dim, DOFINFO> dof_info(dinfo);
 
@@ -266,7 +279,7 @@ namespace MeshWorker
     WorkStream::run(begin, end,
                     std_cxx1x::bind(&cell_action<INFOBOX, DOFINFO, dim, spacedim, ITERATOR>,
                                     std_cxx1x::_1, std_cxx1x::_3, std_cxx1x::_2,
-                                    cell_worker, boundary_worker, face_worker, cells_first, true),
+                                    cell_worker, boundary_worker, face_worker, cells_first, unique_faces_only),
                     std_cxx1x::bind(&internal::assemble<dim,DOFINFO,ASSEMBLER>, std_cxx1x::_1, &assembler),
                     info, dof_info);
 #else
@@ -276,7 +289,7 @@ namespace MeshWorker
                                                   info, cell_worker,
                                                   boundary_worker, face_worker,
                                                   cells_first,
-                                                  true);
+                                                  unique_faces_only);
         dof_info.assemble(assembler);
       }
 #endif
index 063d8784e073b7f14d3869edef94c4f2b9af76ea..e51d8c01163e160ae1448877454f5161e32f0ae3 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_output_h
 #define __deal2__mesh_worker_output_h
index 3858b436ad75124c0100950c42f4e5fba31cfa44..88e201777a49df2117480e7d9b2f8e1f68733763 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mesh_worker_simple_h
 #define __deal2__mesh_worker_simple_h
@@ -115,8 +120,8 @@ namespace MeshWorker
        */
       SmartPointer<const ConstraintMatrix,ResidualSimple<VECTOR> > constraints;
     };
-    
-    
+
+
     /**
      * Assemble local matrices into a single global matrix. If this global
      * matrix has a block structure, this structure is not used, but
@@ -212,8 +217,8 @@ namespace MeshWorker
        * into #matrix.
        */
       void assemble(const FullMatrix<double> &M,
-                    const std::vector<unsigned int> &i1,
-                    const std::vector<unsigned int> &i2);
+                    const std::vector<types::global_dof_index> &i1,
+                    const std::vector<types::global_dof_index> &i2);
 
       /**
        * The global matrix being
@@ -330,16 +335,16 @@ namespace MeshWorker
        */
       void assemble(MATRIX &G,
                     const FullMatrix<double> &M,
-                    const std::vector<unsigned int> &i1,
-                    const std::vector<unsigned int> &i2);
+                    const std::vector<types::global_dof_index> &i1,
+                    const std::vector<types::global_dof_index> &i2);
 
       /**
        * Assemble a single matrix into a global matrix.
        */
       void assemble(MATRIX &G,
                     const FullMatrix<double> &M,
-                    const std::vector<unsigned int> &i1,
-                    const std::vector<unsigned int> &i2,
+                    const std::vector<types::global_dof_index> &i1,
+                    const std::vector<types::global_dof_index> &i2,
                     const unsigned int level);
 
       /**
@@ -348,8 +353,8 @@ namespace MeshWorker
 
       void assemble_up(MATRIX &G,
                        const FullMatrix<double> &M,
-                       const std::vector<unsigned int> &i1,
-                       const std::vector<unsigned int> &i2,
+                       const std::vector<types::global_dof_index> &i1,
+                       const std::vector<types::global_dof_index> &i2,
                        const unsigned int level = numbers::invalid_unsigned_int);
       /**
        * Assemble a single matrix into a global matrix.
@@ -357,8 +362,8 @@ namespace MeshWorker
 
       void assemble_down(MATRIX &G,
                          const FullMatrix<double> &M,
-                         const std::vector<unsigned int> &i1,
-                         const std::vector<unsigned int> &i2,
+                         const std::vector<types::global_dof_index> &i1,
+                         const std::vector<types::global_dof_index> &i2,
                          const unsigned int level = numbers::invalid_unsigned_int);
 
       /**
@@ -367,8 +372,8 @@ namespace MeshWorker
 
       void assemble_in(MATRIX &G,
                        const FullMatrix<double> &M,
-                       const std::vector<unsigned int> &i1,
-                       const std::vector<unsigned int> &i2,
+                       const std::vector<types::global_dof_index> &i1,
+                       const std::vector<types::global_dof_index> &i2,
                        const unsigned int level = numbers::invalid_unsigned_int);
 
       /**
@@ -377,8 +382,8 @@ namespace MeshWorker
 
       void assemble_out(MATRIX &G,
                         const FullMatrix<double> &M,
-                        const std::vector<unsigned int> &i1,
-                        const std::vector<unsigned int> &i2,
+                        const std::vector<types::global_dof_index> &i1,
+                        const std::vector<types::global_dof_index> &i2,
                         const unsigned int level = numbers::invalid_unsigned_int);
 
       /**
@@ -510,8 +515,8 @@ namespace MeshWorker
     inline void
     ResidualSimple<MATRIX>::initialize_local_blocks(const BlockIndices &)
     {}
-    
-    
+
+
     template <class VECTOR>
     template <class DOFINFO>
     inline void
@@ -535,13 +540,13 @@ namespace MeshWorker
             }
           else
             {
-             if (info.indices_by_block.size() == 0)
-               constraints->distribute_local_to_global(info.vector(k).block(0), info.indices, (*residuals(k)));
-             else
-               for (unsigned int i=0;i != info.vector(k).n_blocks();++i)
-                 constraints->distribute_local_to_global(info.vector(k).block(i), info.indices_by_block[i], (*residuals(k)));
-           }
-       }
+              if (info.indices_by_block.size() == 0)
+                constraints->distribute_local_to_global(info.vector(k).block(0), info.indices, (*residuals(k)));
+              else
+                for (unsigned int i=0; i != info.vector(k).n_blocks(); ++i)
+                  constraints->distribute_local_to_global(info.vector(k).block(i), info.indices_by_block[i], (*residuals(k)));
+            }
+        }
     }
 
     template <class VECTOR>
@@ -561,27 +566,27 @@ namespace MeshWorker
             }
           else
             {
-             if (info1.indices_by_block.size() == 0 && info2.indices_by_block.size() == 0)
-               {
-                 constraints->distribute_local_to_global
-                   (info1.vector(k).block(0), info1.indices, (*residuals(k)));
-                 constraints->distribute_local_to_global
-                   (info2.vector(k).block(0), info2.indices, (*residuals(k)));
-               }
-             else if (info1.indices_by_block.size() != 0 && info2.indices_by_block.size() != 0)
-               {
-                 for (unsigned int i=0;i<info1.vector(k).n_blocks();++i)
-                   {
-                     constraints->distribute_local_to_global
-                       (info1.vector(k).block(i), info1.indices_by_block[i], (*residuals(k)));
-                     constraints->distribute_local_to_global
-                       (info2.vector(k).block(i), info2.indices_by_block[i], (*residuals(k)));
-                   }
-               }
-             else
-               {
-                 Assert(false, ExcNotImplemented());
-               }
+              if (info1.indices_by_block.size() == 0 && info2.indices_by_block.size() == 0)
+                {
+                  constraints->distribute_local_to_global
+                  (info1.vector(k).block(0), info1.indices, (*residuals(k)));
+                  constraints->distribute_local_to_global
+                  (info2.vector(k).block(0), info2.indices, (*residuals(k)));
+                }
+              else if (info1.indices_by_block.size() != 0 && info2.indices_by_block.size() != 0)
+                {
+                  for (unsigned int i=0; i<info1.vector(k).n_blocks(); ++i)
+                    {
+                      constraints->distribute_local_to_global
+                      (info1.vector(k).block(i), info1.indices_by_block[i], (*residuals(k)));
+                      constraints->distribute_local_to_global
+                      (info2.vector(k).block(i), info2.indices_by_block[i], (*residuals(k)));
+                    }
+                }
+              else
+                {
+                  Assert(false, ExcNotImplemented());
+                }
             }
         }
     }
@@ -651,8 +656,8 @@ namespace MeshWorker
     template <class MATRIX>
     inline void
     MatrixSimple<MATRIX>::assemble(const FullMatrix<double> &M,
-                                   const std::vector<unsigned int> &i1,
-                                   const std::vector<unsigned int> &i2)
+                                   const std::vector<types::global_dof_index> &i1,
+                                   const std::vector<types::global_dof_index> &i2)
     {
       AssertDimension(M.m(), i1.size());
       AssertDimension(M.n(), i2.size());
@@ -721,9 +726,9 @@ namespace MeshWorker
                      info2.indices_by_block[row], info1.indices_by_block[column]);
           }
       else
-       {
-         Assert(false, ExcNotImplemented());
-       }
+        {
+          Assert(false, ExcNotImplemented());
+        }
     }
 
 
@@ -810,8 +815,8 @@ namespace MeshWorker
     MGMatrixSimple<MATRIX>::assemble(
       MATRIX &G,
       const FullMatrix<double> &M,
-      const std::vector<unsigned int> &i1,
-      const std::vector<unsigned int> &i2)
+      const std::vector<types::global_dof_index> &i1,
+      const std::vector<types::global_dof_index> &i2)
     {
       AssertDimension(M.m(), i1.size());
       AssertDimension(M.n(), i2.size());
@@ -841,8 +846,8 @@ namespace MeshWorker
     MGMatrixSimple<MATRIX>::assemble(
       MATRIX &G,
       const FullMatrix<double> &M,
-      const std::vector<unsigned int> &i1,
-      const std::vector<unsigned int> &i2,
+      const std::vector<types::global_dof_index> &i1,
+      const std::vector<types::global_dof_index> &i2,
       const unsigned int level)
     {
       AssertDimension(M.m(), i1.size());
@@ -865,15 +870,8 @@ namespace MeshWorker
                   {
                     if (mg_constrained_dofs->set_boundary_values())
                       {
-                        // At the
-                        // boundary,
-                        // only enter
-                        // the term
-                        // on the
-                        // diagonal,
-                        // but not
-                        // the
-                        // coupling terms
+                        // At the boundary, only enter the term on the
+                        // diagonal, but not the coupling terms
                         if ((!mg_constrained_dofs->is_boundary_index(level, i1[j]) &&
                              !mg_constrained_dofs->is_boundary_index(level, i2[k]))
                             ||
@@ -894,8 +892,8 @@ namespace MeshWorker
     MGMatrixSimple<MATRIX>::assemble_up(
       MATRIX &G,
       const FullMatrix<double> &M,
-      const std::vector<unsigned int> &i1,
-      const std::vector<unsigned int> &i2,
+      const std::vector<types::global_dof_index> &i1,
+      const std::vector<types::global_dof_index> &i2,
       const unsigned int level)
     {
       AssertDimension(M.n(), i1.size());
@@ -924,8 +922,8 @@ namespace MeshWorker
     MGMatrixSimple<MATRIX>::assemble_down(
       MATRIX &G,
       const FullMatrix<double> &M,
-      const std::vector<unsigned int> &i1,
-      const std::vector<unsigned int> &i2,
+      const std::vector<types::global_dof_index> &i1,
+      const std::vector<types::global_dof_index> &i2,
       const unsigned int level)
     {
       AssertDimension(M.m(), i1.size());
@@ -954,8 +952,8 @@ namespace MeshWorker
     MGMatrixSimple<MATRIX>::assemble_in(
       MATRIX &G,
       const FullMatrix<double> &M,
-      const std::vector<unsigned int> &i1,
-      const std::vector<unsigned int> &i2,
+      const std::vector<types::global_dof_index> &i1,
+      const std::vector<types::global_dof_index> &i2,
       const unsigned int level)
     {
       AssertDimension(M.m(), i1.size());
@@ -973,6 +971,17 @@ namespace MeshWorker
           for (unsigned int j=0; j<i1.size(); ++j)
             for (unsigned int k=0; k<i2.size(); ++k)
               if (std::fabs(M(j,k)) >= threshold)
+                // Enter values into matrix only if j corresponds to a
+                // degree of freedom on the refinemenent edge, k does
+                // not, and both are not on the boundary. This is part
+                // the difference between the complete matrix with no
+                // boundary condition at the refinement edge and and
+                // the matrix assembled above by assemble().
+
+                // Thus the logic is: enter the row if it is
+                // constrained by hanging node constraints (actually,
+                // the whole refinement edge), but not if it is
+                // constrained by a boundary constraint.
                 if (mg_constrained_dofs->at_refinement_edge(level, i1[j]) &&
                     !mg_constrained_dofs->at_refinement_edge(level, i2[k]))
                   {
@@ -997,8 +1006,8 @@ namespace MeshWorker
     MGMatrixSimple<MATRIX>::assemble_out(
       MATRIX &G,
       const FullMatrix<double> &M,
-      const std::vector<unsigned int> &i1,
-      const std::vector<unsigned int> &i2,
+      const std::vector<types::global_dof_index> &i1,
+      const std::vector<types::global_dof_index> &i2,
       const unsigned int level)
     {
       AssertDimension(M.n(), i1.size());
index 0edf1df4f64312e98d78029e24a6d8dca623c02a..5976df4dbd3b81b0b87d12803a8a0e6931218051 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mesh_worker_vector_selector_h
 #define __deal2__mesh_worker_vector_selector_h
 
@@ -290,7 +295,7 @@ namespace MeshWorker
       std::vector<std::vector<std::vector<Tensor<1,dim> > > > &gradients,
       std::vector<std::vector<std::vector<Tensor<2,dim> > > > &hessians,
       const FEValuesBase<dim,spacedim> &fe,
-      const std::vector<unsigned int> &index,
+      const std::vector<types::global_dof_index> &index,
       const unsigned int component,
       const unsigned int n_comp,
       const unsigned int start,
@@ -313,7 +318,7 @@ namespace MeshWorker
       std::vector<std::vector<std::vector<Tensor<2,dim> > > > &hessians,
       const FEValuesBase<dim,spacedim> &fe,
       const unsigned int level,
-      const std::vector<unsigned int> &index,
+      const std::vector<types::global_dof_index> &index,
       const unsigned int component,
       const unsigned int n_comp,
       const unsigned int start,
@@ -382,7 +387,7 @@ namespace MeshWorker
       std::vector<std::vector<std::vector<Tensor<1,dim> > > > &gradients,
       std::vector<std::vector<std::vector<Tensor<2,dim> > > > &hessians,
       const FEValuesBase<dim,spacedim> &fe,
-      const std::vector<unsigned int> &index,
+      const std::vector<types::global_dof_index> &index,
       const unsigned int component,
       const unsigned int n_comp,
       const unsigned int start,
@@ -455,7 +460,7 @@ namespace MeshWorker
       std::vector<std::vector<std::vector<Tensor<2,dim> > > > &hessians,
       const FEValuesBase<dim,spacedim> &fe,
       const unsigned int level,
-      const std::vector<unsigned int> &index,
+      const std::vector<types::global_dof_index> &index,
       const unsigned int component,
       const unsigned int n_comp,
       const unsigned int start,
index 36a2dbb1ee686f1b3fcb06b145cbf3e6040ae18e..dc0e6fbbff3e6699b2e9336f9d10bbf231d64bda 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/meshworker/vector_selector.h>
 #include <deal.II/base/vector_slice.h>
@@ -42,7 +47,7 @@ namespace MeshWorker
     std::vector<std::vector<std::vector<Tensor<1,dim> > > > &,
     std::vector<std::vector<std::vector<Tensor<2,dim> > > > &,
     const FEValuesBase<dim,spacedim> &,
-    const std::vector<unsigned int> &,
+    const std::vector<types::global_dof_index> &,
     const unsigned int,
     const unsigned int,
     const unsigned int,
@@ -60,7 +65,7 @@ namespace MeshWorker
     std::vector<std::vector<std::vector<Tensor<2,dim> > > > &,
     const FEValuesBase<dim,spacedim> &,
     const unsigned int,
-    const std::vector<unsigned int> &,
+    const std::vector<types::global_dof_index> &,
     const unsigned int,
     const unsigned int,
     const unsigned int,
@@ -110,7 +115,7 @@ namespace MeshWorker
     std::vector<std::vector<std::vector<Tensor<1,dim> > > > &gradients,
     std::vector<std::vector<std::vector<Tensor<2,dim> > > > &hessians,
     const FEValuesBase<dim,spacedim> &fe,
-    const std::vector<unsigned int> &index,
+    const std::vector<types::global_dof_index> &index,
     const unsigned int component,
     const unsigned int n_comp,
     const unsigned int start,
@@ -194,7 +199,7 @@ namespace MeshWorker
     std::vector<std::vector<std::vector<Tensor<2,dim> > > > &hessians,
     const FEValuesBase<dim,spacedim> &fe,
     const unsigned int level,
-    const std::vector<unsigned int> &index,
+    const std::vector<types::global_dof_index> &index,
     const unsigned int component,
     const unsigned int n_comp,
     const unsigned int start,
index 0f953c034b959ed072a22cc289116a609b3aff7d..1f39395a7ab8a2442b619b9515b51a46418cc9ca 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_base_h
 #define __deal2__mg_base_h
 
index 688bfdf78b272221e45ec213057c3e72a6a1781a..cc22195abf46c88ef8e1dea020c84eb548b735eb 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_block_smoother_h
 #define __deal2__mg_block_smoother_h
 
index fc31e5e29e9021b341f8ee22625cadcade04bb34..d586cf353a1513f447b8867560a86fb64b1f1744 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_coarse_h
 #define __deal2__mg_coarse_h
 
@@ -308,7 +313,7 @@ MGCoarseGridHouseholder<number, VECTOR>::initialize(
 template<typename number, class VECTOR>
 void
 MGCoarseGridHouseholder<number, VECTOR>::operator() (
-  const unsigned int,
+  const unsigned int /*level*/,
   VECTOR       &dst,
   const VECTOR &src) const
 {
@@ -339,7 +344,7 @@ MGCoarseGridSVD<number, VECTOR>::initialize(
 template<typename number, class VECTOR>
 void
 MGCoarseGridSVD<number, VECTOR>::operator() (
-  const unsigned int,
+  const unsigned int /*level*/,
   VECTOR       &dst,
   const VECTOR &src) const
 {
index c442ae7d671a7c3d103236fc2dbd08d6c67a9bd9..85389cdffaff876851cb59acdc1c1df7b05ede7b 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_constraints_h
 #define __deal2__mg_constraints_h
 
@@ -35,6 +40,8 @@ template <int dim> struct FunctionMap;
 class MGConstrainedDoFs : public Subscriptor
 {
 public:
+
+  typedef std::vector<std::set<types::global_dof_index> >::size_type size_dof;
   /**
    * Fill the internal data
    * structures with values
@@ -67,116 +74,97 @@ public:
   void clear();
 
   /**
-   * Determine whether a dof index
-   * is subject to a boundary
+   * Determine whether a dof index is subject to a boundary
    * constraint.
    */
   bool is_boundary_index (const unsigned int level,
-                          const unsigned int index) const;
+                          const types::global_dof_index index) const;
 
   /**
-   * Determine whether a dof index
-   * is at an edge that is not
-   * a refinement edge.
+   * Determine whether a dof index is at an edge that is not a
+   * refinement edge.
    */
   bool non_refinement_edge_index (const unsigned int level,
-                                  const unsigned int index) const;
+                                  const types::global_dof_index index) const;
 
   /**
-   * Determine whether a dof index
-   * is at the refinement edge.
+   * Determine whether a dof index is at the refinement edge.
    */
   bool at_refinement_edge (const unsigned int level,
-                           const unsigned int index) const;
+                           const types::global_dof_index index) const;
 
   /**
-   * Determine whether a dof index
-   * is at the refinement edge and
-   * subject to a boundary
-   * constraint .
+   * Determine whether a dof index is at the refinement edge and
+   * subject to a boundary constraint .
    */
   bool at_refinement_edge_boundary (const unsigned int level,
-                                    const unsigned int index) const;
+                                    const types::global_dof_index index) const;
 
   /**
-   * Return the indices of dofs for each
-   * level that lie on the boundary of the
-   * domain.
+   * Return the indices of dofs for each level that lie on the
+   * boundary of the domain.
    */
-  const std::vector<std::set<unsigned int> > &
+  const std::vector<std::set<types::global_dof_index> > &
   get_boundary_indices () const;
 
   /**
-   * Return the indices of dofs for each
-   * level that lie on the boundary of the
-   * domain.
+   * Return the indices of dofs for each level that lie on the
+   * boundary of the domain.
    */
-  const std::vector<std::set<unsigned int> > &
+  const std::vector<std::set<types::global_dof_index> > &
   get_non_refinement_edge_indices () const;
 
   /**
-   * Return the indices of dofs for each
-   * level that lie on the refinement edge
-   * (i.e. are on faces between cells of
-   * this level and cells on the level
-   * below).
+   * Return the indices of dofs for each level that lie on the
+   * refinement edge (i.e. are on faces between cells of this level
+   * and cells on the level below).
    */
   const std::vector<std::vector<bool> > &
   get_refinement_edge_indices () const;
 
   /**
-   * Return the indices of dofs for each
-   * level that are in the intersection of
-   * the sets returned by
-   * get_boundary_indices() and
+   * Return the indices of dofs for each level that are in the
+   * intersection of the sets returned by get_boundary_indices() and
    * get_refinement_edge_indices().
    */
   const std::vector<std::vector<bool> > &
   get_refinement_edge_boundary_indices () const;
 
   /**
-   * Return if boundary_indices need to
-   * be set or not.
+   * Return if boundary_indices need to be set or not.
    */
 
   bool set_boundary_values () const;
 
   /**
-   * Return if the finite element requires
-   * continuity across refinement edges.
+   * Return if the finite element requires continuity across
+   * refinement edges.
    */
   bool continuity_across_refinement_edges () const;
 private:
 
   /**
-   * The indices of boundary dofs
-   * for each level.
+   * The indices of boundary dofs for each level.
    */
-  std::vector<std::set<unsigned int> > boundary_indices;
+  std::vector<std::set<types::global_dof_index> > boundary_indices;
 
   /**
-   * The degrees of freedom on egdges
-   * that are not a
-   * refinement edge between a
-   * level and coarser cells.
+   * The degrees of freedom on egdges that are not a refinement edge
+   * between a level and coarser cells.
    */
-  std::vector<std::set<unsigned int> > non_refinement_edge_indices;
+  std::vector<std::set<types::global_dof_index> > non_refinement_edge_indices;
 
   /**
-   * The degrees of freedom on the
-   * refinement edge between a
-   * level and coarser cells.
+   * The degrees of freedom on the refinement edge between a level and
+   * coarser cells.
    */
   std::vector<std::vector<bool> > refinement_edge_indices;
 
   /**
-   * The degrees of freedom on the
-   * refinement edge between a
-   * level and coarser cells, which
-   * are also on the boundary.
+   * The degrees of freedom on the refinement edge between a level and
+   * coarser cells, which are also on the boundary.
    *
-   * This is a subset of
-   * #refinement_edge_indices.
+   * This is a subset of #refinement_edge_indices.
    */
   std::vector<std::vector<bool> > refinement_edge_boundary_indices;
 };
@@ -187,7 +175,7 @@ inline
 void
 MGConstrainedDoFs::initialize(const DoFHandler<dim,spacedim> &dof)
 {
-  const unsigned int nlevels = dof.get_tria().n_levels();
+  const unsigned int nlevels = dof.get_tria().n_global_levels();
   refinement_edge_indices.resize(nlevels);
   refinement_edge_boundary_indices.resize(nlevels);
   non_refinement_edge_indices.resize(nlevels);
@@ -211,7 +199,7 @@ MGConstrainedDoFs::initialize(
   const typename FunctionMap<dim>::type &function_map,
   const ComponentMask &component_mask)
 {
-  const unsigned int nlevels = dof.get_tria().n_levels();
+  const unsigned int nlevels = dof.get_tria().n_global_levels();
   boundary_indices.resize(nlevels);
   refinement_edge_indices.resize(nlevels);
   refinement_edge_boundary_indices.resize(nlevels);
@@ -252,7 +240,7 @@ MGConstrainedDoFs::clear()
 inline
 bool
 MGConstrainedDoFs::is_boundary_index (const unsigned int level,
-                                      const unsigned int index) const
+                                      const types::global_dof_index index) const
 {
   AssertIndexRange(level, boundary_indices.size());
   if (boundary_indices[level].find(index) != boundary_indices[level].end())
@@ -264,7 +252,7 @@ MGConstrainedDoFs::is_boundary_index (const unsigned int level,
 inline
 bool
 MGConstrainedDoFs::non_refinement_edge_index (const unsigned int level,
-                                              const unsigned int index) const
+                                              const types::global_dof_index index) const
 {
   AssertIndexRange(level, non_refinement_edge_indices.size());
 
@@ -277,7 +265,7 @@ MGConstrainedDoFs::non_refinement_edge_index (const unsigned int level,
 inline
 bool
 MGConstrainedDoFs::at_refinement_edge (const unsigned int level,
-                                       const unsigned int index) const
+                                       const types::global_dof_index index) const
 {
   AssertIndexRange(level, refinement_edge_indices.size());
   AssertIndexRange(index, refinement_edge_indices[level].size());
@@ -289,7 +277,7 @@ MGConstrainedDoFs::at_refinement_edge (const unsigned int level,
 inline
 bool
 MGConstrainedDoFs::at_refinement_edge_boundary (const unsigned int level,
-                                                const unsigned int index) const
+                                                const types::global_dof_index index) const
 {
   AssertIndexRange(level, refinement_edge_boundary_indices.size());
   AssertIndexRange(index, refinement_edge_boundary_indices[level].size());
@@ -298,14 +286,14 @@ MGConstrainedDoFs::at_refinement_edge_boundary (const unsigned int level,
 }
 
 inline
-const std::vector<std::set<unsigned int> > &
+const std::vector<std::set<types::global_dof_index> > &
 MGConstrainedDoFs::get_boundary_indices () const
 {
   return boundary_indices;
 }
 
 inline
-const std::vector<std::set<unsigned int> > &
+const std::vector<std::set<types::global_dof_index> > &
 MGConstrainedDoFs::get_non_refinement_edge_indices () const
 {
   return non_refinement_edge_indices;
index 464119719b63b9ad22b45d24644a8e27c011aa1e..4067867a963aaf4b24d93269319a980dbbd2de61 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_dof_accessor_h
 #define __deal2__mg_dof_accessor_h
 
index 736b9778adafe6384703c79b3b3f887ade088db0..7bf6eca7e6165d5397c3c425c7c0f04ff2c6ffcd 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_dof_handler_h
 #define __deal2__mg_dof_handler_h
 
index 5447e5c8591c413dbdf961e71086b4f028396f5f..d1c699112d6ccd34cc4d62a3b6bf1c696f56175a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_dof_iterator_selector_h
 #define __deal2__mg_dof_iterator_selector_h
 
index dcba1d20b70069ad1fe66e3196adff4f98e52ebc..ca7d17925cf0e3d5f218b8e2529d417334e24cce 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_matrix_h
 #define __deal2__mg_matrix_h
 
index bbfbfcedff69061d66f2a4368984c5c088c71a93..abeb0045e223f4029f471192f8e08eaa61b67f48 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_smoother_h
 #define __deal2__mg_smoother_h
 
@@ -1230,8 +1235,13 @@ MGSmootherPrecondition<MATRIX, PRECONDITIONER, VECTOR>::smooth(
         {
           if (this->debug > 0)
             deallog << 'T';
-          matrices[level].Tvmult(*r,u);
-          r->sadd(-1.,1.,rhs);
+          if (i == 0 && u.all_zero())
+            *r = rhs;
+          else
+            {
+              matrices[level].Tvmult(*r,u);
+              r->sadd(-1.,1.,rhs);
+            }
           if (this->debug > 2)
             deallog << ' ' << r->l2_norm() << ' ';
           smoothers[level].Tvmult(*d, *r);
@@ -1242,8 +1252,13 @@ MGSmootherPrecondition<MATRIX, PRECONDITIONER, VECTOR>::smooth(
         {
           if (this->debug > 0)
             deallog << 'N';
-          matrices[level].vmult(*r,u);
-          r->sadd(-1.,rhs);
+          if (i == 0 && u.all_zero())
+            *r = rhs;
+          else
+            {
+              matrices[level].vmult(*r,u);
+              r->sadd(-1.,rhs);
+            }
           if (this->debug > 2)
             deallog << ' ' << r->l2_norm() << ' ';
           smoothers[level].vmult(*d, *r);
index cd14c068dbe8c91fa8fa448e54651acf60d328ae..e06cbc96d9cd8d07fa8ac6b3ff9da0336c49134c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_tools_h
 #define __deal2__mg_tools_h
 
@@ -176,7 +181,7 @@ namespace MGTools
   template <class DH>
   void
   count_dofs_per_block (const DH     &dof_handler,
-                        std::vector<std::vector<unsigned int> > &dofs_per_block,
+                        std::vector<std::vector<types::global_dof_index> > &dofs_per_block,
                         std::vector<unsigned int>  target_block = std::vector<unsigned int>());
 
   /**
@@ -192,7 +197,7 @@ namespace MGTools
   template <int dim, int spacedim>
   void
   count_dofs_per_component (const DoFHandler<dim,spacedim> &mg_dof,
-                            std::vector<std::vector<unsigned int> > &result,
+                            std::vector<std::vector<types::global_dof_index> > &result,
                             const bool only_once = false,
                             std::vector<unsigned int> target_component = std::vector<unsigned int>());
 
@@ -204,7 +209,7 @@ namespace MGTools
   template <int dim, int spacedim>
   void
   count_dofs_per_component (const DoFHandler<dim,spacedim> &mg_dof,
-                            std::vector<std::vector<unsigned int> > &result,
+                            std::vector<std::vector<types::global_dof_index> > &result,
                             std::vector<unsigned int> target_component) DEAL_II_DEPRECATED;
 
   /**
@@ -233,7 +238,7 @@ namespace MGTools
   void
   make_boundary_list (const DoFHandler<dim,spacedim>      &mg_dof,
                       const typename FunctionMap<dim>::type &function_map,
-                      std::vector<std::set<unsigned int> >  &boundary_indices,
+                      std::vector<std::set<types::global_dof_index> > &boundary_indices,
                       const ComponentMask                   &component_mask = ComponentMask());
 
   /**
@@ -253,7 +258,7 @@ namespace MGTools
    */
   template <typename number>
   void
-  apply_boundary_values (const std::set<unsigned int> &boundary_dofs,
+  apply_boundary_values (const std::set<types::global_dof_index> &boundary_dofs,
                          SparseMatrix<number> &matrix,
                          const bool preserve_symmetry,
                          const bool ignore_zeros = false) DEAL_II_DEPRECATED;
@@ -263,7 +268,7 @@ namespace MGTools
    */
   template <typename number>
   void
-  apply_boundary_values (const std::set<unsigned int> &boundary_dofs,
+  apply_boundary_values (const std::set<types::global_dof_index> &boundary_dofs,
                          BlockSparseMatrix<number> &matrix,
                          const bool preserve_symmetry) DEAL_II_DEPRECATED;
 
@@ -302,7 +307,7 @@ namespace MGTools
   template <int dim, int spacedim>
   void
   extract_non_interface_dofs (const DoFHandler<dim,spacedim> &mg_dof_handler,
-                              std::vector<std::set<unsigned int> >  &non_interface_dofs);
+                              std::vector<std::set<types::global_dof_index> > &non_interface_dofs);
 }
 
 /* @} */
index d938dab05a7c2552a5d2ed3151157e42814f23ab..6d869a372074514841bc7a96fe536a4e87a74037 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_transfer_h
 #define __deal2__mg_transfer_h
 
@@ -43,9 +48,9 @@ namespace internal
   {
     typedef ::dealii::SparsityPattern Sparsity;
     typedef ::dealii::SparseMatrix<typename VECTOR::value_type> Matrix;
-    
+
     template <class CSP, class DH>
-    static void reinit(Matrix& matrix, Sparsity& sparsity, int level, const CSP& csp, const DH&)
+    static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const CSP &csp, const DH &)
     {
       sparsity.copy_from (csp);
       matrix.reinit (sparsity);
@@ -58,15 +63,15 @@ namespace internal
   {
     typedef ::dealii::TrilinosWrappers::SparsityPattern Sparsity;
     typedef ::dealii::TrilinosWrappers::SparseMatrix Matrix;
-    
+
     template <class CSP, class DH>
-    static void reinit(Matrix& matrix, Sparsity& sparsity, int level, const CSP& csp, DH& dh)
+    static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const CSP &csp, DH &dh)
     {
       matrix.reinit(dh.locally_owned_mg_dofs(level+1),
-                   dh.locally_owned_mg_dofs(level),
-                   csp, MPI_COMM_WORLD, true);
+                    dh.locally_owned_mg_dofs(level),
+                    csp, MPI_COMM_WORLD, true);
     }
-    
+
   };
 
   template <>
@@ -74,9 +79,9 @@ namespace internal
   {
     typedef ::dealii::TrilinosWrappers::SparsityPattern Sparsity;
     typedef ::dealii::TrilinosWrappers::SparseMatrix Matrix;
-    
+
     template <class CSP, class DH>
-    static void reinit(Matrix& matrix, Sparsity& sparsity, int level, const CSP& csp, DH& dh)
+    static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const CSP &csp, DH &dh)
     {
     }
   };
@@ -230,44 +235,68 @@ public:
    * Memory used by this object.
    */
   std::size_t memory_consumption () const;
-  
+
   /**
    * Print all the matrices for debugging purposes.
    */
-  void print_matrices(std::ostream& os) const;
+  void print_matrices(std::ostream &os) const;
+
+  /**
+   * Print the copy index fields for debugging purposes.
+   */
+  void print_indices(std::ostream &os) const;
 
 private:
 
   /**
    * Sizes of the multi-level vectors.
    */
-  std::vector<unsigned int> sizes;
+  std::vector<types::global_dof_index> sizes;
 
   /**
-   * Sparsity patterns for transfer
-   * matrices.
+   * Sparsity patterns for transfer matrices.
    */
   std::vector<std_cxx1x::shared_ptr<typename internal::MatrixSelector<VECTOR>::Sparsity> >   prolongation_sparsities;
 
   /**
-   * The actual prolongation matrix.
-   * column indices belong to the
-   * dof indices of the mother cell,
-   * i.e. the coarse level.
-   * while row indices belong to the
-   * child cell, i.e. the fine level.
+   * The actual prolongation matrix.  column indices belong to the dof
+   * indices of the mother cell, i.e. the coarse level.  while row
+   * indices belong to the child cell, i.e. the fine level.
    */
   std::vector<std_cxx1x::shared_ptr<typename internal::MatrixSelector<VECTOR>::Matrix> > prolongation_matrices;
 
   /**
-   * Mapping for the
-   * <tt>copy_to/from_mg</tt>-functions.
-   * The data is first the global
-   * index, then the level index.
+   * Mapping for the copy_to_mg() and copy_from_mg() functions. Here only
+   * index pairs locally owned
+   *
+   * The data is organized as follows: one vector per level. Each
+   * element of these vectors contains first the global index, then
+   * the level index.
    */
-  std::vector<std::vector<std::pair<unsigned int, unsigned int> > >
+  std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > >
   copy_indices;
 
+  /**
+   * Additional degrees of freedom for the copy_to_mg()
+   * function. These are the ones where the global degree of freedom
+   * is locally owned and the level degree of freedom is not.
+   *
+   * Organization of the data is like for #copy_indices_mine.
+   */
+  std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > >
+  copy_indices_to_me;
+
+  /**
+   * Additional degrees of freedom for the copy_from_mg()
+   * function. These are the ones where the level degree of freedom
+   * is locally owned and the global degree of freedom is not.
+   *
+   * Organization of the data is like for #copy_indices_mine.
+   */
+  std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > >
+  copy_indices_from_me;
+
+
   /**
    * The vector that stores what
    * has been given to the
index eac5bb03d76df363b9400f6e0b531dbca63f834d..59e3cde2c1e5cdfe68c00cca169765486cd67f1b 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mg_transfer_templates_h
 #define __deal2__mg_transfer_templates_h
@@ -86,9 +91,9 @@ namespace
                            target_component.end());
     const unsigned int n_target_blocks = max_block + 1;
 
-    std::vector<std::vector<unsigned int> >
+    std::vector<std::vector<types::global_dof_index> >
     ndofs(mg_dof.get_tria().n_levels(),
-          std::vector<unsigned int>(n_target_blocks));
+          std::vector<types::global_dof_index>(n_target_blocks));
     MGTools::count_dofs_per_block (mg_dof, ndofs, target_component);
 
     for (unsigned int level=v.min_level();
@@ -151,23 +156,22 @@ MGTransferPrebuilt<VECTOR>::copy_to_mg (
 {
   reinit_vector(mg_dof_handler, component_to_block_map, dst);
   bool first = true;
-  for (unsigned int level=mg_dof_handler.get_tria().n_levels(); level != 0;)
+  for (unsigned int level=mg_dof_handler.get_tria().n_global_levels(); level != 0;)
     {
       --level;
       VECTOR &dst_level = dst[level];
 
-      typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+      typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
       for (IT i= copy_indices[level].begin();
            i != copy_indices[level].end(); ++i)
         dst_level(i->second) = src(i->first);
 
-      // For non-DG: degrees of
-      // freedom in the refinement
-      // face may need special
-      // attention, since they belong
-      // to the coarse level, but
-      // have fine level basis
-      // functions
+      // for (IT i= copy_indices_to_me[level].begin();
+      //      i != copy_indices_to_me[level].end(); ++i)
+      //   dst_level(i->second) = src(i->first);
+
+      dst_level.compress(VectorOperation::insert);
+
       if (!first)
         restrict_and_add (level+1, dst[level], dst[level+1]);
 
@@ -193,11 +197,12 @@ MGTransferPrebuilt<VECTOR>::copy_from_mg(
   // have fine level basis
   // functions
   dst = 0;
-  for (unsigned int level=0; level<mg_dof_handler.get_tria().n_levels(); ++level)
+  for (unsigned int level=0; level<mg_dof_handler.get_tria().n_global_levels(); ++level)
     {
-      typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+      typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
 
-      if (constraints == 0)
+      // First copy all indices local to this process
+      if (constraints==0)
         for (IT i= copy_indices[level].begin();
              i != copy_indices[level].end(); ++i)
           dst(i->first) = src[level](i->second);
@@ -205,6 +210,17 @@ MGTransferPrebuilt<VECTOR>::copy_from_mg(
         for (IT i= copy_indices[level].begin();
              i != copy_indices[level].end(); ++i)
           constraints->distribute_local_to_global(i->first, src[level](i->second), dst);
+
+      // Do the same for the indices where the level index is local,
+      // but the global index is not
+      if (constraints==0)
+        for (IT i= copy_indices_from_me[level].begin();
+             i != copy_indices_from_me[level].end(); ++i)
+          dst(i->first) = src[level](i->second);
+      else
+        for (IT i= copy_indices_from_me[level].begin();
+             i != copy_indices_from_me[level].end(); ++i)
+          constraints->distribute_local_to_global(i->first, src[level](i->second), dst);
     }
 }
 
@@ -225,12 +241,28 @@ MGTransferPrebuilt<VECTOR>::copy_from_mg_add (
   // to the coarse level, but
   // have fine level basis
   // functions
-  for (unsigned int level=0; level<mg_dof_handler.get_tria().n_levels(); ++level)
+  for (unsigned int level=0; level<mg_dof_handler.get_tria().n_global_levels(); ++level)
     {
-      typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
-      for (IT i= copy_indices[level].begin();
-           i != copy_indices[level].end(); ++i)
-        dst(i->first) += src[level](i->second);
+      typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
+      if (constraints==0)
+        for (IT i= copy_indices[level].begin();
+             i != copy_indices[level].end(); ++i)
+          dst(i->first) += src[level](i->second);
+      else
+        for (IT i= copy_indices[level].begin();
+             i != copy_indices[level].end(); ++i)
+          constraints->distribute_local_to_global(i->first, src[level](i->second), dst);
+
+      // Do the same for the indices where the level index is local,
+      // but the global index is not
+      if (constraints==0)
+        for (IT i= copy_indices_from_me[level].begin();
+             i != copy_indices_from_me[level].end(); ++i)
+          dst(i->first) += src[level](i->second);
+      else
+        for (IT i= copy_indices_from_me[level].begin();
+             i != copy_indices_from_me[level].end(); ++i)
+          constraints->distribute_local_to_global(i->first, src[level](i->second), dst);
     }
 }
 
index c348a24308371cc9bb506595e7ec30f3423bfebc..b06e47f4044c4ab130e11f9606035404e4a5d0ab 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_transfer_block_h
 #define __deal2__mg_transfer_block_h
 
@@ -123,18 +128,18 @@ protected:
   /**
    * Sizes of the multi-level vectors.
    */
-  mutable std::vector<std::vector<unsigned int> > sizes;
+  mutable std::vector<std::vector<types::global_dof_index> > sizes;
 
   /**
    * Start index of each block.
    */
-  std::vector<unsigned int> block_start;
+  std::vector<types::global_dof_index> block_start;
 
   /**
    * Start index of each block on
    * all levels.
    */
-  std::vector<std::vector<unsigned int> > mg_block_start;
+  std::vector<std::vector<types::global_dof_index> > mg_block_start;
 
   /**
    * Call build_matrices()
@@ -520,7 +525,7 @@ private:
 
 /*@}*/
 
-//---------------------------------------------------------------------------
+//----------inline function definition--------------------------------------------------
 template <typename number>
 inline void
 MGTransferBlockSelect<number>::select(const unsigned int block)
index b3acd4e31d76d2617b097f1da598791f726aaef3..ef1fe22b919ed92b40e56cab395b7331c0379aaf 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    mg_transfer.templates.h,v 1.22 2006/01/29 15:03:55 guido Exp
-//    Version:
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mg_transfer_block_templates_h
 #define __deal2__mg_transfer_block_templates_h
@@ -33,7 +37,6 @@ DEAL_II_NAMESPACE_OPEN
 typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
 
 
-
 template <typename number>
 template <int dim, typename number2, int spacedim>
 void
index 708175b29afe84aca92e6f5753e1615e5b13f82a..40259aa4dd96a71da81df7a41fdbae85dc1b7804 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__mg_transfer_component_h
 #define __deal2__mg_transfer_component_h
 
@@ -125,18 +130,18 @@ protected:
   /**
    * Sizes of the multi-level vectors.
    */
-  mutable std::vector<std::vector<unsigned int> > sizes;
+  mutable std::vector<std::vector<types::global_dof_index> > sizes;
 
   /**
    * Start index of each component.
    */
-  std::vector<unsigned int> component_start;
+  std::vector<types::global_dof_index> component_start;
 
   /**
    * Start index of each component on
    * all levels.
    */
-  std::vector<std::vector<unsigned int> > mg_component_start;
+  std::vector<std::vector<types::global_dof_index> > mg_component_start;
 
   /**
    * Call build_matrices()
@@ -165,7 +170,7 @@ protected:
    * The data is first the global
    * index, then the level index.
    */
-  std::vector<std::vector<std::pair<unsigned int, unsigned int> > >
+  std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > >
   copy_to_and_from_indices;
 
   /**
@@ -174,7 +179,7 @@ protected:
    * boundary values in the
    * restriction matrix.
    */
-  std::vector<std::set<unsigned int> > boundary_indices;
+  std::vector<std::set<types::global_dof_index> > boundary_indices;
 };
 
 //TODO:[GK] Update documentation for copy_* functions
@@ -268,8 +273,8 @@ public:
                        = std::vector<unsigned int>(),
                        const std::vector<unsigned int> &mg_target_component
                        = std::vector<unsigned int>(),
-                       const std::vector<std::set<unsigned int> > &boundary_indices
-                       = std::vector<std::set<unsigned int> >()
+                       const std::vector<std::set<types::global_dof_index> > &boundary_indices
+                       = std::vector<std::set<types::global_dof_index> >()
                       );
 
   /**
index 47455156680089254ef8c7a40a0b59d8ce823729..856db2405acf85ae891061e7037f9d858828b226 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    mg_transfer.templates.h,v 1.22 2006/01/29 15:03:55 guido Exp
-//    Version:
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__mg_transfer_component_templates_h
 #define __deal2__mg_transfer_component_templates_h
@@ -99,7 +103,7 @@ MGTransferSelect<number>::copy_from_mg (
       //the block back to dst.
       const unsigned int n_blocks =
         *std::max_element(target_component.begin(), target_component.end()) + 1;
-      std::vector<unsigned int> dofs_per_block (n_blocks);
+      std::vector<types::global_dof_index> dofs_per_block (n_blocks);
       DoFTools::count_dofs_per_block (mg_dof_handler, dofs_per_block, target_component);
       BlockVector<number> tmp;
       tmp.reinit(n_blocks);
@@ -169,7 +173,7 @@ MGTransferSelect<number>::do_copy_from_mg (
   for (; level_cell != endc; ++level_cell)
     {
       const unsigned int level = level_cell->level();
-      typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+      typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
       for (IT i=copy_to_and_from_indices[level].begin();
            i != copy_to_and_from_indices[level].end(); ++i)
         dst(i->first) = src[level](i->second);
@@ -188,8 +192,8 @@ MGTransferSelect<number>::do_copy_from_mg_add (
   const FiniteElement<dim> &fe = mg_dof_handler.get_fe();
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
 
-  std::vector<unsigned int> global_dof_indices (dofs_per_cell);
-  std::vector<unsigned int> level_dof_indices (dofs_per_cell);
+  std::vector<types::global_dof_index> global_dof_indices (dofs_per_cell);
+  std::vector<types::global_dof_index> level_dof_indices (dofs_per_cell);
 
   typename DoFHandler<dim,spacedim>::active_cell_iterator
   level_cell = mg_dof_handler.begin_active();
@@ -206,7 +210,7 @@ MGTransferSelect<number>::do_copy_from_mg_add (
   for (; level_cell != endc; ++level_cell)
     {
       const unsigned int level = level_cell->level();
-      typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+      typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
       for (IT i=copy_to_and_from_indices[level].begin();
            i != copy_to_and_from_indices[level].end(); ++i)
         dst(i->first) += src[level](i->second);
index 4116300ad5c071abc52bf401585b9743376690ee..461a93fb56708f5160938c51c0ffd995bb77db75 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__multigrid_h
 #define __deal2__multigrid_h
 
@@ -600,7 +605,7 @@ Multigrid<VECTOR>::Multigrid (const DoFHandler<dim> &mg_dof_handler,
   :
   cycle_type(cycle),
   minlevel(0),
-  maxlevel(mg_dof_handler.get_tria().n_levels()-1),
+  maxlevel(mg_dof_handler.get_tria().n_global_levels()-1),
   defect(minlevel,maxlevel),
   solution(minlevel,maxlevel),
   t(minlevel,maxlevel),
index cfee9c22a91726738ab16b44640f5f483bc02fab..13b36bc9fc36fc62660c0a9bb8899d9c029f6cde 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__multigrid_templates_h
 #define __deal2__multigrid_templates_h
 #include <deal.II/multigrid/multigrid.h>
@@ -153,6 +158,10 @@ Multigrid<VECTOR>::level_v_step(const unsigned int level)
     deallog << "Residual on      level " << level << std::endl;
   // t = A*solution[level]
   matrix->vmult(level, t[level], solution[level]);
+
+  if (debug>2)
+    deallog << "Residual norm          " << t[level].l2_norm()
+            << std::endl;
 //  std::cout<<std::endl;
 //  t[level].print(std::cout, 2,false);
 
@@ -168,7 +177,7 @@ Multigrid<VECTOR>::level_v_step(const unsigned int level)
         {
           edge_out->vmult_add(level, t[level], solution[level]);
           if (debug>2)
-            deallog << "Norm t[" << level << "] " << t[level].l2_norm() << std::endl;
+            deallog << "Norm     t[" << level << "] " << t[level].l2_norm() << std::endl;
         }
 
       if (l==level && edge_down != 0)
@@ -179,7 +188,7 @@ Multigrid<VECTOR>::level_v_step(const unsigned int level)
         deallog << "restrict t[" << l-1 << "] " << t[l-1].l2_norm() << std::endl;
       defect[l-1] -= t[l-1];
       if (debug>3)
-        deallog << "defect d[" << l-1 << "] " << defect[l-1].l2_norm() << std::endl;
+        deallog << "defect   d[" << l-1 << "] " << defect[l-1].l2_norm() << std::endl;
     }
 
   // do recursion
@@ -194,6 +203,8 @@ Multigrid<VECTOR>::level_v_step(const unsigned int level)
 
   // do coarse grid correction
   transfer->prolongate(level, t[level], solution[level-1]);
+  if (debug>2)
+    deallog << "Prolongate norm        " << t[level].l2_norm() << std::endl;
 
   solution[level] += t[level];
 
index 0cb60e68dea8b7ba57e50c36a3385f64c109ee89..06e3a4ad3f8eeafba2fbc11ebd1a78ee99d2c60c 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__data_component_interpretation_h
 #define __deal2__data_component_interpretation_h
 
index 0acdca66413edb52e827c99e813254aa4cb9c446..bb2d8f01f16b5c21018476656cf8eecfc35b5672 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__data_out_h
 #define __deal2__data_out_h
 
index 69055bf91ceb4948bc9270f6551872e0bac0f424..07c33fd26427a23e60d58ac9cb224fa2ef423c62 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__data_out_faces_h
 #define __deal2__data_out_faces_h
 
index c720fb39331f35de24df4b8cc0aa505fddd5a110..95f4f57378e35a04d435c307c12a9c6add8f11e6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__data_out_rotation_h
 #define __deal2__data_out_rotation_h
 
index bfbe7ac39e15fe53bdd342431cfbc5718194d9ae..d7f65b44be06506e987c658983e7cd43b1980183 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__data_out_stack_h
 #define __deal2__data_out_stack_h
 
index f8101e16343342f2952f2d92de4f8f5a409756a7..0473525720c55ee76ab1c4fb3897aa4b5b8371d6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__data_postprocessor_h
 #define __deal2__data_postprocessor_h
 
index 0aaa4cc2c53cf1d887cb588bf514ba09026bab86..34ebddb3815e6f793cb781651bc4705811448521 100644 (file)
@@ -1,15 +1,19 @@
-
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2012 by the deal.II authors
+// This file is part of the deal.II library.
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
 //
-//---------------------------------------------------------------------------
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__gradient_estimator_h
 #define __deal2__gradient_estimator_h
 
index a79a4e1defd72c1813fcdf8bf3eaf49d318fb54b..70f89b546791d6cbad742b0e567c4c7b14d06494 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __deal2__dof_output_operator_h
 #define __deal2__dof_output_operator_h
index 3515f0c7adad6c28fb06338dc3126274aee2df4d..b9529a01c48e0c1ec6bd14e8338859c90ef41d06 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012 by Guido Kanschat
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/numerics/dof_output_operator.h>
 #include <deal.II/numerics/data_out.h>
index 9e9362bea24d830ffe618079a5f7f30db8a7b8a9..2965718e1ba3db0f78294f59d890bd0c193bec18 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__dof_print_solver_step_h
 #define __deal2__dof_print_solver_step_h
 
index 4e8a40b1ad465da4a893112cf24411630031402a..f47c98b30b0d3ce07c08c40ecfcd1fe49c3a9d88 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__error_estimator_h
 #define __deal2__error_estimator_h
 
index 98b7b663c7423701bf8e1df3154868a38e1122ec..b4df6928f13da72a9b4011af1554615656bf10f5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2009, 2012, 2013 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__fe_function_h
 #define __deal2__fe_function_h
 
index a5b657c227ffcbdbba84349c109a09addc796fac..93824a0f0399b5dacdbf3e90feeca0f97277a3e6 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/logstream.h>
@@ -61,16 +66,16 @@ namespace Functions
     typename DH::active_cell_iterator cell = cell_hint.get();
     if (cell == dh->end())
       cell = dh->begin_active();
-    
+
     boost::optional<Point<dim> >
     qp = get_reference_coordinates (cell, p);
     if (!qp)
       {
         const std::pair<typename DH::active_cell_iterator, Point<dim> > my_pair
           = GridTools::find_active_cell_around_point (mapping, *dh, p);
-       AssertThrow (my_pair.first->is_locally_owned(),
-                    ExcPointNotAvailableHere());
-       
+        AssertThrow (my_pair.first->is_locally_owned(),
+                     ExcPointNotAvailableHere());
+
         cell = my_pair.first;
         qp = my_pair.second;
       }
@@ -119,9 +124,9 @@ namespace Functions
       {
         const std::pair<typename DH::active_cell_iterator, Point<dim> > my_pair
           = GridTools::find_active_cell_around_point (mapping, *dh, p);
-       AssertThrow (my_pair.first->is_locally_owned(),
-                    ExcPointNotAvailableHere());
-       
+        AssertThrow (my_pair.first->is_locally_owned(),
+                     ExcPointNotAvailableHere());
+
         cell = my_pair.first;
         qp = my_pair.second;
       }
@@ -172,9 +177,9 @@ namespace Functions
       {
         const std::pair<typename DH::active_cell_iterator, Point<dim> > my_pair
           = GridTools::find_active_cell_around_point (mapping, *dh, p);
-       AssertThrow (my_pair.first->is_locally_owned(),
-                    ExcPointNotAvailableHere());
-       
+        AssertThrow (my_pair.first->is_locally_owned(),
+                     ExcPointNotAvailableHere());
+
         cell = my_pair.first;
         qp = my_pair.second;
       }
@@ -440,9 +445,9 @@ namespace Functions
           const std::pair<typename DH::active_cell_iterator, Point<dim> >
           my_pair  = GridTools::find_active_cell_around_point
                      (mapping, *dh, points[0]);
-         AssertThrow (my_pair.first->is_locally_owned(),
-                      ExcPointNotAvailableHere());
-       
+          AssertThrow (my_pair.first->is_locally_owned(),
+                       ExcPointNotAvailableHere());
+
           cell = my_pair.first;
           qp = my_pair.second;
           point_flags[0] = true;
@@ -504,9 +509,9 @@ namespace Functions
           {
             const std::pair<typename DH::active_cell_iterator, Point<dim> > my_pair
               = GridTools::find_active_cell_around_point (mapping, *dh, points[first_outside]);
-           AssertThrow (my_pair.first->is_locally_owned(),
-                        ExcPointNotAvailableHere());
-       
+            AssertThrow (my_pair.first->is_locally_owned(),
+                         ExcPointNotAvailableHere());
+
             cells.push_back(my_pair.first);
             qpoints.push_back(std::vector<Point<dim> >(1, my_pair.second));
             maps.push_back(std::vector<unsigned int>(1, first_outside));
index cbc4058387589b55e2ca53099a3ad143a7becf65..7a109e98ee0a298c0a616f5e066fe547ae7994a5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__histogram_h
 #define __deal2__histogram_h
 
index fb3dca6ce8ea922652adb59b3d68324ae63566d8..ffacbafac32c51987532fa7b6efba5ea2aef3031 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__matrix_tools_h
 #define __deal2__matrix_tools_h
 
@@ -366,7 +371,7 @@ namespace MatrixCreator
                                     SparseMatrix<double>     &matrix,
                                     const typename FunctionMap<spacedim>::type &boundary_functions,
                                     Vector<double>           &rhs_vector,
-                                    std::vector<unsigned int> &dof_to_boundary_mapping,
+                                    std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                     const Function<spacedim> *const weight = 0,
                                     std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
@@ -379,7 +384,7 @@ namespace MatrixCreator
 //                                    SparseMatrix<double>   &matrix,
 //                                    const FunctionMap<1>::type &boundary_functions,
 //                                    Vector<double>         &rhs_vector,
-//                                    std::vector<unsigned int>&dof_to_boundary_mapping,
+//                                    std::vector<types::global_dof_index>&dof_to_boundary_mapping,
 //                                    const Function<1> * const a = 0);
 // //codimension 1
 //
@@ -389,7 +394,7 @@ namespace MatrixCreator
 //                                    SparseMatrix<double>   &matrix,
 //                                    const FunctionMap<2>::type &boundary_functions,
 //                                    Vector<double>         &rhs_vector,
-//                                    std::vector<unsigned int>&dof_to_boundary_mapping,
+//                                    std::vector<types::global_dof_index>&dof_to_boundary_mapping,
 //                                    const Function<2> * const a = 0);
 
 
@@ -405,7 +410,7 @@ namespace MatrixCreator
                                     SparseMatrix<double>     &matrix,
                                     const typename FunctionMap<spacedim>::type        &boundary_functions,
                                     Vector<double>           &rhs_vector,
-                                    std::vector<unsigned int> &dof_to_boundary_mapping,
+                                    std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                     const Function<spacedim> *const a = 0,
                                     std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
@@ -420,7 +425,7 @@ namespace MatrixCreator
                                     SparseMatrix<double>     &matrix,
                                     const typename FunctionMap<spacedim>::type &boundary_functions,
                                     Vector<double>           &rhs_vector,
-                                    std::vector<unsigned int> &dof_to_boundary_mapping,
+                                    std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                     const Function<spacedim> *const a = 0,
                                     std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
@@ -434,7 +439,7 @@ namespace MatrixCreator
 //                                    SparseMatrix<double>   &matrix,
 //                                    const FunctionMap<1>::type &boundary_functions,
 //                                    Vector<double>         &rhs_vector,
-//                                    std::vector<unsigned int>&dof_to_boundary_mapping,
+//                                    std::vector<types::global_dof_index>&dof_to_boundary_mapping,
 //                                    const Function<1> * const a = 0);
 
   /**
@@ -447,7 +452,7 @@ namespace MatrixCreator
                                     SparseMatrix<double>     &matrix,
                                     const typename FunctionMap<spacedim>::type        &boundary_functions,
                                     Vector<double>           &rhs_vector,
-                                    std::vector<unsigned int> &dof_to_boundary_mapping,
+                                    std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                     const Function<spacedim> *const a = 0,
                                     std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
@@ -798,7 +803,7 @@ namespace MatrixTools
    */
   template <typename number>
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          SparseMatrix<number>  &matrix,
                          Vector<number>        &solution,
                          Vector<number>        &right_hand_side,
@@ -815,7 +820,7 @@ namespace MatrixTools
    */
   template <typename number>
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          BlockSparseMatrix<number>           &matrix,
                          BlockVector<number>                 &solution,
                          BlockVector<number>                 &right_hand_side,
@@ -860,7 +865,7 @@ namespace MatrixTools
    * step-18.
    */
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          PETScWrappers::SparseMatrix  &matrix,
                          PETScWrappers::Vector  &solution,
                          PETScWrappers::Vector  &right_hand_side,
@@ -871,7 +876,7 @@ namespace MatrixTools
    * matrices.
    */
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          PETScWrappers::MPI::SparseMatrix  &matrix,
                          PETScWrappers::MPI::Vector  &solution,
                          PETScWrappers::MPI::Vector  &right_hand_side,
@@ -903,7 +908,7 @@ namespace MatrixTools
    * to this function is the same.
    */
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          PETScWrappers::MPI::SparseMatrix  &matrix,
                          PETScWrappers::Vector       &solution,
                          PETScWrappers::MPI::Vector  &right_hand_side,
@@ -913,8 +918,8 @@ namespace MatrixTools
    * Same as above but for BlockSparseMatrix.
    */
   void
-  apply_boundary_values (const std::map<unsigned int,double>  &boundary_values,
-                         PETScWrappers::MPI::BlockSparseMatrix  &matrix,
+  apply_boundary_values (const std::map<types::global_dof_index,double>  &boundary_values,
+                         PETScWrappers::MPI::BlockSparseMatrix &matrix,
                          PETScWrappers::MPI::BlockVector        &solution,
                          PETScWrappers::MPI::BlockVector        &right_hand_side,
                          const bool       eliminate_columns = true);
@@ -961,7 +966,7 @@ namespace MatrixTools
    * across an MPI system.
    */
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          TrilinosWrappers::SparseMatrix  &matrix,
                          TrilinosWrappers::Vector        &solution,
                          TrilinosWrappers::Vector        &right_hand_side,
@@ -973,7 +978,7 @@ namespace MatrixTools
    * working on block structures.
    */
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          TrilinosWrappers::BlockSparseMatrix  &matrix,
                          TrilinosWrappers::BlockVector        &solution,
                          TrilinosWrappers::BlockVector        &right_hand_side,
@@ -1016,7 +1021,7 @@ namespace MatrixTools
    * types.
    */
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          TrilinosWrappers::SparseMatrix  &matrix,
                          TrilinosWrappers::MPI::Vector   &solution,
                          TrilinosWrappers::MPI::Vector   &right_hand_side,
@@ -1028,7 +1033,7 @@ namespace MatrixTools
    * on block structures.
    */
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          TrilinosWrappers::BlockSparseMatrix  &matrix,
                          TrilinosWrappers::MPI::BlockVector   &solution,
                          TrilinosWrappers::MPI::BlockVector   &right_hand_side,
@@ -1072,8 +1077,8 @@ namespace MatrixTools
    * documentation of this class.
    */
   void
-  local_apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
-                               const std::vector<unsigned int> &local_dof_indices,
+  local_apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
+                               const std::vector<types::global_dof_index> &local_dof_indices,
                                FullMatrix<double> &local_matrix,
                                Vector<double>     &local_rhs,
                                const bool          eliminate_columns);
index 0e7877caf16e8149fc1376131976881d0c5dfd3b..f13ad551750cb9c734bd9c8217ebb433d7519da8 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2012 by Michael Rapson and the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef __dealii__point_value_history_h
 #define __dealii__point_value_history_h
@@ -62,10 +67,10 @@ namespace internal
     {
     public:
       PointGeometryData(const Point <dim> &new_requested_location, const std::vector <Point <dim> > &new_locations,
-                        const std::vector <int> &new_sol_indices);
+                        const std::vector <types::global_dof_index> &new_sol_indices);
       Point <dim> requested_location;
       std::vector <Point <dim> > support_point_locations;
-      std::vector <int> solution_indices;
+      std::vector <types::global_dof_index> solution_indices;
     };
   }
 }
index 443d140306301a0188b559a840a8104ddefeb5e6..b37133426ab622ce98788f343c521dd6ab7dd155 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__solution_transfer_h
 #define __deal2__solution_transfer_h
 
@@ -377,7 +382,7 @@ private:
    * Stores the number of DoFs before the
    * refinement and/or coarsening.
    */
-  unsigned int n_dofs_old;
+  types::global_dof_index n_dofs_old;
 
   /**
    * Declaration of
@@ -408,7 +413,7 @@ private:
    * and stores all dof indices
    * of the cells that'll be refined
    */
-  std::vector<std::vector<unsigned int> > indices_on_cell;
+  std::vector<std::vector<types::global_dof_index> > indices_on_cell;
 
   /**
    * All cell data (the dof indices and
@@ -432,7 +437,7 @@ private:
   struct Pointerstruct
   {
     Pointerstruct() : indices_ptr(0), dof_values_ptr(0), active_fe_index(0) {};
-    Pointerstruct(std::vector<unsigned int> *indices_ptr_in,
+    Pointerstruct(std::vector<types::global_dof_index> *indices_ptr_in,
                   const unsigned int active_fe_index_in = 0)
       :
       indices_ptr(indices_ptr_in),
@@ -445,7 +450,7 @@ private:
       active_fe_index(active_fe_index_in) {};
     std::size_t memory_consumption () const;
 
-    std::vector<unsigned int>    *indices_ptr;
+    std::vector<types::global_dof_index>    *indices_ptr;
     std::vector<Vector<typename VECTOR::value_type> > *dof_values_ptr;
     unsigned int active_fe_index;
   };
index 5b34cc9ac12104c99024e2f0d0b5c925c9c55e52..190d0d4ca9bb1678ad766687266af3bd2ce9ee7f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__time_dependent_h
 #define __deal2__time_dependent_h
 
index 12fa9add4ed901953659034d90b7f9c7cad7475c..96fd9a1b7c7ddbac1a666e188cec8d4e5a06af3d 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #ifndef __deal2__vector_tools_h
 #define __deal2__vector_tools_h
 
@@ -653,7 +658,7 @@ namespace VectorTools
 
   /**
    * Calls the project()
-   * function, see above, with
+   * function above, with
    * <tt>mapping=MappingQ1@<dim@>()</tt>.
    */
   template <int dim, class VECTOR, int spacedim>
@@ -668,6 +673,40 @@ namespace VectorTools
                                                         Quadrature<dim-1>(0)),
                 const bool                project_to_boundary_first = false);
 
+  /**
+   * Same as above, but for arguments of type hp::DoFHandler,
+   * hp::QuadratureCollection, hp::MappingCollection
+   */
+  template <int dim, class VECTOR, int spacedim>
+  void project (const hp::MappingCollection<dim, spacedim>       &mapping,
+                const hp::DoFHandler<dim,spacedim>    &dof,
+                const ConstraintMatrix   &constraints,
+                const hp::QCollection<dim>    &quadrature,
+                const Function<spacedim>      &function,
+                VECTOR                   &vec,
+                const bool                enforce_zero_boundary = false,
+                const hp::QCollection<dim-1>  &q_boundary = hp::QCollection<dim-1>(dim > 1 ?
+                                                        QGauss<dim-1>(2) :
+                                                        Quadrature<dim-1>(0)),
+                const bool                project_to_boundary_first = false);
+
+  /**
+   * Calls the project()
+   * function above, with a collection of
+   * MappingQ1@<dim@>() objects.
+   */
+  template <int dim, class VECTOR, int spacedim>
+  void project (const hp::DoFHandler<dim,spacedim>    &dof,
+                const ConstraintMatrix   &constraints,
+                const hp::QCollection<dim>    &quadrature,
+                const Function<spacedim>      &function,
+                VECTOR                   &vec,
+                const bool                enforce_zero_boundary = false,
+                const hp::QCollection<dim-1>  &q_boundary = hp::QCollection<dim-1>(dim > 1 ?
+                                                        QGauss<dim-1>(2) :
+                                                        Quadrature<dim-1>(0)),
+                const bool                project_to_boundary_first = false);
+
   /**
    * Compute Dirichlet boundary
    * conditions.  This function makes up a map
@@ -758,7 +797,19 @@ namespace VectorTools
   interpolate_boundary_values (const Mapping<DH::dimension,DH::space_dimension>            &mapping,
                                const DH                 &dof,
                                const typename FunctionMap<DH::space_dimension>::type &function_map,
-                               std::map<unsigned int,double> &boundary_values,
+                               std::map<types::global_dof_index,double> &boundary_values,
+                               const ComponentMask       &component_mask = ComponentMask());
+
+  /**
+   * Like the previous function, but take a mapping collection to go with
+   * the hp::DoFHandler object.
+   */
+  template <int dim, int spacedim>
+  void
+  interpolate_boundary_values (const hp::MappingCollection<dim,spacedim>            &mapping,
+                               const hp::DoFHandler<dim,spacedim>                 &dof,
+                               const typename FunctionMap<spacedim>::type &function_map,
+                               std::map<types::global_dof_index,double> &boundary_values,
                                const ComponentMask       &component_mask = ComponentMask());
 
   /**
@@ -778,7 +829,7 @@ namespace VectorTools
                                const DH                 &dof,
                                const types::boundary_id            boundary_component,
                                const Function<DH::space_dimension>           &boundary_function,
-                               std::map<unsigned int,double> &boundary_values,
+                               std::map<types::global_dof_index,double> &boundary_values,
                                const ComponentMask       &component_mask = ComponentMask());
 
   /**
@@ -797,7 +848,7 @@ namespace VectorTools
   interpolate_boundary_values (const DH        &dof,
                                const types::boundary_id            boundary_component,
                                const Function<DH::space_dimension>           &boundary_function,
-                               std::map<unsigned int,double> &boundary_values,
+                               std::map<types::global_dof_index,double> &boundary_values,
                                const ComponentMask       &component_mask = ComponentMask());
 
 
@@ -814,7 +865,7 @@ namespace VectorTools
   void
   interpolate_boundary_values (const DH                &dof,
                                const typename FunctionMap<DH::space_dimension>::type &function_map,
-                               std::map<unsigned int,double>         &boundary_values,
+                               std::map<types::global_dof_index,double>         &boundary_values,
                                const ComponentMask               &component_mask = ComponentMask());
 
 
@@ -1033,7 +1084,7 @@ namespace VectorTools
                                 const DoFHandler<dim,spacedim>    &dof,
                                 const typename FunctionMap<spacedim>::type &boundary_functions,
                                 const Quadrature<dim-1>  &q,
-                                std::map<unsigned int,double> &boundary_values,
+                                std::map<types::global_dof_index,double> &boundary_values,
                                 std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
   /**
@@ -1045,7 +1096,30 @@ namespace VectorTools
   void project_boundary_values (const DoFHandler<dim,spacedim>    &dof,
                                 const typename FunctionMap<spacedim>::type &boundary_function,
                                 const Quadrature<dim-1>  &q,
-                                std::map<unsigned int,double> &boundary_values,
+                                std::map<types::global_dof_index,double> &boundary_values,
+                                std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
+
+  /**
+   * Same as above, but for objects of type hp::DoFHandler
+   */
+  template <int dim, int spacedim>
+  void project_boundary_values (const hp::MappingCollection<dim, spacedim>       &mapping,
+                                const hp::DoFHandler<dim,spacedim>    &dof,
+                                const typename FunctionMap<spacedim>::type &boundary_functions,
+                                const hp::QCollection<dim-1>  &q,
+                                std::map<types::global_dof_index,double> &boundary_values,
+                                std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
+
+  /**
+   * Calls the project_boundary_values()
+   * function, see above, with
+   * <tt>mapping=MappingQ1@<dim@>()</tt>.
+   */
+  template <int dim, int spacedim>
+  void project_boundary_values (const hp::DoFHandler<dim,spacedim>    &dof,
+                                const typename FunctionMap<spacedim>::type &boundary_function,
+                                const hp::QCollection<dim-1>  &q,
+                                std::map<types::global_dof_index,double> &boundary_values,
                                 std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
   /**
index e598adf066e7995f3c1d463dc6b3bcb0ad5f333a..a501795529cad3c48013046778d7c57813297ebf 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #ifndef _deal2__vector_tools_templates_h
 #define _deal2__vector_tools_templates_h
@@ -128,10 +133,10 @@ namespace VectorTools
     // the following vector collects all rep dofs.
     // the position of a rep dof within this vector
     // is called rep index.
-    std::vector<std::vector<unsigned int> > dofs_of_rep_points(fe.size());
+    std::vector<std::vector<types::global_dof_index> > dofs_of_rep_points(fe.size());
     // the following table converts a dof i
     // to the rep index.
-    std::vector<std::vector<unsigned int> > dof_to_rep_index_table(fe.size());
+    std::vector<std::vector<types::global_dof_index> > dof_to_rep_index_table(fe.size());
 
     std::vector<unsigned int> n_rep_points (fe.size(), 0);
 
@@ -173,7 +178,7 @@ namespace VectorTools
 
     const unsigned int max_rep_points = *std::max_element (n_rep_points.begin(),
                                                            n_rep_points.end());
-    std::vector<unsigned int> dofs_on_cell (fe.max_dofs_per_cell());
+    std::vector<types::global_dof_index> dofs_on_cell (fe.max_dofs_per_cell());
     std::vector<Point<DH::space_dimension> >  rep_points (max_rep_points);
 
     // get space for the values of the
@@ -287,8 +292,8 @@ namespace VectorTools
     Vector<double> cell_data_1(dof_1.get_fe().dofs_per_cell);
     Vector<double> cell_data_2(dof_2.get_fe().dofs_per_cell);
 
-    std::vector<short unsigned int> touch_count (dof_2.n_dofs(), 0);
-    std::vector<unsigned int>       local_dof_indices (dof_2.get_fe().dofs_per_cell);
+    std::vector<short unsigned int> touch_count (dof_2.n_dofs(), 0); //TODO: check on datatype... kinda strange (UK)
+    std::vector<types::global_dof_index>       local_dof_indices (dof_2.get_fe().dofs_per_cell);
 
     typename DoFHandler<dim,spacedim>::active_cell_iterator h = dof_1.begin_active();
     typename DoFHandler<dim,spacedim>::active_cell_iterator l = dof_2.begin_active();
@@ -329,57 +334,17 @@ namespace VectorTools
 
   namespace internal
   {
+    /**
+     * Interpolate zero boundary values. We don't need to worry about a mapping
+     * here because the function we evaluate for the DoFs is zero in the mapped
+     * locations as well as in the original, unmapped locations
+     */
+    template <class DH>
     void
-    interpolate_zero_boundary_values (const dealii::DoFHandler<1>   &dof_handler,
-                                      std::map<unsigned int,double> &boundary_values)
-    {
-      // we only need to find the
-      // left-most and right-most
-      // vertex and query its vertex
-      // dof indices. that's easy :-)
-      for (unsigned int direction=0; direction<2; ++direction)
-        {
-          dealii::DoFHandler<1>::cell_iterator
-          cell = dof_handler.begin(0);
-          while (!cell->at_boundary(direction))
-            cell = cell->neighbor(direction);
-
-          for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_vertex; ++i)
-            boundary_values[cell->vertex_dof_index (direction, i)] = 0.;
-        }
-    }
-
-
-
-    // codimension 1
-    void
-    interpolate_zero_boundary_values (const dealii::DoFHandler<1,2> &dof_handler,
-                                      std::map<unsigned int,double> &boundary_values)
-    {
-      // we only need to find the
-      // left-most and right-most
-      // vertex and query its vertex
-      // dof indices. that's easy :-)
-      for (unsigned int direction=0; direction<2; ++direction)
-        {
-          dealii::DoFHandler<1,2>::cell_iterator
-          cell = dof_handler.begin(0);
-          while (!cell->at_boundary(direction))
-            cell = cell->neighbor(direction);
-
-          for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_vertex; ++i)
-            boundary_values[cell->vertex_dof_index (direction, i)] = 0.;
-        }
-    }
-
-
-
-    template <int dim, int spacedim>
-    void
-    interpolate_zero_boundary_values (const dealii::DoFHandler<dim,spacedim>       &dof_handler,
-                                      std::map<unsigned int,double> &boundary_values)
+    interpolate_zero_boundary_values (const DH                                 &dof_handler,
+                                      std::map<types::global_dof_index,double> &boundary_values)
     {
-      const FiniteElement<dim,spacedim> &fe = dof_handler.get_fe();
+      const unsigned int dim      = DH::dimension;
 
       // loop over all boundary faces
       // to get all dof indices of
@@ -402,16 +367,18 @@ namespace VectorTools
       // that is actually wholly on
       // the boundary, not only by
       // one line or one vertex
-      typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator
+      typename DH::active_cell_iterator
       cell = dof_handler.begin_active(),
       endc = dof_handler.end();
-      std::vector<unsigned int> face_dof_indices (fe.dofs_per_face);
+      std::vector<types::global_dof_index> face_dof_indices;
       for (; cell!=endc; ++cell)
         for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
           if (cell->at_boundary(f))
             {
-              cell->face(f)->get_dof_indices (face_dof_indices);
-              for (unsigned int i=0; i<fe.dofs_per_face; ++i)
+              face_dof_indices.resize (cell->get_fe().dofs_per_face);
+              cell->face(f)->get_dof_indices (face_dof_indices,
+                                              cell->active_fe_index());
+              for (unsigned int i=0; i<cell->get_fe().dofs_per_face; ++i)
                 // enter zero boundary values
                 // for all boundary nodes
                 //
@@ -531,132 +498,185 @@ namespace VectorTools
   }
 
 
-
-  template <int dim, class VECTOR, int spacedim>
-  void project (const Mapping<dim, spacedim>   &mapping,
-                const DoFHandler<dim,spacedim> &dof,
-                const ConstraintMatrix   &constraints,
-                const Quadrature<dim>    &quadrature,
-                const Function<spacedim> &function,
-                VECTOR                   &vec_result,
-                const bool                enforce_zero_boundary,
-                const Quadrature<dim-1>  &q_boundary,
-                const bool                project_to_boundary_first)
+  namespace
   {
-    Assert (dof.get_fe().n_components() == function.n_components,
-            ExcDimensionMismatch(dof.get_fe().n_components(),
-                                 function.n_components));
-
-    Assert (vec_result.size() == dof.n_dofs(),
-            ExcDimensionMismatch (vec_result.size(), dof.n_dofs()));
-
-    // make up boundary values
-    std::map<unsigned int,double> boundary_values;
-
-    if (enforce_zero_boundary == true)
-      // no need to project boundary
-      // values, but enforce
-      // homogeneous boundary values
-      // anyway
-      internal::
-      interpolate_zero_boundary_values (dof, boundary_values);
-
-    else
-      // no homogeneous boundary values
-      if (project_to_boundary_first == true)
-        // boundary projection required
-        {
-          // set up a list of boundary
-          // functions for the
-          // different boundary
-          // parts. We want the
-          // function to hold on
-          // all parts of the boundary
-          typename FunctionMap<spacedim>::type boundary_functions;
-          for (types::boundary_id c=0; c<numbers::internal_face_boundary_id; ++c)
-            boundary_functions[c] = &function;
-          project_boundary_values (dof, boundary_functions, q_boundary,
-                                   boundary_values);
-        }
+    /**
+     * Compute the boundary values to be used in the project() functions.
+     */
+    template <int dim, int spacedim,
+              template <int,int> class DH,
+              template <int,int> class M_or_MC,
+              template <int> class Q_or_QC>
+    void project_compute_b_v (const M_or_MC<dim, spacedim>   &mapping,
+                  const DH<dim,spacedim> &dof,
+                  const Function<spacedim> &function,
+                  const bool                enforce_zero_boundary,
+                  const Q_or_QC<dim-1>  &q_boundary,
+                  const bool                project_to_boundary_first,
+                  std::map<types::global_dof_index,double> &boundary_values)
+    {
+      if (enforce_zero_boundary == true)
+        // no need to project boundary
+        // values, but enforce
+        // homogeneous boundary values
+        // anyway
+        internal::
+        interpolate_zero_boundary_values (dof, boundary_values);
+
+      else
+        // no homogeneous boundary values
+        if (project_to_boundary_first == true)
+          // boundary projection required
+          {
+            // set up a list of boundary
+            // functions for the
+            // different boundary
+            // parts. We want the
+            // function to hold on
+            // all parts of the boundary
+            const std::vector<types::boundary_id>
+            used_boundary_indicators = dof.get_tria().get_boundary_indicators();
+
+            typename FunctionMap<spacedim>::type boundary_functions;
+            for (unsigned int i=0; i<used_boundary_indicators.size(); ++i)
+              boundary_functions[used_boundary_indicators[i]] = &function;
+            project_boundary_values (mapping, dof, boundary_functions, q_boundary,
+                                     boundary_values);
+          }
+    }
 
-    // set up mass matrix and right hand side
-    Vector<double> vec (dof.n_dofs());
-    SparsityPattern sparsity;
 
-    // check if constraints are compatible (see below)
-    bool constraints_are_compatible = true;
+    /**
+     * Return whether the boundary values try to constrain a degree of
+     * freedom that is already constrained to something else
+     */
+    bool constraints_and_b_v_are_compatible (const ConstraintMatrix   &constraints,
+                                             std::map<types::global_dof_index,double> &boundary_values)
     {
-      for (std::map<unsigned int,double>::iterator it=boundary_values.begin();
+      for (std::map<types::global_dof_index,double>::iterator it=boundary_values.begin();
            it != boundary_values.end(); ++it)
         if (constraints.is_constrained(it->first))
+//TODO: This looks wrong -- shouldn't it be ==0 in the first condition and && ?
           if (!(constraints.get_constraint_entries(it->first)->size() > 0
                 ||
                 (constraints.get_inhomogeneity(it->first) == it->second)))
-            {
-              constraints_are_compatible = false;
-              break;
-            }
-    }
-
-    // use csp to consume less memory and to
-    // still be fast
-    {
-      CompressedSimpleSparsityPattern csp (dof.n_dofs(), dof.n_dofs());
-      DoFTools::make_sparsity_pattern (dof, csp, constraints,
-                                       !constraints_are_compatible);
+            return false;
 
-      sparsity.copy_from (csp);
+      return true;
     }
 
-    SparseMatrix<double> mass_matrix (sparsity);
-    Vector<double> tmp (mass_matrix.n());
 
-    // If the constraint matrix does not conflict with the given boundary
-    // values (i.e., it either does not contain boundary values or it contains
-    // the same as boundary_values), we can let it call
-    // distribute_local_to_global straight away, otherwise we need to first
-    // interpolate the boundary values and then condense the matrix and vector
-    if (constraints_are_compatible)
+    /**
+     * Generic implementation of the project() function
+     */
+    template <int dim, int spacedim,
+              class Vector,
+              template <int,int> class DH,
+              template <int,int> class M_or_MC,
+              template <int> class Q_or_QC>
+    void do_project (const M_or_MC<dim, spacedim>   &mapping,
+                  const DH<dim,spacedim> &dof,
+                  const ConstraintMatrix   &constraints,
+                  const Q_or_QC<dim>       &quadrature,
+                  const Function<spacedim> &function,
+                  Vector                   &vec_result,
+                  const bool                enforce_zero_boundary,
+                  const Q_or_QC<dim-1>  &q_boundary,
+                  const bool                project_to_boundary_first)
+    {
+      Assert (dof.get_fe().n_components() == function.n_components,
+              ExcDimensionMismatch(dof.get_fe().n_components(),
+                                   function.n_components));
+      Assert (vec_result.size() == dof.n_dofs(),
+              ExcDimensionMismatch (vec_result.size(), dof.n_dofs()));
+
+      // make up boundary values
+      std::map<types::global_dof_index,double> boundary_values;
+      project_compute_b_v(mapping, dof, function, enforce_zero_boundary,
+                          q_boundary, project_to_boundary_first, boundary_values);
+
+      // check if constraints are compatible (see below)
+      const bool constraints_are_compatible =
+        constraints_and_b_v_are_compatible(constraints, boundary_values);
+
+      // set up mass matrix and right hand side
+      dealii::Vector<double> vec (dof.n_dofs());
+      SparsityPattern sparsity;
       {
-        const Function<spacedim>* dummy = 0;
-        MatrixCreator::create_mass_matrix (mapping, dof, quadrature,
-                                           mass_matrix, function, tmp,
-                                           dummy, constraints);
-        if (boundary_values.size() > 0)
+        CompressedSimpleSparsityPattern csp (dof.n_dofs(), dof.n_dofs());
+        DoFTools::make_sparsity_pattern (dof, csp, constraints,
+                                         !constraints_are_compatible);
+
+        sparsity.copy_from (csp);
+      }
+      SparseMatrix<double> mass_matrix (sparsity);
+      dealii::Vector<double> tmp (mass_matrix.n());
+
+      // If the constraint matrix does not conflict with the given boundary
+      // values (i.e., it either does not contain boundary values or it contains
+      // the same as boundary_values), we can let it call
+      // distribute_local_to_global straight away, otherwise we need to first
+      // interpolate the boundary values and then condense the matrix and vector
+      if (constraints_are_compatible)
+        {
+          const Function<spacedim> *dummy = 0;
+          MatrixCreator::create_mass_matrix (mapping, dof, quadrature,
+                                             mass_matrix, function, tmp,
+                                             dummy, constraints);
+          if (boundary_values.size() > 0)
+            MatrixTools::apply_boundary_values (boundary_values,
+                                                mass_matrix, vec, tmp,
+                                                true);
+        }
+      else
+        {
+          // create mass matrix and rhs at once, which is faster.
+          MatrixCreator::create_mass_matrix (mapping, dof, quadrature,
+                                             mass_matrix, function, tmp);
           MatrixTools::apply_boundary_values (boundary_values,
                                               mass_matrix, vec, tmp,
                                               true);
-      }
-    else
-      {
-        // create mass matrix and rhs at once, which is faster.
-        MatrixCreator::create_mass_matrix (mapping, dof, quadrature,
-                                           mass_matrix, function, tmp);
-        MatrixTools::apply_boundary_values (boundary_values,
-                                            mass_matrix, vec, tmp,
-                                            true);
-        constraints.condense(mass_matrix, tmp);
-      }
+          constraints.condense(mass_matrix, tmp);
+        }
 
-    // Allow for a maximum of 5*n steps to reduce the residual by 10^-12. n
-    // steps may not be sufficient, since roundoff errors may accumulate for
-    // badly conditioned matrices
-    ReductionControl      control(5*tmp.size(), 0., 1e-12, false, false);
-    GrowingVectorMemory<> memory;
-    SolverCG<>            cg(control,memory);
+      // Allow for a maximum of 5*n steps to reduce the residual by 10^-12. n
+      // steps may not be sufficient, since roundoff errors may accumulate for
+      // badly conditioned matrices
+      ReductionControl      control(5*tmp.size(), 0., 1e-12, false, false);
+      GrowingVectorMemory<> memory;
+      SolverCG<>            cg(control,memory);
 
-    PreconditionSSOR<> prec;
-    prec.initialize(mass_matrix, 1.2);
+      PreconditionSSOR<> prec;
+      prec.initialize(mass_matrix, 1.2);
 
-    cg.solve (mass_matrix, vec, tmp, prec);
+      cg.solve (mass_matrix, vec, tmp, prec);
 
-    constraints.distribute (vec);
+      constraints.distribute (vec);
 
-    // copy vec into vec_result. we can't use vec_result itself above, since
-    // it may be of another type than Vector<double> and that wouldn't
-    // necessarily go together with the matrix and other functions
-    for (unsigned int i=0; i<vec.size(); ++i)
-      vec_result(i) = vec(i);
+      // copy vec into vec_result. we can't use vec_result itself above, since
+      // it may be of another type than Vector<double> and that wouldn't
+      // necessarily go together with the matrix and other functions
+      for (unsigned int i=0; i<vec.size(); ++i)
+        vec_result(i) = vec(i);
+    }
+  }
+
+
+  template <int dim, class VECTOR, int spacedim>
+  void project (const Mapping<dim, spacedim>   &mapping,
+                const DoFHandler<dim,spacedim> &dof,
+                const ConstraintMatrix   &constraints,
+                const Quadrature<dim>    &quadrature,
+                const Function<spacedim> &function,
+                VECTOR                   &vec_result,
+                const bool                enforce_zero_boundary,
+                const Quadrature<dim-1>  &q_boundary,
+                const bool                project_to_boundary_first)
+  {
+    do_project (mapping, dof, constraints, quadrature,
+        function, vec_result,
+        enforce_zero_boundary, q_boundary,
+        project_to_boundary_first);
   }
 
 
@@ -676,6 +696,39 @@ namespace VectorTools
 
 
 
+  template <int dim, class VECTOR, int spacedim>
+  void project (const hp::MappingCollection<dim, spacedim>   &mapping,
+                const hp::DoFHandler<dim,spacedim> &dof,
+                const ConstraintMatrix   &constraints,
+                const hp::QCollection<dim>    &quadrature,
+                const Function<spacedim> &function,
+                VECTOR                   &vec_result,
+                const bool                enforce_zero_boundary,
+                const hp::QCollection<dim-1>  &q_boundary,
+                const bool                project_to_boundary_first)
+  {
+    do_project (mapping, dof, constraints, quadrature,
+        function, vec_result,
+        enforce_zero_boundary, q_boundary,
+        project_to_boundary_first);
+  }
+
+
+  template <int dim, class VECTOR, int spacedim>
+  void project (const hp::DoFHandler<dim,spacedim> &dof,
+                const ConstraintMatrix   &constraints,
+                const hp::QCollection<dim>    &quadrature,
+                const Function<spacedim> &function,
+                VECTOR                   &vec,
+                const bool                enforce_zero_boundary,
+                const hp::QCollection<dim-1>  &q_boundary,
+                const bool                project_to_boundary_first)
+  {
+    project(hp::StaticMappingQ1<dim,spacedim>::mapping_collection,
+            dof, constraints, quadrature, function, vec,
+            enforce_zero_boundary, q_boundary, project_to_boundary_first);
+  }
+
 
   template <int dim, int spacedim>
   void create_right_hand_side (const Mapping<dim, spacedim>    &mapping,
@@ -700,7 +753,7 @@ namespace VectorTools
                        n_q_points    = fe_values.n_quadrature_points,
                        n_components  = fe.n_components();
 
-    std::vector<unsigned int> dofs (dofs_per_cell);
+    std::vector<types::global_dof_index> dofs (dofs_per_cell);
     Vector<double> cell_vector (dofs_per_cell);
 
     typename DoFHandler<dim,spacedim>::active_cell_iterator
@@ -822,7 +875,7 @@ namespace VectorTools
 
     const unsigned int n_components  = fe.n_components();
 
-    std::vector<unsigned int> dofs (fe.max_dofs_per_cell());
+    std::vector<types::global_dof_index> dofs (fe.max_dofs_per_cell());
     Vector<double> cell_vector (fe.max_dofs_per_cell());
 
     typename hp::DoFHandler<dim,spacedim>::active_cell_iterator
@@ -965,7 +1018,7 @@ namespace VectorTools
 
     const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     cell_point.first->get_dof_indices (local_dof_indices);
 
     for (unsigned int i=0; i<dofs_per_cell; i++)
@@ -1009,7 +1062,7 @@ namespace VectorTools
 
     const unsigned int dofs_per_cell = cell_point.first->get_fe().dofs_per_cell;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     cell_point.first->get_dof_indices (local_dof_indices);
 
     for (unsigned int i=0; i<dofs_per_cell; i++)
@@ -1058,7 +1111,7 @@ namespace VectorTools
 
     const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     cell_point.first->get_dof_indices (local_dof_indices);
 
     for (unsigned int i=0; i<dofs_per_cell; i++)
@@ -1105,7 +1158,7 @@ namespace VectorTools
 
     const unsigned int dofs_per_cell = cell_point.first->get_fe().dofs_per_cell;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     cell_point.first->get_dof_indices (local_dof_indices);
 
     for (unsigned int i=0; i<dofs_per_cell; i++)
@@ -1183,7 +1236,7 @@ namespace VectorTools
                        n_q_points    = fe_values.n_quadrature_points,
                        n_components  = fe.n_components();
 
-    std::vector<unsigned int> dofs (dofs_per_cell);
+    std::vector<types::global_dof_index> dofs (dofs_per_cell);
     Vector<double> cell_vector (dofs_per_cell);
 
     typename DoFHandler<dim,spacedim>::active_cell_iterator cell = dof_handler.begin_active(),
@@ -1350,7 +1403,7 @@ namespace VectorTools
 
     const unsigned int n_components  = fe.n_components();
 
-    std::vector<unsigned int> dofs (fe.max_dofs_per_cell());
+    std::vector<types::global_dof_index> dofs (fe.max_dofs_per_cell());
     Vector<double> cell_vector (fe.max_dofs_per_cell());
 
     typename hp::DoFHandler<dim,spacedim>::active_cell_iterator
@@ -1479,7 +1532,7 @@ namespace VectorTools
 
 // ----------- interpolate_boundary_values for std::map --------------------
 
-  namespace internal
+  namespace
   {
     // interpolate boundary values in
     // 1d. in higher dimensions, we
@@ -1488,12 +1541,13 @@ namespace VectorTools
     // faces are points and it is far
     // easier to simply work on
     // individual vertices
-    template <class DH>
+    template <class DH,
+              template <int,int> class M_or_MC>
     static inline
-    void interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &,
+    void do_interpolate_boundary_values (const M_or_MC<DH::dimension, DH::space_dimension> &,
                                       const DH                 &dof,
                                       const typename FunctionMap<DH::space_dimension>::type &function_map,
-                                      std::map<unsigned int,double> &boundary_values,
+                                      std::map<types::global_dof_index,double> &boundary_values,
                                       const ComponentMask       &component_mask,
                                       const dealii::internal::int2type<1>)
     {
@@ -1566,13 +1620,14 @@ namespace VectorTools
 
 
 
-    template <class DH>
+    template <class DH,
+              template <int,int> class M_or_MC>
     static inline
     void
-    interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &mapping,
+    do_interpolate_boundary_values (const M_or_MC<DH::dimension, DH::space_dimension> &mapping,
                                  const DH                 &dof,
                                  const typename FunctionMap<DH::space_dimension>::type &function_map,
-                                 std::map<unsigned int,double> &boundary_values,
+                                 std::map<types::global_dof_index,double> &boundary_values,
                                  const ComponentMask       &component_mask,
                                  const dealii::internal::int2type<DH::dimension>)
     {
@@ -1603,7 +1658,7 @@ namespace VectorTools
                 ExcDimensionMismatch(n_components, i->second->n_components));
 
       // field to store the indices
-      std::vector<unsigned int> face_dofs;
+      std::vector<types::global_dof_index> face_dofs;
       face_dofs.reserve (DoFTools::max_dofs_per_face(dof));
 
       std::vector<Point<spacedim> >  dof_locations;
@@ -1917,11 +1972,10 @@ namespace VectorTools
   interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension>            &mapping,
                                const DH                 &dof,
                                const typename FunctionMap<DH::space_dimension>::type &function_map,
-                               std::map<unsigned int,double> &boundary_values,
+                               std::map<types::global_dof_index,double> &boundary_values,
                                const ComponentMask       &component_mask_)
   {
-    internal::
-    interpolate_boundary_values (mapping, dof, function_map, boundary_values,
+    do_interpolate_boundary_values (mapping, dof, function_map, boundary_values,
                                  component_mask_,
                                  dealii::internal::int2type<DH::dimension>());
   }
@@ -1934,7 +1988,7 @@ namespace VectorTools
                                const DH                 &dof,
                                const types::boundary_id            boundary_component,
                                const Function<DH::space_dimension>           &boundary_function,
-                               std::map<unsigned int,double> &boundary_values,
+                               std::map<types::global_dof_index,double> &boundary_values,
                                const ComponentMask       &component_mask)
   {
     typename FunctionMap<DH::space_dimension>::type function_map;
@@ -1944,13 +1998,27 @@ namespace VectorTools
   }
 
 
+  template <int dim, int spacedim>
+  void
+  interpolate_boundary_values (const hp::MappingCollection<dim,spacedim>            &mapping,
+                               const hp::DoFHandler<dim,spacedim>                 &dof,
+                               const typename FunctionMap<spacedim>::type &function_map,
+                               std::map<types::global_dof_index,double> &boundary_values,
+                               const ComponentMask       &component_mask_)
+  {
+    do_interpolate_boundary_values (mapping, dof, function_map, boundary_values,
+                                 component_mask_,
+                                 dealii::internal::int2type<dim>());
+  }
+
+
 
   template <class DH>
   void
   interpolate_boundary_values (const DH                 &dof,
                                const types::boundary_id            boundary_component,
                                const Function<DH::space_dimension>           &boundary_function,
-                               std::map<unsigned int,double> &boundary_values,
+                               std::map<types::global_dof_index,double> &boundary_values,
                                const ComponentMask       &component_mask)
   {
     interpolate_boundary_values(StaticMappingQ1<DH::dimension,DH::space_dimension>::mapping,
@@ -1964,7 +2032,7 @@ namespace VectorTools
   void
   interpolate_boundary_values (const DH                 &dof,
                                const typename FunctionMap<DH::space_dimension>::type &function_map,
-                               std::map<unsigned int,double> &boundary_values,
+                               std::map<types::global_dof_index,double> &boundary_values,
                                const ComponentMask       &component_mask)
   {
     interpolate_boundary_values(StaticMappingQ1<DH::dimension,DH::space_dimension>::mapping,
@@ -1988,10 +2056,10 @@ namespace VectorTools
    ConstraintMatrix                                      &constraints,
    const ComponentMask                               &component_mask_)
   {
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     interpolate_boundary_values (mapping, dof, function_map,
                                  boundary_values, component_mask_);
-    std::map<unsigned int,double>::const_iterator boundary_value =
+    std::map<types::global_dof_index,double>::const_iterator boundary_value =
       boundary_values.begin();
     for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
       {
@@ -2060,211 +2128,201 @@ namespace VectorTools
 
 // -------- implementation for project_boundary_values with std::map --------
 
-// separate implementations for 1D because otherwise we get linking errors
-// because create_boundary_mass_matrix is not compiled for 1D
-  template <>
-  void
-  project_boundary_values (const Mapping<1,1>         &mapping,
-                           const DoFHandler<1,1>      &dof,
-                           const FunctionMap<1>::type &boundary_functions,
-                           const Quadrature<0> &,
-                           std::map<unsigned int,double> &boundary_values,
-                           std::vector<unsigned int>   component_mapping)
-  {
-    Assert (component_mapping.size() == 0, ExcNotImplemented());
-    // projection in 1d is equivalent
-    // to interpolation
-    interpolate_boundary_values (mapping, dof, boundary_functions,
-                                 boundary_values, ComponentMask());
-  }
-
-
 
-  template <>
-  void
-  project_boundary_values (const Mapping<1,2>         &mapping,
-                           const DoFHandler<1,2>      &dof,
-                           const FunctionMap<2>::type &boundary_functions,
-                           const Quadrature<0> &,
-                           std::map<unsigned int,double> &boundary_values,
-                           std::vector<unsigned int>   component_mapping)
+  namespace
   {
-    Assert (component_mapping.size() == 0, ExcNotImplemented());
-    // projection in 1d is equivalent
-    // to interpolation
-    interpolate_boundary_values (mapping, dof, boundary_functions,
-                                 boundary_values, ComponentMask());
-  }
+    template <int dim, int spacedim,
+              template <int,int> class DH,
+              template <int,int> class M_or_MC,
+              template <int> class Q_or_QC>
+    void
+    do_project_boundary_values (const M_or_MC<dim, spacedim>   &mapping,
+                             const DH<dim, spacedim> &dof,
+                             const typename FunctionMap<spacedim>::type &boundary_functions,
+                             const Q_or_QC<dim-1>        &q,
+                             std::map<types::global_dof_index,double>  &boundary_values,
+                             std::vector<unsigned int>       component_mapping)
+    {
+      // in 1d, projection onto the 0d end points == interpolation
+      if (dim == 1)
+        {
+          Assert (component_mapping.size() == 0, ExcNotImplemented());
+          interpolate_boundary_values (mapping, dof, boundary_functions,
+                                       boundary_values, ComponentMask());
+          return;
+        }
 
+  //TODO:[?] In project_boundary_values, no condensation of sparsity
+  //    structures, matrices and right hand sides or distribution of
+  //    solution vectors is performed. This is ok for dim<3 because then
+  //    there are no constrained nodes on the boundary, but is not
+  //    acceptable for higher dimensions. Fix this.
 
+      if (component_mapping.size() == 0)
+        {
+          AssertDimension (dof.get_fe().n_components(), boundary_functions.begin()->second->n_components);
+          // I still do not see why i
+          // should create another copy
+          // here
+          component_mapping.resize(dof.get_fe().n_components());
+          for (unsigned int i= 0 ; i < component_mapping.size() ; ++i)
+            component_mapping[i] = i;
+        }
+      else
+        AssertDimension (dof.get_fe().n_components(), component_mapping.size());
 
+      std::vector<types::global_dof_index> dof_to_boundary_mapping;
+      std::set<types::boundary_id> selected_boundary_components;
+      for (typename FunctionMap<spacedim>::type::const_iterator i=boundary_functions.begin();
+           i!=boundary_functions.end(); ++i)
+        selected_boundary_components.insert (i->first);
 
-  template <int dim, int spacedim>
-  void
-  project_boundary_values (const Mapping<dim, spacedim>   &mapping,
-                           const DoFHandler<dim, spacedim> &dof,
-                           const typename FunctionMap<spacedim>::type &boundary_functions,
-                           const Quadrature<dim-1>        &q,
-                           std::map<unsigned int,double>  &boundary_values,
-                           std::vector<unsigned int>       component_mapping)
-  {
-//TODO:[?] In project_boundary_values, no condensation of sparsity
-//    structures, matrices and right hand sides or distribution of
-//    solution vectors is performed. This is ok for dim<3 because then
-//    there are no constrained nodes on the boundary, but is not
-//    acceptable for higher dimensions. Fix this.
+      DoFTools::map_dof_to_boundary_indices (dof, selected_boundary_components,
+                                             dof_to_boundary_mapping);
 
-    if (component_mapping.size() == 0)
-      {
-        AssertDimension (dof.get_fe().n_components(), boundary_functions.begin()->second->n_components);
-        // I still do not see why i
-        // should create another copy
-        // here
-        component_mapping.resize(dof.get_fe().n_components());
-        for (unsigned int i= 0 ; i < component_mapping.size() ; ++i)
-          component_mapping[i] = i;
-      }
-    else
-      AssertDimension (dof.get_fe().n_components(), component_mapping.size());
-
-    std::vector<unsigned int> dof_to_boundary_mapping;
-    std::set<types::boundary_id> selected_boundary_components;
-    for (typename FunctionMap<spacedim>::type::const_iterator i=boundary_functions.begin();
-         i!=boundary_functions.end(); ++i)
-      selected_boundary_components.insert (i->first);
-
-    DoFTools::map_dof_to_boundary_indices (dof, selected_boundary_components,
-                                           dof_to_boundary_mapping);
-
-    // Done if no degrees of freedom on the boundary
-    if (dof.n_boundary_dofs (boundary_functions) == 0)
-      return;
-
-    // set up sparsity structure
-    CompressedSparsityPattern c_sparsity(dof.n_boundary_dofs (boundary_functions),
-                                         dof.n_boundary_dofs (boundary_functions));
-    DoFTools::make_boundary_sparsity_pattern (dof,
-                                              boundary_functions,
-                                              dof_to_boundary_mapping,
-                                              c_sparsity);
-    SparsityPattern sparsity;
-    sparsity.copy_from(c_sparsity);
-
-
-
-    // note: for three or more dimensions, there
-    // may be constrained nodes on the boundary
-    // in this case the boundary mass matrix has
-    // to be condensed and the solution is to
-    // be distributed afterwards, which is not
-    // yet implemented. The reason for this is
-    // that we cannot simply use the condense
-    // family of functions, since the matrices
-    // and vectors do not use the global
-    // numbering but rather the boundary
-    // numbering, i.e. the condense function
-    // needs to use another indirection. There
-    // should be not many technical problems,
-    // but it needs to be implemented
-    if (dim>=3)
-      {
-#ifdef DEBUG
-// Assert that there are no hanging nodes at the boundary
-        int level = -1;
-        for (typename DoFHandler<dim,spacedim>::active_cell_iterator cell = dof.begin_active();
-             cell != dof.end(); ++cell)
-          for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-            {
-              if (cell->at_boundary(f))
-                {
-                  if (level == -1)
-                    level = cell->level();
-                  else
-                    {
-                      Assert (level == cell->level(), ExcNotImplemented());
-                    }
-                }
-            }
-#endif
-      }
-    sparsity.compress();
+      // Done if no degrees of freedom on the boundary
+      if (dof.n_boundary_dofs (boundary_functions) == 0)
+        return;
 
+      // set up sparsity structure
+      CompressedSparsityPattern c_sparsity(dof.n_boundary_dofs (boundary_functions),
+                                           dof.n_boundary_dofs (boundary_functions));
+      DoFTools::make_boundary_sparsity_pattern (dof,
+                                                boundary_functions,
+                                                dof_to_boundary_mapping,
+                                                c_sparsity);
+      SparsityPattern sparsity;
+      sparsity.copy_from(c_sparsity);
+
+
+
+      // note: for three or more dimensions, there
+      // may be constrained nodes on the boundary
+      // in this case the boundary mass matrix has
+      // to be condensed and the solution is to
+      // be distributed afterwards, which is not
+      // yet implemented. The reason for this is
+      // that we cannot simply use the condense
+      // family of functions, since the matrices
+      // and vectors do not use the global
+      // numbering but rather the boundary
+      // numbering, i.e. the condense function
+      // needs to use another indirection. There
+      // should be not many technical problems,
+      // but it needs to be implemented
+      if (dim>=3)
+        {
+  #ifdef DEBUG
+  // Assert that there are no hanging nodes at the boundary
+          int level = -1;
+          for (typename DH<dim,spacedim>::active_cell_iterator cell = dof.begin_active();
+               cell != dof.end(); ++cell)
+            for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+              {
+                if (cell->at_boundary(f))
+                  {
+                    if (level == -1)
+                      level = cell->level();
+                    else
+                      {
+                        Assert (level == cell->level(), ExcNotImplemented());
+                      }
+                  }
+              }
+  #endif
+        }
+      sparsity.compress();
 
-    // make mass matrix and right hand side
-    SparseMatrix<double> mass_matrix(sparsity);
-    Vector<double>       rhs(sparsity.n_rows());
 
+      // make mass matrix and right hand side
+      SparseMatrix<double> mass_matrix(sparsity);
+      Vector<double>       rhs(sparsity.n_rows());
 
-    MatrixCreator::create_boundary_mass_matrix (mapping, dof, q,
-                                                mass_matrix, boundary_functions,
-                                                rhs, dof_to_boundary_mapping, (const Function<spacedim> *) 0,
-                                                component_mapping);
 
-    // For certain weird elements,
-    // there might be degrees of
-    // freedom on the boundary, but
-    // their shape functions do not
-    // have support there. Let's
-    // eliminate them here.
+      MatrixCreator::create_boundary_mass_matrix (mapping, dof, q,
+                                                  mass_matrix, boundary_functions,
+                                                  rhs, dof_to_boundary_mapping, (const Function<spacedim> *) 0,
+                                                  component_mapping);
 
-    // The Bogner-Fox-Schmidt element
-    // is an example for those.
+      // For certain weird elements,
+      // there might be degrees of
+      // freedom on the boundary, but
+      // their shape functions do not
+      // have support there. Let's
+      // eliminate them here.
+
+      // The Bogner-Fox-Schmidt element
+      // is an example for those.
 
 //TODO: Maybe we should figure out if the element really needs this
 
-    FilteredMatrix<Vector<double> > filtered_mass_matrix(mass_matrix, true);
-    FilteredMatrix<Vector<double> > filtered_precondition;
-    std::vector<bool> excluded_dofs(mass_matrix.m(), false);
+      FilteredMatrix<Vector<double> > filtered_mass_matrix(mass_matrix, true);
+      FilteredMatrix<Vector<double> > filtered_precondition;
+      std::vector<bool> excluded_dofs(mass_matrix.m(), false);
 
-    double max_element = 0.;
-    for (unsigned int i=0; i<mass_matrix.m(); ++i)
-      if (mass_matrix.diag_element(i) > max_element)
-        max_element = mass_matrix.diag_element(i);
+      double max_element = 0.;
+      for (unsigned int i=0; i<mass_matrix.m(); ++i)
+        if (mass_matrix.diag_element(i) > max_element)
+          max_element = mass_matrix.diag_element(i);
 
-    for (unsigned int i=0; i<mass_matrix.m(); ++i)
-      if (mass_matrix.diag_element(i) < 1.e-8 * max_element)
-        {
-          filtered_mass_matrix.add_constraint(i, 0.);
-          filtered_precondition.add_constraint(i, 0.);
-          mass_matrix.diag_element(i) = 1.;
-          excluded_dofs[i] = true;
-        }
+      for (unsigned int i=0; i<mass_matrix.m(); ++i)
+        if (mass_matrix.diag_element(i) < 1.e-8 * max_element)
+          {
+            filtered_mass_matrix.add_constraint(i, 0.);
+            filtered_precondition.add_constraint(i, 0.);
+            mass_matrix.diag_element(i) = 1.;
+            excluded_dofs[i] = true;
+          }
 
-    Vector<double> boundary_projection (rhs.size());
-
-    // Allow for a maximum of 5*n
-    // steps to reduce the residual by
-    // 10^-12. n steps may not be
-    // sufficient, since roundoff
-    // errors may accumulate for badly
-    // conditioned matrices
-    ReductionControl        control(5*rhs.size(), 0., 1.e-12, false, false);
-    GrowingVectorMemory<> memory;
-    SolverCG<>              cg(control,memory);
-
-    PreconditionSSOR<> prec;
-    prec.initialize(mass_matrix, 1.2);
-    filtered_precondition.initialize(prec, true);
-    // solve
-    cg.solve (filtered_mass_matrix, boundary_projection, rhs, filtered_precondition);
-    filtered_precondition.apply_constraints(boundary_projection, true);
-    filtered_precondition.clear();
-    // fill in boundary values
-    for (unsigned int i=0; i<dof_to_boundary_mapping.size(); ++i)
-      if (dof_to_boundary_mapping[i] != DoFHandler<dim,spacedim>::invalid_dof_index
-          && ! excluded_dofs[dof_to_boundary_mapping[i]])
-        {
-          Assert(numbers::is_finite(boundary_projection(dof_to_boundary_mapping[i])), ExcNumberNotFinite());
+      Vector<double> boundary_projection (rhs.size());
+
+      // Allow for a maximum of 5*n
+      // steps to reduce the residual by
+      // 10^-12. n steps may not be
+      // sufficient, since roundoff
+      // errors may accumulate for badly
+      // conditioned matrices
+      ReductionControl        control(5*rhs.size(), 0., 1.e-12, false, false);
+      GrowingVectorMemory<> memory;
+      SolverCG<>              cg(control,memory);
+
+      PreconditionSSOR<> prec;
+      prec.initialize(mass_matrix, 1.2);
+      filtered_precondition.initialize(prec, true);
+      // solve
+      cg.solve (filtered_mass_matrix, boundary_projection, rhs, filtered_precondition);
+      filtered_precondition.apply_constraints(boundary_projection, true);
+      filtered_precondition.clear();
+      // fill in boundary values
+      for (unsigned int i=0; i<dof_to_boundary_mapping.size(); ++i)
+        if (dof_to_boundary_mapping[i] != DoFHandler<dim,spacedim>::invalid_dof_index
+            && ! excluded_dofs[dof_to_boundary_mapping[i]])
+          {
+            Assert(numbers::is_finite(boundary_projection(dof_to_boundary_mapping[i])), ExcNumberNotFinite());
 
-          // this dof is on one of the
-          // interesting boundary parts
-          //
-          // remember: i is the global dof
-          // number, dof_to_boundary_mapping[i]
-          // is the number on the boundary and
-          // thus in the solution vector
-          boundary_values[i] = boundary_projection(dof_to_boundary_mapping[i]);
-        }
+            // this dof is on one of the
+            // interesting boundary parts
+            //
+            // remember: i is the global dof
+            // number, dof_to_boundary_mapping[i]
+            // is the number on the boundary and
+            // thus in the solution vector
+            boundary_values[i] = boundary_projection(dof_to_boundary_mapping[i]);
+          }
+    }
+  }
+
+  template <int dim, int spacedim>
+  void
+  project_boundary_values (const Mapping<dim, spacedim>   &mapping,
+                           const DoFHandler<dim, spacedim> &dof,
+                           const typename FunctionMap<spacedim>::type &boundary_functions,
+                           const Quadrature<dim-1>        &q,
+                           std::map<types::global_dof_index,double>  &boundary_values,
+                           std::vector<unsigned int>       component_mapping)
+  {
+    do_project_boundary_values(mapping, dof, boundary_functions, q,
+                               boundary_values, component_mapping);
   }
 
 
@@ -2274,7 +2332,7 @@ namespace VectorTools
   project_boundary_values (const DoFHandler<dim,spacedim>    &dof,
                            const typename FunctionMap<spacedim>::type &boundary_functions,
                            const Quadrature<dim-1>  &q,
-                           std::map<unsigned int,double> &boundary_values,
+                           std::map<types::global_dof_index,double> &boundary_values,
                            std::vector<unsigned int> component_mapping)
   {
     project_boundary_values(StaticMappingQ1<dim,spacedim>::mapping, dof, boundary_functions, q,
@@ -2283,7 +2341,37 @@ namespace VectorTools
 
 
 
-// ----- implementation for project_boundary_values with ConstraintMatrix -----
+  template <int dim, int spacedim>
+  void project_boundary_values (const hp::MappingCollection<dim, spacedim>       &mapping,
+                                const hp::DoFHandler<dim,spacedim>    &dof,
+                                const typename FunctionMap<spacedim>::type &boundary_functions,
+                                const hp::QCollection<dim-1>  &q,
+                                std::map<types::global_dof_index,double> &boundary_values,
+                                std::vector<unsigned int> component_mapping)
+  {
+    do_project_boundary_values (mapping, dof,
+        boundary_functions,
+        q, boundary_values,
+        component_mapping);
+  }
+
+
+
+  template <int dim, int spacedim>
+  void project_boundary_values (const hp::DoFHandler<dim,spacedim>    &dof,
+                                const typename FunctionMap<spacedim>::type &boundary_function,
+                                const hp::QCollection<dim-1>  &q,
+                                std::map<types::global_dof_index,double> &boundary_values,
+                                std::vector<unsigned int> component_mapping)
+  {
+    project_boundary_values (hp::StaticMappingQ1<dim,spacedim>::mapping_collection, dof,
+        boundary_function,
+        q, boundary_values,
+        component_mapping);
+  }
+
+
+  // ----- implementation for project_boundary_values with ConstraintMatrix -----
 
 
 
@@ -2296,10 +2384,10 @@ namespace VectorTools
                            ConstraintMatrix &constraints,
                            std::vector<unsigned int> component_mapping)
   {
-    std::map<unsigned int,double> boundary_values;
+    std::map<types::global_dof_index,double> boundary_values;
     project_boundary_values (mapping, dof, boundary_functions, q,
                              boundary_values, component_mapping);
-    std::map<unsigned int,double>::const_iterator boundary_value =
+    std::map<types::global_dof_index,double>::const_iterator boundary_value =
       boundary_values.begin();
     for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
       {
@@ -2340,12 +2428,12 @@ namespace VectorTools
     template <int dim>
     struct VectorDoFTuple
     {
-      unsigned int dof_indices[dim];
+      types::global_dof_index dof_indices[dim];
 
       VectorDoFTuple ()
       {
         for (unsigned int i=0; i<dim; ++i)
-          dof_indices[i] = numbers::invalid_unsigned_int;
+          dof_indices[i] = numbers::invalid_dof_index;
       }
 
 
@@ -3353,7 +3441,7 @@ namespace VectorTools
 
     std::vector<bool> dofs_processed (dofs_per_face);
     std::vector<double> dof_values (dofs_per_face);
-    std::vector<unsigned int> face_dof_indices (dofs_per_face);
+    std::vector<types::global_dof_index> face_dof_indices (dofs_per_face);
     typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active ();
 
     switch (dim)
@@ -3563,7 +3651,7 @@ namespace VectorTools
                                       update_values);
     std::vector<bool> dofs_processed;
     std::vector<double> dof_values;
-    std::vector<unsigned int> face_dof_indices;
+    std::vector<types::global_dof_index> face_dof_indices;
     typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active ();
 
     switch (dim)
@@ -3802,7 +3890,7 @@ namespace VectorTools
                                      * fe_values[vec].value (fe.face_to_cell_index (i, face), q_point));
         }
 
-      std::vector<unsigned int> face_dof_indices (fe.dofs_per_face);
+      std::vector<types::global_dof_index> face_dof_indices (fe.dofs_per_face);
 
       cell->face (face)->get_dof_indices (face_dof_indices, cell->active_fe_index ());
 
@@ -3849,7 +3937,7 @@ namespace VectorTools
                                             const Function<3> &boundary_function,
                                             const std::vector<DerivativeForm<1,3,3> > &jacobians,
                                             std::vector<double> &dof_values,
-                                            std::vector<unsigned int> &projected_dofs)
+                                            std::vector<types::global_dof_index> &projected_dofs)
     {
       // Compute the intergral over
       // the product of the normal
@@ -3906,7 +3994,7 @@ namespace VectorTools
                                            * fe_values[vec].value (fe.face_to_cell_index (i, face), q_point));
         }
 
-      std::vector<unsigned int> face_dof_indices (fe.dofs_per_face);
+      std::vector<types::global_dof_index> face_dof_indices (fe.dofs_per_face);
 
       cell->face (face)->get_dof_indices (face_dof_indices, cell->active_fe_index ());
 
@@ -3930,7 +4018,7 @@ namespace VectorTools
                                             const Function<dim> &,
                                             const std::vector<DerivativeForm<1,dim,dim> > &,
                                             std::vector<double> &,
-                                            std::vector<unsigned int> &)
+                                            std::vector<types::global_dof_index> &)
     {
       Assert (false, ExcNotImplemented ());
     }
@@ -4045,7 +4133,7 @@ namespace VectorTools
         // compute a second one.
         const unsigned int &n_dofs = dof_handler.n_dofs ();
         std::vector<double> dof_values (n_dofs);
-        std::vector<unsigned int> projected_dofs (n_dofs);
+        std::vector<types::global_dof_index> projected_dofs (n_dofs);
 
         for (unsigned int dof = 0; dof < n_dofs; ++dof)
           projected_dofs[dof] = 0;
@@ -4182,7 +4270,7 @@ namespace VectorTools
       {
         const unsigned int &n_dofs = dof_handler.n_dofs ();
         std::vector<double> dof_values (n_dofs);
-        std::vector<unsigned int> projected_dofs (n_dofs);
+        std::vector<types::global_dof_index> projected_dofs (n_dofs);
 
         for (unsigned int dof = 0; dof < n_dofs; ++dof)
           projected_dofs[dof] = 0;
@@ -4254,7 +4342,7 @@ namespace VectorTools
                         "to imposing Dirichlet values on the vector-valued "
                         "quantity."));
 
-    std::vector<unsigned int> face_dofs;
+    std::vector<types::global_dof_index> face_dofs;
 
     // create FE and mapping collections for all elements in use by this
     // DoFHandler
@@ -5424,7 +5512,7 @@ namespace VectorTools
   subtract_mean_value(VECTOR                  &v,
                       const std::vector<bool> &p_select)
   {
-    if(p_select.size() == 0)
+    if (p_select.size() == 0)
       {
         // In case of an empty boolean mask operate on the whole vector:
         v.add( - v.mean_value() );
@@ -5434,12 +5522,12 @@ namespace VectorTools
         // This function is not implemented for distributed vectors, so
         // if v is not a boring Vector or BlockVector:
         Assert(   dynamic_cast<Vector<double> *>(& v)
-               || dynamic_cast<Vector<float> *>(& v)
-               || dynamic_cast<Vector<long double> *>(& v)
-               || dynamic_cast<BlockVector<double> *>(& v)
-               || dynamic_cast<BlockVector<float> *>(& v)
-               || dynamic_cast<BlockVector<long double> *>(& v),
-               ExcNotImplemented());
+                  || dynamic_cast<Vector<float> *>(& v)
+                  || dynamic_cast<Vector<long double> *>(& v)
+                  || dynamic_cast<BlockVector<double> *>(& v)
+                  || dynamic_cast<BlockVector<float> *>(& v)
+                  || dynamic_cast<BlockVector<long double> *>(& v),
+                  ExcNotImplemented());
 
         const unsigned int n = v.size();
 
index 3118888674baaabb645b0bef1d0e4bfe74ddb364..96c55ff3db97a9774b5796a2ac07f6eda84f7542 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 #
 # Compile the deal.II library
@@ -48,6 +50,8 @@ ADD_SUBDIRECTORY(matrix_free)
 ADD_SUBDIRECTORY(meshworker)
 
 
+ADD_CUSTOM_TARGET(library)
+
 FOREACH(build ${DEAL_II_BUILD_TYPES})
   STRING(TOLOWER ${build} build_lowercase)
 
@@ -63,6 +67,8 @@ FOREACH(build ${DEAL_II_BUILD_TYPES})
     ${deal_ii_objects_${build_lowercase}}
     )
 
+  ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
+
   SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
     PROPERTIES
     VERSION "${DEAL_II_PACKAGE_VERSION}"
@@ -72,7 +78,7 @@ FOREACH(build ${DEAL_II_BUILD_TYPES})
     # a C++ library is still ABI backwards compatible :-]
     #
     SOVERSION "${DEAL_II_PACKAGE_VERSION}"
-    LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_${build}}"
+    LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${build}}"
     COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${build}}"
     COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${build}}"
     INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}"
index 3a382d7c8f97fd41ec0a23c3a36f0eb9487ba54f..c77a4e71cf0b2c85896e03720cd4a4834b33776c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
 ## Copyright (C) 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index 98e702f3741c82c54c7ecbdbb1a25081875b0341..8f0bcc05169732f2e4200d1b69ac31375c96aada 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/parameter_handler.h>
 #include <deal.II/base/logstream.h>
index ba4fbd847f1100dfe0f9c3492addb946b814c1fb..f3aa5de50452415c815bfb62cc352de9d5937da8 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS)
 {  
index fd608c5be2eb25da29295131b587a46fb62677c9..1ae7739d30c76043b1262350365f0996ccbb1e38 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2010, 2012 by Guido Kanschat
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/algorithms/timestep_control.h>
 #include <deal.II/base/parameter_handler.h>
index 5269d6c64e695b38ffb01de53b7f997a05993446..d60e54902c1023203b507d5a5854ccb12e22c495 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index 98717ccb0a5d7c6481612b2c7c884ab1e5a053c9..9c404d76e9f4aca755741a37c1039818c1adb93f 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/point.h>
 #include <deal.II/base/auto_derivative_function.h>
index da238cdf2c60cee0fea9d3e8df52a6a56c55d578..29e3122f06782ea28ade42d28321e4979b93e0e0 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/conditional_ostream.h>
 
index 89aa9ab2908c0329d31fc680a34b3e19e0f09f3e..c5c00671d5f1a4074383da13a06fd77111273eb9 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/config.h>
 #include <cmath>
index df3555ff0560ce191a5b3a725104d711052ee7ba..1a33363822620efd60834109de344dde60454d88 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/convergence_table.h>
 #include <cmath>
@@ -67,7 +69,7 @@ void ConvergenceTable::evaluate_convergence_rates(const std::string &data_column
       // Calculate all missing rate values:
       for (unsigned int i = no_rate_entries; i<n; ++i)
         {
-          if(i == 0)
+          if (i == 0)
             {
               // no value available for the first row
               add_value(rate_key, std::string("-"));
@@ -85,7 +87,7 @@ void ConvergenceTable::evaluate_convergence_rates(const std::string &data_column
       // Calculate all missing rate values:
       for (unsigned int i = no_rate_entries; i<n; ++i)
         {
-          if(i == 0)
+          if (i == 0)
             {
               // no value available for the first row
               add_value(rate_key, std::string("-"));
@@ -113,7 +115,7 @@ void ConvergenceTable::evaluate_convergence_rates(const std::string &data_column
     }
 
   // only add rate_key to the supercolumn once
-  if(no_rate_entries == 0)
+  if (no_rate_entries == 0)
     {
       add_column_to_supercolumn(rate_key, superkey);
     }
@@ -154,7 +156,7 @@ ConvergenceTable::evaluate_convergence_rates(const std::string &data_column_key,
       // Calculate all missing rate values:
       for (unsigned int i = no_rate_entries; i<n; ++i)
         {
-          if(i == 0)
+          if (i == 0)
             {
               // no value available for the first row
               add_value(rate_key, std::string("-"));
@@ -172,7 +174,7 @@ ConvergenceTable::evaluate_convergence_rates(const std::string &data_column_key,
       // Calculate all missing rate values:
       for (unsigned int i = no_rate_entries; i<n; ++i)
         {
-          if(i == 0)
+          if (i == 0)
             {
               // no value available for the first row
               add_value(rate_key, std::string("-"));
@@ -203,7 +205,7 @@ ConvergenceTable::evaluate_convergence_rates(const std::string &data_column_key,
     }
 
   // only add rate_key to the supercolumn once
-  if(no_rate_entries == 0)
+  if (no_rate_entries == 0)
     {
       add_column_to_supercolumn(rate_key, superkey);
     }
index 6e414d7e1f896beb3c55bd3d5d02c41b97a9fd43..1638903344eea866ff185886b3121e59e3901d64 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 //TODO: Do neighbors for dx and povray smooth triangles
 
@@ -300,9 +304,13 @@ namespace
   };
 #endif
 
-  static unsigned int vtk_cell_type[4] =
+  // NOTE: (UK) The dimension of the array is choosen to 5 to allow the choice
+  // DataOutBase<deal_II_dimension,deal_II_dimension+1> in general
+  // Wolfgang supposed that we don't need it in general, but however this
+  // choice avoids a -Warray-bounds check warning
+  static unsigned int vtk_cell_type[5] =
   {
-    0, 3, 9, 12
+    0, 3, 9, 12, static_cast<unsigned int>(-1)
   };
 
 //----------------------------------------------------------------------//
@@ -2214,17 +2222,17 @@ DataOutBase::VtkFlags::memory_consumption () const
 
 
 DataOutBase::SvgFlags::SvgFlags (const unsigned int height_vector,
-                                 const int azimuth_angle, 
+                                 const int azimuth_angle,
                                  const int polar_angle,
                                  const unsigned int line_thickness,
                                  const bool margin,
                                  const bool draw_colorbar) :
-height_vector(height_vector),
-azimuth_angle(azimuth_angle),
-polar_angle(polar_angle),
-line_thickness(line_thickness),
-margin(margin),
-draw_colorbar(draw_colorbar)
+  height_vector(height_vector),
+  azimuth_angle(azimuth_angle),
+  polar_angle(polar_angle),
+  line_thickness(line_thickness),
+  margin(margin),
+  draw_colorbar(draw_colorbar)
 {}
 
 
@@ -2537,17 +2545,17 @@ Point<6> DataOutBase::svg_get_gradient_parameters(Point<3> points[])
   int i, j;
 
   for (i = 0; i < 2; ++i)
-  {
-    for (j = 0; j < 2-i; ++j)
     {
-      if (points[j][2] > points[j + 1][2])
-      {
-        Point<3> temp = points[j];
-        points[j] = points[j+1];
-        points[j+1] = temp;
-      }
+      for (j = 0; j < 2-i; ++j)
+        {
+          if (points[j][2] > points[j + 1][2])
+            {
+              Point<3> temp = points[j];
+              points[j] = points[j+1];
+              points[j+1] = temp;
+            }
+        }
     }
-  }
 
   // save the related three-dimensional vectors v_min, v_inter, and v_max
   v_min = points[0];
@@ -2570,47 +2578,47 @@ Point<6> DataOutBase::svg_get_gradient_parameters(Point<3> points[])
   bool col_change = false;
 
   if (A[0][0] == 0)
-  {
-    col_change = true;
+    {
+      col_change = true;
 
-    A[0][0] = A[0][1];
-    A[0][1] = 0;
+      A[0][0] = A[0][1];
+      A[0][1] = 0;
 
-    double temp = A[1][0];
-    A[1][0] = A[1][1];
-    A[1][1] = temp;
-  }
+      double temp = A[1][0];
+      A[1][0] = A[1][1];
+      A[1][1] = temp;
+    }
 
-  for (unsigned int k = 0; k < 1; k++) 
-  {
-    for (unsigned int i = k+1; i < 2; i++) 
+  for (unsigned int k = 0; k < 1; k++)
     {
-      x = A[i][k] / A[k][k];
+      for (unsigned int i = k+1; i < 2; i++)
+        {
+          x = A[i][k] / A[k][k];
 
-      for (unsigned int j = k+1; j < 2; j++) A[i][j] = A[i][j] - A[k][j] * x;
+          for (unsigned int j = k+1; j < 2; j++) A[i][j] = A[i][j] - A[k][j] * x;
 
-      b[i] = b[i] - b[k]*x;
+          b[i] = b[i] - b[k]*x;
 
+        }
     }
-  }
 
   b[1] = b[1] / A[1][1];
 
-  for (int i = 0; i >= 0; i--) 
-  {
-    sum = b[i];
+  for (int i = 0; i >= 0; i--)
+    {
+      sum = b[i];
 
-    for (unsigned int j = i+1; j < 2; j++) sum = sum - A[i][j] * b[j];
+      for (unsigned int j = i+1; j < 2; j++) sum = sum - A[i][j] * b[j];
 
-    b[i] = sum / A[i][i];
-  }
+      b[i] = sum / A[i][i];
+    }
 
   if (col_change)
-  {
-    double temp = b[0];
-    b[0] = b[1];
-    b[1] = temp;
-  }
+    {
+      double temp = b[0];
+      b[0] = b[1];
+      b[1] = temp;
+    }
 
   double c = b[0] * (v_max[2] - v_min[2]) + b[1] * (v_inter[2] - v_min[2]) + v_min[2];
 
@@ -2626,47 +2634,47 @@ Point<6> DataOutBase::svg_get_gradient_parameters(Point<3> points[])
   col_change = false;
 
   if (A[0][0] == 0)
-  {
-    col_change = true;
+    {
+      col_change = true;
 
-    A[0][0] = A[0][1];
-    A[0][1] = 0;
+      A[0][0] = A[0][1];
+      A[0][1] = 0;
 
-    double temp = A[1][0];
-    A[1][0] = A[1][1];
-    A[1][1] = temp;
-  }
+      double temp = A[1][0];
+      A[1][0] = A[1][1];
+      A[1][1] = temp;
+    }
 
-  for (unsigned int k = 0; k < 1; k++) 
-  {
-    for (unsigned int i = k+1; i < 2; i++) 
+  for (unsigned int k = 0; k < 1; k++)
     {
-      x = A[i][k] / A[k][k];
+      for (unsigned int i = k+1; i < 2; i++)
+        {
+          x = A[i][k] / A[k][k];
 
-      for (unsigned int j = k+1; j < 2; j++) A[i][j] = A[i][j] - A[k][j] * x;
+          for (unsigned int j = k+1; j < 2; j++) A[i][j] = A[i][j] - A[k][j] * x;
 
-      b[i] = b[i] - b[k] * x;
+          b[i] = b[i] - b[k] * x;
 
+        }
     }
-  }
 
   b[1]=b[1] / A[1][1];
 
-  for (int i = 0; i >= 0; i--) 
-  {
-    sum = b[i];
+  for (int i = 0; i >= 0; i--)
+    {
+      sum = b[i];
 
-    for (unsigned int j = i+1; j < 2; j++) sum = sum - A[i][j]*b[j];
+      for (unsigned int j = i+1; j < 2; j++) sum = sum - A[i][j]*b[j];
 
-    b[i] = sum / A[i][i];
-  }
+      b[i] = sum / A[i][i];
+    }
 
   if (col_change)
-  {
-    double temp = b[0];
-    b[0] = b[1];
-    b[1] = temp;
-  }
+    {
+      double temp = b[0];
+      b[0] = b[1];
+      b[1] = temp;
+    }
 
   gradient[0] = b[0] * (v_max[2] - v_min[2]) + b[1] * (v_inter[2] - v_min[2]) - c + v_min[2];
 
@@ -2682,46 +2690,46 @@ Point<6> DataOutBase::svg_get_gradient_parameters(Point<3> points[])
   col_change = false;
 
   if (A[0][0] == 0)
-  {
-    col_change = true;
+    {
+      col_change = true;
 
-    A[0][0] = A[0][1];
-    A[0][1] = 0;
+      A[0][0] = A[0][1];
+      A[0][1] = 0;
 
-    double temp = A[1][0];
-    A[1][0] = A[1][1];
-    A[1][1] = temp;
-  }
+      double temp = A[1][0];
+      A[1][0] = A[1][1];
+      A[1][1] = temp;
+    }
 
-  for (unsigned int k = 0; k < 1; k++) 
-  {
-    for (unsigned int i = k+1; i < 2; i++) 
+  for (unsigned int k = 0; k < 1; k++)
     {
-      x = A[i][k] / A[k][k];
+      for (unsigned int i = k+1; i < 2; i++)
+        {
+          x = A[i][k] / A[k][k];
 
-      for (unsigned int j = k+1; j < 2; j++) A[i][j] = A[i][j] - A[k][j] * x;
+          for (unsigned int j = k+1; j < 2; j++) A[i][j] = A[i][j] - A[k][j] * x;
 
-      b[i] = b[i] - b[k] * x;
+          b[i] = b[i] - b[k] * x;
+        }
     }
-  }
 
   b[1] = b[1] / A[1][1];
 
-  for (int i = 0; i >= 0; i--) 
-  {
-    sum = b[i];
+  for (int i = 0; i >= 0; i--)
+    {
+      sum = b[i];
 
-    for (unsigned int j = i+1; j < 2; j++) sum = sum - A[i][j] * b[j];
+      for (unsigned int j = i+1; j < 2; j++) sum = sum - A[i][j] * b[j];
 
-    b[i] = sum / A[i][i];
-  }
+      b[i] = sum / A[i][i];
+    }
 
   if (col_change)
-  {
-    double temp = b[0];
-    b[0] = b[1];
-    b[1] = temp;
-  }
+    {
+      double temp = b[0];
+      b[0] = b[1];
+      b[1] = temp;
+    }
 
   gradient[1] = b[0] * (v_max[2] - v_min[2]) + b[1] * (v_inter[2] - v_min[2]) - c + v_min[2];
 
@@ -2736,7 +2744,7 @@ Point<6> DataOutBase::svg_get_gradient_parameters(Point<3> points[])
 
   gradient_parameters[0] = v_min[0];
   gradient_parameters[1] = v_min[1];
-  
+
   gradient_parameters[2] = v_min[0] + lambda * gradient[0];
   gradient_parameters[3] = v_min[1] + lambda * gradient[1];
 
@@ -5325,7 +5333,7 @@ void DataOutBase::write_vtu_main (const std::vector<Patch<dim,spacedim> > &patch
 
     if (n_metadata > 0)
       out << "</FieldData>\n";
-}
+  }
 
 
   VtuStream vtu_out(out, flags);
@@ -5598,7 +5606,7 @@ void DataOutBase::write_svg (const std::vector<Patch<dim,spacedim> > &patches,
 
   // margin around the plotted area
   unsigned int margin_in_percent = 0;
-  if(flags.margin) margin_in_percent = 5;
+  if (flags.margin) margin_in_percent = 5;
 
 
 // determine the bounding box in the model space
@@ -5619,8 +5627,8 @@ void DataOutBase::write_svg (const std::vector<Patch<dim,spacedim> > &patches,
   Point<2> projection_decomposition;
   Point<2> projection_decompositions[4];
 
-  compute_node(projected_point, &*patch, 0, 0, 0, n_subdivisions); 
+  compute_node(projected_point, &*patch, 0, 0, 0, n_subdivisions);
+
   Assert ((flags.height_vector < patch->data.n_rows()) ||
           patch->data.n_rows() == 0,
           ExcIndexRange (flags.height_vector, 0, patch->data.n_rows()));
@@ -5634,55 +5642,55 @@ void DataOutBase::write_svg (const std::vector<Patch<dim,spacedim> > &patches,
 
   // iterate over the patches
   for (; patch != patches.end(); ++patch)
-  {
-    n_subdivisions = patch->n_subdivisions;
-    n = n_subdivisions + 1;
+    {
+      n_subdivisions = patch->n_subdivisions;
+      n = n_subdivisions + 1;
 
-    for (unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
-    {  
-      for (unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
-      {
-        compute_node(projected_points[0], &*patch, i1, i2, 0, n_subdivisions);
-        compute_node(projected_points[1], &*patch, i1+1, i2, 0, n_subdivisions);
-        compute_node(projected_points[2], &*patch, i1, i2+1, 0, n_subdivisions);
-        compute_node(projected_points[3], &*patch, i1+1, i2+1, 0, n_subdivisions);
-
-        x_min = std::min(x_min, (double)projected_points[0][0]);
-        x_min = std::min(x_min, (double)projected_points[1][0]);
-        x_min = std::min(x_min, (double)projected_points[2][0]);
-        x_min = std::min(x_min, (double)projected_points[3][0]);
-
-        x_max = std::max(x_max, (double)projected_points[0][0]);
-        x_max = std::max(x_max, (double)projected_points[1][0]);
-        x_max = std::max(x_max, (double)projected_points[2][0]);
-        x_max = std::max(x_max, (double)projected_points[3][0]);   
-
-        y_min = std::min(y_min, (double)projected_points[0][1]);
-        y_min = std::min(y_min, (double)projected_points[1][1]);
-        y_min = std::min(y_min, (double)projected_points[2][1]);
-        y_min = std::min(y_min, (double)projected_points[3][1]);
-
-        y_max = std::max(y_max, (double)projected_points[0][1]);
-        y_max = std::max(y_max, (double)projected_points[1][1]);
-        y_max = std::max(y_max, (double)projected_points[2][1]);
-        y_max = std::max(y_max, (double)projected_points[3][1]);
-        Assert ((flags.height_vector < patch->data.n_rows()) ||
-                patch->data.n_rows() == 0,
-                ExcIndexRange (flags.height_vector, 0, patch->data.n_rows()));
-
-        z_min = std::min(z_min, (double)patch->data(flags.height_vector, i1*d1 + i2*d2));
-        z_min = std::min(z_min, (double)patch->data(flags.height_vector, (i1+1)*d1 + i2*d2));
-        z_min = std::min(z_min, (double)patch->data(flags.height_vector, i1*d1 + (i2+1)*d2));
-        z_min = std::min(z_min, (double)patch->data(flags.height_vector, (i1+1)*d1 + (i2+1)*d2));
-
-        z_max = std::max(z_max, (double)patch->data(flags.height_vector, i1*d1 + i2*d2));
-        z_max = std::max(z_max, (double)patch->data(flags.height_vector, (i1+1)*d1 + i2*d2));
-        z_max = std::max(z_max, (double)patch->data(flags.height_vector, i1*d1 + (i2+1)*d2));
-        z_max = std::max(z_max, (double)patch->data(flags.height_vector, (i1+1)*d1 + (i2+1)*d2));
-      }
+      for (unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
+        {
+          for (unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
+            {
+              compute_node(projected_points[0], &*patch, i1, i2, 0, n_subdivisions);
+              compute_node(projected_points[1], &*patch, i1+1, i2, 0, n_subdivisions);
+              compute_node(projected_points[2], &*patch, i1, i2+1, 0, n_subdivisions);
+              compute_node(projected_points[3], &*patch, i1+1, i2+1, 0, n_subdivisions);
+
+              x_min = std::min(x_min, (double)projected_points[0][0]);
+              x_min = std::min(x_min, (double)projected_points[1][0]);
+              x_min = std::min(x_min, (double)projected_points[2][0]);
+              x_min = std::min(x_min, (double)projected_points[3][0]);
+
+              x_max = std::max(x_max, (double)projected_points[0][0]);
+              x_max = std::max(x_max, (double)projected_points[1][0]);
+              x_max = std::max(x_max, (double)projected_points[2][0]);
+              x_max = std::max(x_max, (double)projected_points[3][0]);
+
+              y_min = std::min(y_min, (double)projected_points[0][1]);
+              y_min = std::min(y_min, (double)projected_points[1][1]);
+              y_min = std::min(y_min, (double)projected_points[2][1]);
+              y_min = std::min(y_min, (double)projected_points[3][1]);
+
+              y_max = std::max(y_max, (double)projected_points[0][1]);
+              y_max = std::max(y_max, (double)projected_points[1][1]);
+              y_max = std::max(y_max, (double)projected_points[2][1]);
+              y_max = std::max(y_max, (double)projected_points[3][1]);
+
+              Assert ((flags.height_vector < patch->data.n_rows()) ||
+                      patch->data.n_rows() == 0,
+                      ExcIndexRange (flags.height_vector, 0, patch->data.n_rows()));
+
+              z_min = std::min(z_min, (double)patch->data(flags.height_vector, i1*d1 + i2*d2));
+              z_min = std::min(z_min, (double)patch->data(flags.height_vector, (i1+1)*d1 + i2*d2));
+              z_min = std::min(z_min, (double)patch->data(flags.height_vector, i1*d1 + (i2+1)*d2));
+              z_min = std::min(z_min, (double)patch->data(flags.height_vector, (i1+1)*d1 + (i2+1)*d2));
+
+              z_max = std::max(z_max, (double)patch->data(flags.height_vector, i1*d1 + i2*d2));
+              z_max = std::max(z_max, (double)patch->data(flags.height_vector, (i1+1)*d1 + i2*d2));
+              z_max = std::max(z_max, (double)patch->data(flags.height_vector, i1*d1 + (i2+1)*d2));
+              z_max = std::max(z_max, (double)patch->data(flags.height_vector, (i1+1)*d1 + (i2+1)*d2));
+            }
+        }
     }
-  }
 
   x_dimension = x_max - x_min;
   y_dimension = y_max - y_min;
@@ -5762,7 +5770,7 @@ void DataOutBase::write_svg (const std::vector<Patch<dim,spacedim> > &patches,
   camera_position[1] -= (z_min + 2. * z_dimension) * sin(angle_factor * flags.polar_angle) * cos(angle_factor * flags.azimuth_angle);
 
 
-// determine the bounding box on the projection plane 
+// determine the bounding box on the projection plane
   double x_min_perspective, y_min_perspective;
   double x_max_perspective, y_max_perspective;
   double x_dimension_perspective, y_dimension_perspective;
@@ -5774,8 +5782,8 @@ void DataOutBase::write_svg (const std::vector<Patch<dim,spacedim> > &patches,
 
   Point<3> point(true);
 
-  compute_node(projected_point, &*patch, 0, 0, 0, n_subdivisions);  
-  
+  compute_node(projected_point, &*patch, 0, 0, 0, n_subdivisions);
+
   Assert ((flags.height_vector < patch->data.n_rows()) ||
           patch->data.n_rows() == 0,
           ExcIndexRange (flags.height_vector, 0, patch->data.n_rows()));
@@ -5793,69 +5801,69 @@ void DataOutBase::write_svg (const std::vector<Patch<dim,spacedim> > &patches,
 
   // iterate over the patches
   for (; patch != patches.end(); ++patch)
-  {
-    n_subdivisions = patch->n_subdivisions;
-    n = n_subdivisions + 1;
+    {
+      n_subdivisions = patch->n_subdivisions;
+      n = n_subdivisions + 1;
 
-    for (unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
-    {  
-      for (unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
-      {
-        Point<spacedim> projected_vertices[4];
-        Point<3> vertices[4];
-
-        compute_node(projected_vertices[0], &*patch, i1, i2, 0, n_subdivisions);
-        compute_node(projected_vertices[1], &*patch, i1+1, i2, 0, n_subdivisions);
-        compute_node(projected_vertices[2], &*patch, i1, i2+1, 0, n_subdivisions);
-        compute_node(projected_vertices[3], &*patch, i1+1, i2+1, 0, n_subdivisions);
-
-        Assert ((flags.height_vector < patch->data.n_rows()) ||
-                patch->data.n_rows() == 0,
-                ExcIndexRange (flags.height_vector, 0, patch->data.n_rows()));
-
-        vertices[0][0] = projected_vertices[0][0];
-        vertices[0][1] = projected_vertices[0][1]; 
-        vertices[0][2] = patch->data.n_rows() != 0 ? patch->data(0,i1*d1 + i2*d2) : 0;
-               
-        vertices[1][0] = projected_vertices[1][0];
-        vertices[1][1] = projected_vertices[1][1]; 
-        vertices[1][2] = patch->data.n_rows() != 0 ? patch->data(0,(i1+1)*d1 + i2*d2) : 0;
-        
-        vertices[2][0] = projected_vertices[2][0];
-        vertices[2][1] = projected_vertices[2][1]; 
-        vertices[2][2] = patch->data.n_rows() != 0 ? patch->data(0,i1*d1 + (i2+1)*d2) : 0;
-
-        vertices[3][0] = projected_vertices[3][0];
-        vertices[3][1] = projected_vertices[3][1];         
-        vertices[3][2] = patch->data.n_rows() != 0 ? patch->data(0,(i1+1)*d1 + (i2+1)*d2) : 0;
-
-        projection_decompositions[0] = svg_project_point(vertices[0], camera_position, camera_direction, camera_horizontal, camera_focus);
-        projection_decompositions[1] = svg_project_point(vertices[1], camera_position, camera_direction, camera_horizontal, camera_focus);
-        projection_decompositions[2] = svg_project_point(vertices[2], camera_position, camera_direction, camera_horizontal, camera_focus);
-        projection_decompositions[3] = svg_project_point(vertices[3], camera_position, camera_direction, camera_horizontal, camera_focus);
-
-        x_min_perspective = std::min(x_min_perspective, (double)projection_decompositions[0][0]);
-        x_min_perspective = std::min(x_min_perspective, (double)projection_decompositions[1][0]);
-        x_min_perspective = std::min(x_min_perspective, (double)projection_decompositions[2][0]);
-        x_min_perspective = std::min(x_min_perspective, (double)projection_decompositions[3][0]);
-
-        x_max_perspective = std::max(x_max_perspective, (double)projection_decompositions[0][0]);
-        x_max_perspective = std::max(x_max_perspective, (double)projection_decompositions[1][0]);
-        x_max_perspective = std::max(x_max_perspective, (double)projection_decompositions[2][0]);
-        x_max_perspective = std::max(x_max_perspective, (double)projection_decompositions[3][0]);
-
-        y_min_perspective = std::min(y_min_perspective, (double)projection_decompositions[0][1]);
-        y_min_perspective = std::min(y_min_perspective, (double)projection_decompositions[1][1]);
-        y_min_perspective = std::min(y_min_perspective, (double)projection_decompositions[2][1]);
-        y_min_perspective = std::min(y_min_perspective, (double)projection_decompositions[3][1]);
-
-        y_max_perspective = std::max(y_max_perspective, (double)projection_decompositions[0][1]);
-        y_max_perspective = std::max(y_max_perspective, (double)projection_decompositions[1][1]);
-        y_max_perspective = std::max(y_max_perspective, (double)projection_decompositions[2][1]);
-        y_max_perspective = std::max(y_max_perspective, (double)projection_decompositions[3][1]);
-      }
+      for (unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
+        {
+          for (unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
+            {
+              Point<spacedim> projected_vertices[4];
+              Point<3> vertices[4];
+
+              compute_node(projected_vertices[0], &*patch, i1, i2, 0, n_subdivisions);
+              compute_node(projected_vertices[1], &*patch, i1+1, i2, 0, n_subdivisions);
+              compute_node(projected_vertices[2], &*patch, i1, i2+1, 0, n_subdivisions);
+              compute_node(projected_vertices[3], &*patch, i1+1, i2+1, 0, n_subdivisions);
+
+              Assert ((flags.height_vector < patch->data.n_rows()) ||
+                      patch->data.n_rows() == 0,
+                      ExcIndexRange (flags.height_vector, 0, patch->data.n_rows()));
+
+              vertices[0][0] = projected_vertices[0][0];
+              vertices[0][1] = projected_vertices[0][1];
+              vertices[0][2] = patch->data.n_rows() != 0 ? patch->data(0,i1*d1 + i2*d2) : 0;
+
+              vertices[1][0] = projected_vertices[1][0];
+              vertices[1][1] = projected_vertices[1][1];
+              vertices[1][2] = patch->data.n_rows() != 0 ? patch->data(0,(i1+1)*d1 + i2*d2) : 0;
+
+              vertices[2][0] = projected_vertices[2][0];
+              vertices[2][1] = projected_vertices[2][1];
+              vertices[2][2] = patch->data.n_rows() != 0 ? patch->data(0,i1*d1 + (i2+1)*d2) : 0;
+
+              vertices[3][0] = projected_vertices[3][0];
+              vertices[3][1] = projected_vertices[3][1];
+              vertices[3][2] = patch->data.n_rows() != 0 ? patch->data(0,(i1+1)*d1 + (i2+1)*d2) : 0;
+
+              projection_decompositions[0] = svg_project_point(vertices[0], camera_position, camera_direction, camera_horizontal, camera_focus);
+              projection_decompositions[1] = svg_project_point(vertices[1], camera_position, camera_direction, camera_horizontal, camera_focus);
+              projection_decompositions[2] = svg_project_point(vertices[2], camera_position, camera_direction, camera_horizontal, camera_focus);
+              projection_decompositions[3] = svg_project_point(vertices[3], camera_position, camera_direction, camera_horizontal, camera_focus);
+
+              x_min_perspective = std::min(x_min_perspective, (double)projection_decompositions[0][0]);
+              x_min_perspective = std::min(x_min_perspective, (double)projection_decompositions[1][0]);
+              x_min_perspective = std::min(x_min_perspective, (double)projection_decompositions[2][0]);
+              x_min_perspective = std::min(x_min_perspective, (double)projection_decompositions[3][0]);
+
+              x_max_perspective = std::max(x_max_perspective, (double)projection_decompositions[0][0]);
+              x_max_perspective = std::max(x_max_perspective, (double)projection_decompositions[1][0]);
+              x_max_perspective = std::max(x_max_perspective, (double)projection_decompositions[2][0]);
+              x_max_perspective = std::max(x_max_perspective, (double)projection_decompositions[3][0]);
+
+              y_min_perspective = std::min(y_min_perspective, (double)projection_decompositions[0][1]);
+              y_min_perspective = std::min(y_min_perspective, (double)projection_decompositions[1][1]);
+              y_min_perspective = std::min(y_min_perspective, (double)projection_decompositions[2][1]);
+              y_min_perspective = std::min(y_min_perspective, (double)projection_decompositions[3][1]);
+
+              y_max_perspective = std::max(y_max_perspective, (double)projection_decompositions[0][1]);
+              y_max_perspective = std::max(y_max_perspective, (double)projection_decompositions[1][1]);
+              y_max_perspective = std::max(y_max_perspective, (double)projection_decompositions[2][1]);
+              y_max_perspective = std::max(y_max_perspective, (double)projection_decompositions[3][1]);
+            }
+        }
     }
-  }
 
   x_dimension_perspective = x_max_perspective - x_min_perspective;
   y_dimension_perspective = y_max_perspective - y_min_perspective;
@@ -5864,290 +5872,360 @@ void DataOutBase::write_svg (const std::vector<Patch<dim,spacedim> > &patches,
 
   // iterate over the patches
   for (patch = patches.begin(); patch != patches.end(); ++patch)
-  {
-    n_subdivisions = patch->n_subdivisions;
-    n = n_subdivisions + 1;
+    {
+      n_subdivisions = patch->n_subdivisions;
+      n = n_subdivisions + 1;
 
-    for (unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
-    {  
-      for (unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
-      {
-        Point<spacedim> projected_vertices[4];
-        SvgCell cell;
-
-        compute_node(projected_vertices[0], &*patch, i1, i2, 0, n_subdivisions);
-        compute_node(projected_vertices[1], &*patch, i1+1, i2, 0, n_subdivisions);
-        compute_node(projected_vertices[2], &*patch, i1, i2+1, 0, n_subdivisions);
-        compute_node(projected_vertices[3], &*patch, i1+1, i2+1, 0, n_subdivisions);
-
-        Assert ((flags.height_vector < patch->data.n_rows()) ||
-                patch->data.n_rows() == 0,
-                ExcIndexRange (flags.height_vector, 0, patch->data.n_rows()));
-
-        cell.vertices[0][0] = projected_vertices[0][0];
-        cell.vertices[0][1] = projected_vertices[0][1]; 
-        cell.vertices[0][2] = patch->data.n_rows() != 0 ? patch->data(0,i1*d1 + i2*d2) : 0;
-               
-        cell.vertices[1][0] = projected_vertices[1][0];
-        cell.vertices[1][1] = projected_vertices[1][1]; 
-        cell.vertices[1][2] = patch->data.n_rows() != 0 ? patch->data(0,(i1+1)*d1 + i2*d2) : 0;
-        
-        cell.vertices[2][0] = projected_vertices[2][0];
-        cell.vertices[2][1] = projected_vertices[2][1]; 
-        cell.vertices[2][2] = patch->data.n_rows() != 0 ? patch->data(0,i1*d1 + (i2+1)*d2) : 0;
-
-        cell.vertices[3][0] = projected_vertices[3][0];
-        cell.vertices[3][1] = projected_vertices[3][1];         
-        cell.vertices[3][2] = patch->data.n_rows() != 0 ? patch->data(0,(i1+1)*d1 + (i2+1)*d2) : 0;
-
-        cell.projected_vertices[0] = svg_project_point(cell.vertices[0], camera_position, camera_direction, camera_horizontal, camera_focus);
-        cell.projected_vertices[1] = svg_project_point(cell.vertices[1], camera_position, camera_direction, camera_horizontal, camera_focus);
-        cell.projected_vertices[2] = svg_project_point(cell.vertices[2], camera_position, camera_direction, camera_horizontal, camera_focus);
-        cell.projected_vertices[3] = svg_project_point(cell.vertices[3], camera_position, camera_direction, camera_horizontal, camera_focus);
-
-        cell.center = .25 * (cell.vertices[0] + cell.vertices[1] + cell.vertices[2] + cell.vertices[3]);
-        cell.projected_center = svg_project_point(cell.center, camera_position, camera_direction, camera_horizontal, camera_focus);
-
-        cell.depth = cell.center.distance(camera_position);
-        cells.insert(cell);
-      }
+      for (unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
+        {
+          for (unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
+            {
+              Point<spacedim> projected_vertices[4];
+              SvgCell cell;
+
+              compute_node(projected_vertices[0], &*patch, i1, i2, 0, n_subdivisions);
+              compute_node(projected_vertices[1], &*patch, i1+1, i2, 0, n_subdivisions);
+              compute_node(projected_vertices[2], &*patch, i1, i2+1, 0, n_subdivisions);
+              compute_node(projected_vertices[3], &*patch, i1+1, i2+1, 0, n_subdivisions);
+
+              Assert ((flags.height_vector < patch->data.n_rows()) ||
+                      patch->data.n_rows() == 0,
+                      ExcIndexRange (flags.height_vector, 0, patch->data.n_rows()));
+
+              cell.vertices[0][0] = projected_vertices[0][0];
+              cell.vertices[0][1] = projected_vertices[0][1];
+              cell.vertices[0][2] = patch->data.n_rows() != 0 ? patch->data(0,i1*d1 + i2*d2) : 0;
+
+              cell.vertices[1][0] = projected_vertices[1][0];
+              cell.vertices[1][1] = projected_vertices[1][1];
+              cell.vertices[1][2] = patch->data.n_rows() != 0 ? patch->data(0,(i1+1)*d1 + i2*d2) : 0;
+
+              cell.vertices[2][0] = projected_vertices[2][0];
+              cell.vertices[2][1] = projected_vertices[2][1];
+              cell.vertices[2][2] = patch->data.n_rows() != 0 ? patch->data(0,i1*d1 + (i2+1)*d2) : 0;
+
+              cell.vertices[3][0] = projected_vertices[3][0];
+              cell.vertices[3][1] = projected_vertices[3][1];
+              cell.vertices[3][2] = patch->data.n_rows() != 0 ? patch->data(0,(i1+1)*d1 + (i2+1)*d2) : 0;
+
+              cell.projected_vertices[0] = svg_project_point(cell.vertices[0], camera_position, camera_direction, camera_horizontal, camera_focus);
+              cell.projected_vertices[1] = svg_project_point(cell.vertices[1], camera_position, camera_direction, camera_horizontal, camera_focus);
+              cell.projected_vertices[2] = svg_project_point(cell.vertices[2], camera_position, camera_direction, camera_horizontal, camera_focus);
+              cell.projected_vertices[3] = svg_project_point(cell.vertices[3], camera_position, camera_direction, camera_horizontal, camera_focus);
+
+              cell.center = .25 * (cell.vertices[0] + cell.vertices[1] + cell.vertices[2] + cell.vertices[3]);
+              cell.projected_center = svg_project_point(cell.center, camera_position, camera_direction, camera_horizontal, camera_focus);
+
+              cell.depth = cell.center.distance(camera_position);
+
+              cells.insert(cell);
+            }
+        }
     }
-  }
 
 
 // write the svg file
   width = static_cast<unsigned int>(.5 + height * (x_dimension_perspective / y_dimension_perspective));
   unsigned int additional_width = 0;
 
-  if(flags.draw_colorbar) additional_width = static_cast<unsigned int>(.5 + height * .3); // additional width for colorbar
-  
+  if (flags.draw_colorbar) additional_width = static_cast<unsigned int>(.5 + height * .3); // additional width for colorbar
+
   // basic svg header and background rectangle
-  out << "<svg width=\"" << width + additional_width << "\" height=\"" << height << "\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">" << '\n' 
+  out << "<svg width=\"" << width + additional_width << "\" height=\"" << height << "\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">" << '\n'
       << " <rect width=\"" << width + additional_width << "\" height=\"" << height << "\" style=\"fill:white\"/>" << '\n' << '\n';
 
   unsigned int triangle_counter = 0;
+
   // write the cells in the correct order
   for (typename std::multiset<SvgCell>::const_iterator cell = cells.begin(); cell != cells.end(); ++cell)
-  {
-    Point<3> points3d_triangle[3];
-
-    for (unsigned int triangle_index = 0; triangle_index < 4; triangle_index++)
     {
-      switch (triangle_index)
-      {
-        case 0: points3d_triangle[0] = cell->vertices[0], points3d_triangle[1] = cell->vertices[1], points3d_triangle[2] = cell->center; break;
-        case 1: points3d_triangle[0] = cell->vertices[1], points3d_triangle[1] = cell->vertices[3], points3d_triangle[2] = cell->center; break;
-        case 2: points3d_triangle[0] = cell->vertices[3], points3d_triangle[1] = cell->vertices[2], points3d_triangle[2] = cell->center; break;
-        case 3: points3d_triangle[0] = cell->vertices[2], points3d_triangle[1] = cell->vertices[0], points3d_triangle[2] = cell->center; break;
-        default: break;
-      }
+      Point<3> points3d_triangle[3];
 
-      Point<6> gradient_param = svg_get_gradient_parameters(points3d_triangle);
+      for (unsigned int triangle_index = 0; triangle_index < 4; triangle_index++)
+        {
+          switch (triangle_index)
+            {
+            case 0:
+              points3d_triangle[0] = cell->vertices[0], points3d_triangle[1] = cell->vertices[1], points3d_triangle[2] = cell->center;
+              break;
+            case 1:
+              points3d_triangle[0] = cell->vertices[1], points3d_triangle[1] = cell->vertices[3], points3d_triangle[2] = cell->center;
+              break;
+            case 2:
+              points3d_triangle[0] = cell->vertices[3], points3d_triangle[1] = cell->vertices[2], points3d_triangle[2] = cell->center;
+              break;
+            case 3:
+              points3d_triangle[0] = cell->vertices[2], points3d_triangle[1] = cell->vertices[0], points3d_triangle[2] = cell->center;
+              break;
+            default:
+              break;
+            }
 
-      double start_h = .667 - ((gradient_param[4] - z_min) / z_dimension) * .667;
-      double stop_h = .667 - ((gradient_param[5] - z_min) / z_dimension) * .667;  
+          Point<6> gradient_param = svg_get_gradient_parameters(points3d_triangle);
 
-      unsigned int start_r = 0;
-      unsigned int start_g = 0;
-      unsigned int start_b = 0;
+          double start_h = .667 - ((gradient_param[4] - z_min) / z_dimension) * .667;
+          double stop_h = .667 - ((gradient_param[5] - z_min) / z_dimension) * .667;
 
-      unsigned int stop_r = 0;
-      unsigned int stop_g = 0;
-      unsigned int stop_b = 0;
+          unsigned int start_r = 0;
+          unsigned int start_g = 0;
+          unsigned int start_b = 0;
 
-      unsigned int start_i = static_cast<unsigned int>(start_h * 6.);
-      unsigned int stop_i = static_cast<unsigned int>(stop_h * 6.);
+          unsigned int stop_r = 0;
+          unsigned int stop_g = 0;
+          unsigned int stop_b = 0;
 
-      double start_f = start_h * 6. - start_i;
-      double start_q = 1. - start_f;
+          unsigned int start_i = static_cast<unsigned int>(start_h * 6.);
+          unsigned int stop_i = static_cast<unsigned int>(stop_h * 6.);
 
-      double stop_f = stop_h * 6. - stop_i;
-      double stop_q = 1. - stop_f;
+          double start_f = start_h * 6. - start_i;
+          double start_q = 1. - start_f;
 
-      switch (start_i % 6)
-      {
-        case 0: start_r = 255, start_g = static_cast<unsigned int>(.5 + 255. * start_f); break;
-        case 1: start_r = static_cast<unsigned int>(.5 + 255. * start_q), start_g = 255; break;
-        case 2: start_g = 255, start_b = static_cast<unsigned int>(.5 + 255. * start_f); break;
-        case 3: start_g = static_cast<unsigned int>(.5 + 255. * start_q), start_b = 255; break; 
-        case 4: start_r = static_cast<unsigned int>(.5 + 255. * start_f), start_b = 255; break;
-        case 5: start_r = 255, start_b = static_cast<unsigned int>(.5 + 255. * start_q); break;
-        default: break;
-      }
+          double stop_f = stop_h * 6. - stop_i;
+          double stop_q = 1. - stop_f;
 
-      switch (stop_i % 6)
-      {
-        case 0: stop_r = 255, stop_g = static_cast<unsigned int>(.5 + 255. * stop_f); break;
-        case 1: stop_r = static_cast<unsigned int>(.5 + 255. * stop_q), stop_g = 255; break;
-        case 2: stop_g = 255, stop_b = static_cast<unsigned int>(.5 + 255. * stop_f); break;
-        case 3: stop_g = static_cast<unsigned int>(.5 + 255. * stop_q), stop_b = 255; break; 
-        case 4: stop_r = static_cast<unsigned int>(.5 + 255. * stop_f), stop_b = 255; break;
-        case 5: stop_r = 255, stop_b = static_cast<unsigned int>(.5 + 255. * stop_q); break;
-        default: break;
-      }
+          switch (start_i % 6)
+            {
+            case 0:
+              start_r = 255, start_g = static_cast<unsigned int>(.5 + 255. * start_f);
+              break;
+            case 1:
+              start_r = static_cast<unsigned int>(.5 + 255. * start_q), start_g = 255;
+              break;
+            case 2:
+              start_g = 255, start_b = static_cast<unsigned int>(.5 + 255. * start_f);
+              break;
+            case 3:
+              start_g = static_cast<unsigned int>(.5 + 255. * start_q), start_b = 255;
+              break;
+            case 4:
+              start_r = static_cast<unsigned int>(.5 + 255. * start_f), start_b = 255;
+              break;
+            case 5:
+              start_r = 255, start_b = static_cast<unsigned int>(.5 + 255. * start_q);
+              break;
+            default:
+              break;
+            }
 
-      Point<3> gradient_start_point_3d, gradient_stop_point_3d;
-
-      gradient_start_point_3d[0] = gradient_param[0];     
-      gradient_start_point_3d[1] = gradient_param[1];    
-      gradient_start_point_3d[2] = gradient_param[4];    
-
-      gradient_stop_point_3d[0] = gradient_param[2];     
-      gradient_stop_point_3d[1] = gradient_param[3];    
-      gradient_stop_point_3d[2] = gradient_param[5];  
-
-      Point<2> gradient_start_point = svg_project_point(gradient_start_point_3d, camera_position, camera_direction, camera_horizontal, camera_focus);
-      Point<2> gradient_stop_point = svg_project_point(gradient_stop_point_3d, camera_position, camera_direction, camera_horizontal, camera_focus);
-
-      // define linear gradient
-      out << "  <linearGradient id=\"" << triangle_counter << "\" gradientUnits=\"userSpaceOnUse\" "
-          << "x1=\"" 
-          << static_cast<unsigned int>(.5 + ((gradient_start_point[0] - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent)) 
-          << "\" " 
-          << "y1=\"" 
-          << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((gradient_start_point[1] - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent)) 
-          << "\" "
-          << "x2=\"" 
-          << static_cast<unsigned int>(.5 + ((gradient_stop_point[0] - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent)) 
-          << "\" "
-          << "y2=\"" 
-          << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((gradient_stop_point[1] - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent)) 
-          << "\""
-          << ">" << '\n'
-          << "   <stop offset=\"0\" style=\"stop-color:rgb(" << start_r << "," << start_g << "," << start_b << ")\"/>" << '\n'
-          << "   <stop offset=\"1\" style=\"stop-color:rgb(" << stop_r << "," << stop_g << "," << stop_b << ")\"/>" << '\n'
-          << "  </linearGradient>" << '\n';
-
-      // draw current triangle
-      double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
-      double x3 = cell->projected_center[0];
-      double y3 = cell->projected_center[1];
-   
-      switch (triangle_index)
-      {
-        case 0: x1 = cell->projected_vertices[0][0], y1 = cell->projected_vertices[0][1], x2 = cell->projected_vertices[1][0], y2 = cell->projected_vertices[1][1]; break;
-        case 1: x1 = cell->projected_vertices[1][0], y1 = cell->projected_vertices[1][1], x2 = cell->projected_vertices[3][0], y2 = cell->projected_vertices[3][1]; break;
-        case 2: x1 = cell->projected_vertices[3][0], y1 = cell->projected_vertices[3][1], x2 = cell->projected_vertices[2][0], y2 = cell->projected_vertices[2][1]; break;
-        case 3: x1 = cell->projected_vertices[2][0], y1 = cell->projected_vertices[2][1], x2 = cell->projected_vertices[0][0], y2 = cell->projected_vertices[0][1]; break;
-        default: break;
-      }
+          switch (stop_i % 6)
+            {
+            case 0:
+              stop_r = 255, stop_g = static_cast<unsigned int>(.5 + 255. * stop_f);
+              break;
+            case 1:
+              stop_r = static_cast<unsigned int>(.5 + 255. * stop_q), stop_g = 255;
+              break;
+            case 2:
+              stop_g = 255, stop_b = static_cast<unsigned int>(.5 + 255. * stop_f);
+              break;
+            case 3:
+              stop_g = static_cast<unsigned int>(.5 + 255. * stop_q), stop_b = 255;
+              break;
+            case 4:
+              stop_r = static_cast<unsigned int>(.5 + 255. * stop_f), stop_b = 255;
+              break;
+            case 5:
+              stop_r = 255, stop_b = static_cast<unsigned int>(.5 + 255. * stop_q);
+              break;
+            default:
+              break;
+            }
 
-      out << "  <path d=\"M " 
-          << static_cast<unsigned int>(.5 + ((x1 - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent)) 
-          << ' ' 
-          << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((y1 - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent)) 
-          << " L " 
-          << static_cast<unsigned int>(.5 + ((x2 - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent)) 
-          << ' ' 
-          << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((y2 - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent))
-          << " L " 
-          << static_cast<unsigned int>(.5 + ((x3 - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent)) 
-          << ' ' 
-          << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((y3 - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent)) 
-          << " L " 
-          << static_cast<unsigned int>(.5 + ((x1 - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent))
-          << ' ' 
-          << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((y1 - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent)) 
-          << "\" style=\"stroke:black; fill:url(#" << triangle_counter << "); stroke-width:" << flags.line_thickness << "\"/>" << '\n';
-
-      triangle_counter++;
+          Point<3> gradient_start_point_3d, gradient_stop_point_3d;
+
+          gradient_start_point_3d[0] = gradient_param[0];
+          gradient_start_point_3d[1] = gradient_param[1];
+          gradient_start_point_3d[2] = gradient_param[4];
+
+          gradient_stop_point_3d[0] = gradient_param[2];
+          gradient_stop_point_3d[1] = gradient_param[3];
+          gradient_stop_point_3d[2] = gradient_param[5];
+
+          Point<2> gradient_start_point = svg_project_point(gradient_start_point_3d, camera_position, camera_direction, camera_horizontal, camera_focus);
+          Point<2> gradient_stop_point = svg_project_point(gradient_stop_point_3d, camera_position, camera_direction, camera_horizontal, camera_focus);
+
+          // define linear gradient
+          out << "  <linearGradient id=\"" << triangle_counter << "\" gradientUnits=\"userSpaceOnUse\" "
+              << "x1=\""
+              << static_cast<unsigned int>(.5 + ((gradient_start_point[0] - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent))
+              << "\" "
+              << "y1=\""
+              << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((gradient_start_point[1] - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent))
+              << "\" "
+              << "x2=\""
+              << static_cast<unsigned int>(.5 + ((gradient_stop_point[0] - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent))
+              << "\" "
+              << "y2=\""
+              << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((gradient_stop_point[1] - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent))
+              << "\""
+              << ">" << '\n'
+              << "   <stop offset=\"0\" style=\"stop-color:rgb(" << start_r << "," << start_g << "," << start_b << ")\"/>" << '\n'
+              << "   <stop offset=\"1\" style=\"stop-color:rgb(" << stop_r << "," << stop_g << "," << stop_b << ")\"/>" << '\n'
+              << "  </linearGradient>" << '\n';
+
+          // draw current triangle
+          double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
+          double x3 = cell->projected_center[0];
+          double y3 = cell->projected_center[1];
+
+          switch (triangle_index)
+            {
+            case 0:
+              x1 = cell->projected_vertices[0][0], y1 = cell->projected_vertices[0][1], x2 = cell->projected_vertices[1][0], y2 = cell->projected_vertices[1][1];
+              break;
+            case 1:
+              x1 = cell->projected_vertices[1][0], y1 = cell->projected_vertices[1][1], x2 = cell->projected_vertices[3][0], y2 = cell->projected_vertices[3][1];
+              break;
+            case 2:
+              x1 = cell->projected_vertices[3][0], y1 = cell->projected_vertices[3][1], x2 = cell->projected_vertices[2][0], y2 = cell->projected_vertices[2][1];
+              break;
+            case 3:
+              x1 = cell->projected_vertices[2][0], y1 = cell->projected_vertices[2][1], x2 = cell->projected_vertices[0][0], y2 = cell->projected_vertices[0][1];
+              break;
+            default:
+              break;
+            }
+
+          out << "  <path d=\"M "
+              << static_cast<unsigned int>(.5 + ((x1 - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent))
+              << ' '
+              << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((y1 - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent))
+              << " L "
+              << static_cast<unsigned int>(.5 + ((x2 - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent))
+              << ' '
+              << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((y2 - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent))
+              << " L "
+              << static_cast<unsigned int>(.5 + ((x3 - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent))
+              << ' '
+              << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((y3 - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent))
+              << " L "
+              << static_cast<unsigned int>(.5 + ((x1 - x_min_perspective) / x_dimension_perspective) * (width - (width/100.) * 2. * margin_in_percent) + ((width/100.) * margin_in_percent))
+              << ' '
+              << static_cast<unsigned int>(.5 + height - (height/100.) * margin_in_percent - ((y1 - y_min_perspective) / y_dimension_perspective) * (height - (height/100.) * 2. * margin_in_percent))
+              << "\" style=\"stroke:black; fill:url(#" << triangle_counter << "); stroke-width:" << flags.line_thickness << "\"/>" << '\n';
+
+          triangle_counter++;
+        }
     }
-  }
 
 
 // draw the colorbar
   if (flags.draw_colorbar)
-  {
-    out << '\n' << " <!-- colorbar -->" << '\n';
+    {
+      out << '\n' << " <!-- colorbar -->" << '\n';
 
-    unsigned int element_height = static_cast<unsigned int>(((height/100.) * (71. - 2.*margin_in_percent)) / 4);
-    unsigned int element_width = static_cast<unsigned int>(.5 + (height/100.) * 2.5);
+      unsigned int element_height = static_cast<unsigned int>(((height/100.) * (71. - 2.*margin_in_percent)) / 4);
+      unsigned int element_width = static_cast<unsigned int>(.5 + (height/100.) * 2.5);
 
-    additional_width = 0;
-    if (!flags.margin) additional_width = static_cast<unsigned int>(.5 + (height/100.) * 2.5);
+      additional_width = 0;
+      if (!flags.margin) additional_width = static_cast<unsigned int>(.5 + (height/100.) * 2.5);
 
-    for (unsigned int index = 0; index < 4; index++)
-    {
-      double start_h = .667 - ((index+1) / 4.) * .667;
-      double stop_h = .667 - (index / 4.) * .667;  
+      for (unsigned int index = 0; index < 4; index++)
+        {
+          double start_h = .667 - ((index+1) / 4.) * .667;
+          double stop_h = .667 - (index / 4.) * .667;
 
-      unsigned int start_r = 0;
-      unsigned int start_g = 0;
-      unsigned int start_b = 0;
+          unsigned int start_r = 0;
+          unsigned int start_g = 0;
+          unsigned int start_b = 0;
 
-      unsigned int stop_r = 0;
-      unsigned int stop_g = 0;
-      unsigned int stop_b = 0;
+          unsigned int stop_r = 0;
+          unsigned int stop_g = 0;
+          unsigned int stop_b = 0;
 
-      unsigned int start_i = static_cast<unsigned int>(start_h * 6.);
-      unsigned int stop_i = static_cast<unsigned int>(stop_h * 6.);
+          unsigned int start_i = static_cast<unsigned int>(start_h * 6.);
+          unsigned int stop_i = static_cast<unsigned int>(stop_h * 6.);
 
-      double start_f = start_h * 6. - start_i;
-      double start_q = 1. - start_f;
+          double start_f = start_h * 6. - start_i;
+          double start_q = 1. - start_f;
 
-      double stop_f = stop_h * 6. - stop_i;
-      double stop_q = 1. - stop_f;
+          double stop_f = stop_h * 6. - stop_i;
+          double stop_q = 1. - stop_f;
 
-      switch (start_i % 6)
-      {
-        case 0: start_r = 255, start_g = static_cast<unsigned int>(.5 + 255. * start_f); break;
-        case 1: start_r = static_cast<unsigned int>(.5 + 255. * start_q), start_g = 255; break;
-        case 2: start_g = 255, start_b = static_cast<unsigned int>(.5 + 255. * start_f); break;
-        case 3: start_g = static_cast<unsigned int>(.5 + 255. * start_q), start_b = 255; break; 
-        case 4: start_r = static_cast<unsigned int>(.5 + 255. * start_f), start_b = 255; break;
-        case 5: start_r = 255, start_b = static_cast<unsigned int>(.5 + 255. * start_q); break;
-        default: break;
-      }
+          switch (start_i % 6)
+            {
+            case 0:
+              start_r = 255, start_g = static_cast<unsigned int>(.5 + 255. * start_f);
+              break;
+            case 1:
+              start_r = static_cast<unsigned int>(.5 + 255. * start_q), start_g = 255;
+              break;
+            case 2:
+              start_g = 255, start_b = static_cast<unsigned int>(.5 + 255. * start_f);
+              break;
+            case 3:
+              start_g = static_cast<unsigned int>(.5 + 255. * start_q), start_b = 255;
+              break;
+            case 4:
+              start_r = static_cast<unsigned int>(.5 + 255. * start_f), start_b = 255;
+              break;
+            case 5:
+              start_r = 255, start_b = static_cast<unsigned int>(.5 + 255. * start_q);
+              break;
+            default:
+              break;
+            }
 
-      switch (stop_i % 6)
-      {
-        case 0: stop_r = 255, stop_g = static_cast<unsigned int>(.5 + 255. * stop_f); break;
-        case 1: stop_r = static_cast<unsigned int>(.5 + 255. * stop_q), stop_g = 255; break;
-        case 2: stop_g = 255, stop_b = static_cast<unsigned int>(.5 + 255. * stop_f); break;
-        case 3: stop_g = static_cast<unsigned int>(.5 + 255. * stop_q), stop_b = 255; break; 
-        case 4: stop_r = static_cast<unsigned int>(.5 + 255. * stop_f), stop_b = 255; break;
-        case 5: stop_r = 255, stop_b = static_cast<unsigned int>(.5 + 255. * stop_q); break;
-        default: break;
-      }
+          switch (stop_i % 6)
+            {
+            case 0:
+              stop_r = 255, stop_g = static_cast<unsigned int>(.5 + 255. * stop_f);
+              break;
+            case 1:
+              stop_r = static_cast<unsigned int>(.5 + 255. * stop_q), stop_g = 255;
+              break;
+            case 2:
+              stop_g = 255, stop_b = static_cast<unsigned int>(.5 + 255. * stop_f);
+              break;
+            case 3:
+              stop_g = static_cast<unsigned int>(.5 + 255. * stop_q), stop_b = 255;
+              break;
+            case 4:
+              stop_r = static_cast<unsigned int>(.5 + 255. * stop_f), stop_b = 255;
+              break;
+            case 5:
+              stop_r = 255, stop_b = static_cast<unsigned int>(.5 + 255. * stop_q);
+              break;
+            default:
+              break;
+            }
 
-      // define gradient
-      out << "  <linearGradient id=\"colorbar_" << index << "\" gradientUnits=\"userSpaceOnUse\" "
-          << "x1=\"" << width + additional_width << "\" " 
-          << "y1=\"" << static_cast<unsigned int>(.5 + (height/100.) * (margin_in_percent + 29)) + (3-index) * element_height << "\" "
-          << "x2=\"" << width + additional_width << "\" "
-          << "y2=\"" << static_cast<unsigned int>(.5 + (height/100.) * (margin_in_percent + 29)) + (4-index) * element_height << "\""
-          << ">" << '\n'
-          << "   <stop offset=\"0\" style=\"stop-color:rgb(" << start_r << "," << start_g << "," << start_b << ")\"/>" << '\n'
-          << "   <stop offset=\"1\" style=\"stop-color:rgb(" << stop_r << "," << stop_g << "," << stop_b << ")\"/>" << '\n'
-          << "  </linearGradient>" << '\n';          
-
-      // draw box corresponding to the gradient above
-      out << "  <rect" 
-          << " x=\"" << width + additional_width
-          << "\" y=\"" << static_cast<unsigned int>(.5 + (height/100.) * (margin_in_percent + 29)) + (3-index) * element_height
-          << "\" width=\"" << element_width
-          << "\" height=\"" << element_height
-          << "\" style=\"stroke:black; stroke-width:2; fill:url(#colorbar_" << index << ")\"/>" << '\n';
-    }
-    
-    for (unsigned int index = 0; index < 5; index++)
-    {
-      out << "  <text x=\"" << width + additional_width + static_cast<unsigned int>(1.5 * element_width)
-          << "\" y=\"" << static_cast<unsigned int>(.5 + (height/100.) * (margin_in_percent + 29) + (4.-index) * element_height + 30.) << "\""
-          << " style=\"text-anchor:start; font-size:80; font-family:Helvetica";
+          // define gradient
+          out << "  <linearGradient id=\"colorbar_" << index << "\" gradientUnits=\"userSpaceOnUse\" "
+              << "x1=\"" << width + additional_width << "\" "
+              << "y1=\"" << static_cast<unsigned int>(.5 + (height/100.) * (margin_in_percent + 29)) + (3-index) * element_height << "\" "
+              << "x2=\"" << width + additional_width << "\" "
+              << "y2=\"" << static_cast<unsigned int>(.5 + (height/100.) * (margin_in_percent + 29)) + (4-index) * element_height << "\""
+              << ">" << '\n'
+              << "   <stop offset=\"0\" style=\"stop-color:rgb(" << start_r << "," << start_g << "," << start_b << ")\"/>" << '\n'
+              << "   <stop offset=\"1\" style=\"stop-color:rgb(" << stop_r << "," << stop_g << "," << stop_b << ")\"/>" << '\n'
+              << "  </linearGradient>" << '\n';
+
+          // draw box corresponding to the gradient above
+          out << "  <rect"
+              << " x=\"" << width + additional_width
+              << "\" y=\"" << static_cast<unsigned int>(.5 + (height/100.) * (margin_in_percent + 29)) + (3-index) * element_height
+              << "\" width=\"" << element_width
+              << "\" height=\"" << element_height
+              << "\" style=\"stroke:black; stroke-width:2; fill:url(#colorbar_" << index << ")\"/>" << '\n';
+        }
+
+      for (unsigned int index = 0; index < 5; index++)
+        {
+          out << "  <text x=\"" << width + additional_width + static_cast<unsigned int>(1.5 * element_width)
+              << "\" y=\"" << static_cast<unsigned int>(.5 + (height/100.) * (margin_in_percent + 29) + (4.-index) * element_height + 30.) << "\""
+              << " style=\"text-anchor:start; font-size:80; font-family:Helvetica";
 
-      if (index == 0 || index == 4) out << "; font-weight:bold";
+          if (index == 0 || index == 4) out << "; font-weight:bold";
 
-      out << "\">" << (float)(((int)((z_min + index * (z_dimension / 4.))*10000))/10000.);
+          out << "\">" << (float)(((int)((z_min + index * (z_dimension / 4.))*10000))/10000.);
 
-      if (index == 4) out << " max";
-      if (index == 0) out << " min";
+          if (index == 4) out << " max";
+          if (index == 0) out << " min";
 
-      out << "</text>" << '\n';
+          out << "</text>" << '\n';
+        }
     }
-  }
 
   // finalize the svg file
   out << '\n' << "</svg>";
index aa82ba52fe5784083c65bc820bb4366bafb9a3b8..f7cb35146870fade32721f56436656e6c564f42e 100644 (file)
@@ -1,3 +1,19 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 /*
  * Workaround for a bug in the Xcode generator.
  *
index 4c890e4a495905a887eaca304cdf32a2c41aec4d..fa701dff1494b8a00774f659674692546364f403 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/event.h>
 
index 10526f1b3d442aad9f4046f9df435bdcb8fe49f1..89350862fc7fc47bdba77836239f0a44c99c0f77 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 2000, 2001, 2002, 2003, 2005, 2006, 2009, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/logstream.h>
index 707417138a43c7051d1be6ad0374dbfc08977961..92c3b9d727f1614880e74b4bdbe703e77f24b257 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/tensor.h>
 #include <deal.II/base/point.h>
index 17187a03e4197aa87bf9a28e3a7c46cf1e9493f4..40c7f30af2f2c6421c08b1dbfe113205fb6852db 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/function.h>
 #include <deal.II/base/tensor_function.h>
@@ -591,7 +593,7 @@ vector_value (const Point<dim>   &p,
  * to be size <tt>n_components</tt>.
  */
 template <int dim>
-VectorFunctionFromTensorFunction<dim>::VectorFunctionFromTensorFunction (const TensorFunction<1,dim>tensor_function,
+VectorFunctionFromTensorFunction<dim>::VectorFunctionFromTensorFunction (const TensorFunction<1,dim> &tensor_function,
     const unsigned int selected_component,
     const unsigned int n_components)
   :
index cfa5c9f20a96fe0d5e93a110a0be457cfc664b39..9fc7182c2633aa4461cecc1b7c8a9da12b1af02c 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/point.h>
 #include <deal.II/base/function_derivative.h>
index d7df931caa67998bec9b308b117f1a884b49aacb..a1b5efd521931e04a1e1c1f124e8d8fb5df89add 100644 (file)
@@ -1,15 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/tensor.h>
 #include <deal.II/base/point.h>
index 51c933bfd08ca740436df03f64f053b68bc9e118..f832590c98fb29824a6a8438e917e70cb31e39b6 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/tensor.h>
 #include <deal.II/base/point.h>
index 8c6095384e3ca6136411bed6ea279dd04ec5e372..c26b0594e5c7686ac310b7719a86338a930d4a3b 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2009, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/function_parser.h>
 #include <deal.II/base/utilities.h>
index 3c26216f955053475a10a323b9e67d1ec7a6a84a..b726a6551e57d7281b987f92d984267c0f1ab355 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/function_time.h>
 
index 60c190ee1e5f4936cc42fe4f219676a92bef3114..b8223630f03b5cfe8521c3ddb99832e7f86ae6d2 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/geometry_info.h>
 #include <deal.II/base/tensor.h>
index 0767f106f9c4e5d6121239e56160de65526928e7..bf373ddd5f163c3eee3a3da8e37a1236aeea9810 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//      $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/index_set.h>
@@ -42,8 +44,8 @@ IndexSet::do_compress () const
       next = i;
       ++next;
 
-      unsigned int first_index = i->begin;
-      unsigned int last_index  = i->end;
+      types::global_dof_index first_index = i->begin;
+      types::global_dof_index last_index  = i->end;
 
       // see if we can merge any of
       // the following ranges
@@ -72,7 +74,7 @@ IndexSet::do_compress () const
 
   // now compute indices within set and the
   // range with most elements
-  unsigned int next_index = 0, largest_range_size = 0;
+  types::global_dof_index next_index = 0, largest_range_size = 0;
   for (std::vector<Range>::iterator
        i = ranges.begin();
        i != ranges.end();
@@ -174,8 +176,8 @@ IndexSet::n_intervals () const
 
 
 IndexSet
-IndexSet::get_view (const unsigned int begin,
-                    const unsigned int end) const
+IndexSet::get_view (const types::global_dof_index begin,
+                    const types::global_dof_index end) const
 {
   Assert (begin <= end,
           ExcMessage ("End index needs to be larger or equal to begin index!"));
@@ -225,12 +227,15 @@ IndexSet::write(std::ostream &out) const
 void
 IndexSet::read(std::istream &in)
 {
-  unsigned int s, numranges, b, e;
+  types::global_dof_index s;
+  unsigned int numranges;
+
   in >> s >> numranges;
   ranges.clear();
   set_size(s);
   for (unsigned int i=0; i<numranges; ++i)
     {
+      types::global_dof_index b, e;
       in >> b >> e;
       add_range(b,e);
     }
@@ -255,7 +260,7 @@ IndexSet::block_write(std::ostream &out) const
 void
 IndexSet::block_read(std::istream &in)
 {
-  unsigned int size;
+  types::global_dof_index size;
   size_t n_ranges;
   in.read(reinterpret_cast<char *>(&size), sizeof(size));
   in.read(reinterpret_cast<char *>(&n_ranges), sizeof(n_ranges));
@@ -351,7 +356,7 @@ IndexSet::subtract_set (const IndexSet &other)
 }
 
 
-void IndexSet::fill_index_vector(std::vector<unsigned int> &indices) const
+void IndexSet::fill_index_vector(std::vector<types::global_dof_index> &indices) const
 {
   compress();
 
@@ -361,7 +366,7 @@ void IndexSet::fill_index_vector(std::vector<unsigned int> &indices) const
   for (std::vector<Range>::iterator it = ranges.begin();
        it != ranges.end();
        ++it)
-    for (unsigned int i=it->begin; i<it->end; ++i)
+    for (types::global_dof_index i=it->begin; i<it->end; ++i)
       indices.push_back (i);
 
   Assert (indices.size() == n_elements(), ExcInternalError());
@@ -380,8 +385,8 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator,
   compress ();
 
   if ((is_contiguous() == true) && (!overlapping))
-    return Epetra_Map (static_cast<int>(size()),
-                       static_cast<int>(n_elements()),
+    return Epetra_Map (TrilinosWrappers::types::int_type(size()),
+                       TrilinosWrappers::types::int_type(n_elements()),
                        0,
 #ifdef DEAL_II_WITH_MPI
                        Epetra_MpiComm(communicator));
@@ -390,14 +395,14 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator,
 #endif
   else
     {
-      std::vector<unsigned int> indices;
+      std::vector<types::global_dof_index> indices;
       fill_index_vector(indices);
 
-      return Epetra_Map (-1,
-                         static_cast<int>(n_elements()),
+      return Epetra_Map (TrilinosWrappers::types::int_type(-1),
+                         TrilinosWrappers::types::int_type(n_elements()),
                          (n_elements() > 0
                           ?
-                          reinterpret_cast<int *>(&indices[0])
+                          reinterpret_cast<TrilinosWrappers::types::int_type *>(&indices[0])
                           :
                           0),
                          0,
@@ -417,9 +422,9 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator,
 std::size_t
 IndexSet::memory_consumption () const
 {
-  return MemoryConsumption::memory_consumption (ranges) +
-         MemoryConsumption::memory_consumption (is_compressed) +
-         MemoryConsumption::memory_consumption (index_space_size);
+  return (MemoryConsumption::memory_consumption (ranges) +
+          MemoryConsumption::memory_consumption (is_compressed) +
+          MemoryConsumption::memory_consumption (index_space_size));
 }
 
 
index 9905187512acdeda67067e67f5312640cff562e4..c347ce317d5601db430555757579a74608222eb0 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/job_identifier.h>
 #include <ctime>
index e0fc350cf5194ff218d7147bffbe5b94701524de..ba7f8773f35290d9948b6518ba1cbf0d0c167966 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/job_identifier.h>
@@ -147,10 +149,10 @@ LogStream::operator<< (std::ostream& (*p) (std::ostream &))
       if (at_newline)
         print_line_head();
 
-      if(p == p_flush)
+      if (p == p_flush)
         at_newline = false;
 
-      if(p == p_endl)
+      if (p == p_endl)
         at_newline = true;
 
       if (get_prefixes().size() <= std_depth)
@@ -226,14 +228,22 @@ LogStream::has_file() const
 const std::string &
 LogStream::get_prefix() const
 {
-  return get_prefixes().top();
+  static std::string empty_string;
+
+  if (get_prefixes().size() > 0)
+    return get_prefixes().top();
+  else
+    return empty_string;
 }
 
 
 void
 LogStream::push (const std::string &text)
 {
-  std::string pre=get_prefixes().top();
+  std::string pre;
+  if (get_prefixes().size() > 0)
+    pre = get_prefixes().top();
+
   pre += text;
   pre += std::string(":");
   get_prefixes().push(pre);
@@ -242,7 +252,7 @@ LogStream::push (const std::string &text)
 
 void LogStream::pop ()
 {
-  if (get_prefixes().size() > 1)
+  if (get_prefixes().size() > 0)
     get_prefixes().pop();
 }
 
@@ -342,7 +352,7 @@ LogStream::get_prefixes() const
 
   // If this is a new locally stored stack, copy the "blessed" prefixes
   // from the initial thread that created logstream.
-  if(! exists)
+  if (! exists)
     {
       const tbb::enumerable_thread_specific<std::stack<std::string> > &impl
         = prefixes.get_implementation();
@@ -436,7 +446,8 @@ LogStream::print_line_head()
       if (print_thread_id)
         *std_out << '[' << thread << ']';
 
-      *std_out <<  head << ':';
+      if (head.size() > 0)
+        *std_out <<  head << ':';
     }
 
   if (file && (get_prefixes().size() <= file_depth))
@@ -453,7 +464,8 @@ LogStream::print_line_head()
       if (print_thread_id)
         *file << '[' << thread << ']';
 
-      *file << head << ':';
+      if (head.size() > 0)
+        *file << head << ':';
     }
 }
 
index 8ecaa085f6b8ea9fb75c322f4615adf1d50ccb8d..ab523c41431616dca7f2b75992db513fbe8b4272 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 
index 4a1c99c7bbf03a074df082233ebba819f1c48d72..663d647dad9f4030a1128c2a1a715259ec55886f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//      $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/mpi.h>
 #include <deal.II/base/utilities.h>
@@ -308,10 +312,10 @@ namespace Utilities
 
 
     MPI_InitFinalize::MPI_InitFinalize (int    &argc,
-                       char ** &argv,
-                       unsigned int max_num_threads)
-    :
-        owns_mpi (true)
+                                        char ** &argv,
+                                        unsigned int max_num_threads)
+      :
+      owns_mpi (true)
     {
       do_init(argc, argv, max_num_threads);
     }
@@ -330,8 +334,8 @@ namespace Utilities
 
     void
     MPI_InitFinalize::do_init(int    &argc,
-              char ** &argv,
-              unsigned int max_num_threads)
+                              char ** &argv,
+                              unsigned int max_num_threads)
     {
       static bool constructor_has_already_run = false;
       Assert (constructor_has_already_run == false,
@@ -418,8 +422,8 @@ namespace Utilities
           // or just end PETSc.
           PetscFinalize();
 #  endif
-       }
-#endif   
+        }
+#endif
 
 
       // only MPI_Finalize if we are running with MPI and we are not using PETSc
index f871f7bf4778ac7b3bbee019aacbae9b67cc6b4c..e79373d0aaffbd2be1062d7fa1ca568b632c552d 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/multithread_info.h>
 #include <deal.II/base/utilities.h>
@@ -100,7 +102,7 @@ unsigned int MultithreadInfo::get_n_cpus()
 void MultithreadInfo::set_thread_limit(const unsigned int max_threads)
 {
   unsigned int max_threads_env = numbers::invalid_unsigned_int;
-  charpenv;
+  char *penv;
   penv = getenv ("DEAL_II_NUM_THREADS");
 
   if (penv!=NULL)
@@ -110,9 +112,9 @@ void MultithreadInfo::set_thread_limit(const unsigned int max_threads)
   if (n_max_threads == numbers::invalid_unsigned_int)
     n_max_threads = tbb::task_scheduler_init::default_num_threads();
   else
-  {
+    {
       static tbb::task_scheduler_init dummy (n_max_threads);
-  }
+    }
 }
 
 bool MultithreadInfo::is_running_single_threaded()
index 3213ecb19bb96fc8864ca0cadefd06198fe997a8..8878471bb4850a31559cbae76ef619f1982bf857 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/parallel.h>
 
index 6268cca6175af63322c0b990bfea5a9450f48439..6a8c426d4e86bbdbebcd228a45499f102bd5efcb 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/parameter_handler.h>
 #include <deal.II/base/logstream.h>
@@ -1081,20 +1085,20 @@ ParameterHandler::mangle (const std::string &s)
   for (unsigned int i=0; i<s.size(); ++i)
     {
       static const std::string allowed_characters
-       ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
+      ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
 
       if ((! mangle_whole_string)
-         &&
-         (allowed_characters.find (s[i]) != std::string::npos))
-       u.push_back (s[i]);
+          &&
+          (allowed_characters.find (s[i]) != std::string::npos))
+        u.push_back (s[i]);
       else
-       {
-         u.push_back ('_');
-         static const char hex[16]
-           = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
-         u.push_back (hex[static_cast<unsigned char>(s[i])/16]);
-         u.push_back (hex[static_cast<unsigned char>(s[i])%16]);
-       }
+        {
+          u.push_back ('_');
+          static const char hex[16]
+            = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
+          u.push_back (hex[static_cast<unsigned char>(s[i])/16]);
+          u.push_back (hex[static_cast<unsigned char>(s[i])%16]);
+        }
     }
 
   return u;
index 42540badf2967455f16ea16d8fb1ebee6922d492..14b975a039a0e4ddde600b0ef24c818256a9092d 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #include <deal.II/base/parsed_function.h>
 #include <deal.II/base/utilities.h>
 
index 40cb4ebd1af92d568aeca33bc46bb3027253be6c..bd9748bc5b7bf813dad3c51a53a3414e0347b137 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/partitioner.h>
 
@@ -208,8 +210,8 @@ namespace Utilities
           unsigned int current_index = expanded_ghost_indices[0];
           while (current_index >= first_index[current_proc+1])
             current_proc++;
-          std::vector<std::pair<unsigned int,unsigned int> > ghost_targets_temp
-          (1, std::pair<unsigned int, unsigned int>(current_proc, 0));
+          std::vector<std::pair<unsigned int,types::global_dof_index> > ghost_targets_temp
+          (1, std::pair<unsigned int, types::global_dof_index>(current_proc, 0));
           n_ghost_targets++;
 
           for (unsigned int iterator=1; iterator<n_ghost_indices_data; ++iterator)
@@ -223,7 +225,7 @@ namespace Utilities
                   ghost_targets_temp[n_ghost_targets-1].second =
                     iterator - ghost_targets_temp[n_ghost_targets-1].second;
                   ghost_targets_temp.push_back(std::pair<unsigned int,
-                                               unsigned int>(current_proc,iterator));
+                                               types::global_dof_index>(current_proc,iterator));
                   n_ghost_targets++;
                 }
             }
@@ -243,14 +245,14 @@ namespace Utilities
                       MPI_INT, communicator);
 
         // allocate memory for import data
-        std::vector<std::pair<unsigned int,unsigned int> > import_targets_temp;
+        std::vector<std::pair<unsigned int,types::global_dof_index> > import_targets_temp;
         n_import_indices_data = 0;
         for (unsigned int i=0; i<n_procs; i++)
           if (receive_buffer[i] > 0)
             {
               n_import_indices_data += receive_buffer[i];
               import_targets_temp.push_back(std::pair<unsigned int,
-                                            unsigned int> (i, receive_buffer[i]));
+                                            types::global_dof_index> (i, receive_buffer[i]));
             }
         import_targets_data = import_targets_temp;
       }
@@ -292,22 +294,22 @@ namespace Utilities
         // space and compress contiguous indices in
         // form of ranges
         {
-          unsigned int last_index = numbers::invalid_unsigned_int-1;
-          std::vector<std::pair<unsigned int,unsigned int> > compressed_import_indices;
+          types::global_dof_index last_index = numbers::invalid_dof_index-1;
+          std::vector<std::pair<types::global_dof_index,types::global_dof_index> > compressed_import_indices;
           for (unsigned int i=0; i<n_import_indices_data; i++)
             {
               Assert (expanded_import_indices[i] >= local_range_data.first &&
                       expanded_import_indices[i] < local_range_data.second,
                       ExcIndexRange(expanded_import_indices[i], local_range_data.first,
                                     local_range_data.second));
-              unsigned int new_index = (expanded_import_indices[i] -
-                                        local_range_data.first);
+              types::global_dof_index new_index = (expanded_import_indices[i] -
+                                                   local_range_data.first);
               if (new_index == last_index+1)
                 compressed_import_indices.back().second++;
               else
                 {
                   compressed_import_indices.push_back
-                  (std::pair<unsigned int,unsigned int>(new_index,new_index+1));
+                  (std::pair<types::global_dof_index,types::global_dof_index>(new_index,new_index+1));
                 }
               last_index = new_index;
             }
@@ -315,7 +317,7 @@ namespace Utilities
 
           // sanity check
 #ifdef DEBUG
-          const unsigned int n_local_dofs = local_range_data.second-local_range_data.first;
+          const types::global_dof_index n_local_dofs = local_range_data.second-local_range_data.first;
           for (unsigned int i=0; i<import_indices_data.size(); ++i)
             {
               AssertIndexRange (import_indices_data[i].first, n_local_dofs);
index ea90d33df53a69ed21aa10b2e43238ae92430997..6d3e0a5eef0f2e44ef70a7a220f02fbd7e391679 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//      $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/path_search.h>
 #include <deal.II/base/logstream.h>
index 7d399b31c03862f87da2a69986f406583af5c8d8..cd0b61f7e9068f6adc398770bfa10b61a6717309 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//      $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/polynomial.h>
 #include <deal.II/base/point.h>
index 2852f213af8d00b8057342e034cbe1d1794f0d99..50d465f92bbde46761c84263a8f48221cb646d6d 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/polynomial_space.h>
 #include <deal.II/base/exceptions.h>
index 4d40d68db7bc5083f8a8b9394ec1ebf09dd13015..1486a67e7ecd65a73febac95c103a306444c638b 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/polynomials_abf.h>
 #include <deal.II/base/quadrature_lib.h>
index fe385f82ce3fc94b88da865cb544a99fd7ad6815..bd9519847afd08576eed6d5ca1f52a7a595048ed 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/polynomials_adini.h>
 
index f1b1f2adda8668a7f7453e3a3d4aa1828b0fe4f6..09eefae3e63524ab4110c6ebf4766bc500e2d2a1 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/polynomials_bdm.h>
 #include <deal.II/base/quadrature_lib.h>
index c49950f954c7e0ea0b84e6494de294def9b0624c..2bd51e6643dbe4da947d35186ec7f7192dd52b75 100644 (file)
@@ -1,3 +1,19 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #include <deal.II/base/geometry_info.h>
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/polynomial.h>
index 93ddc1d51dab11b4c0c1727ca2b8854abf679c04..51112449d03db085bd7802ad753fe53443a562e1 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/polynomials_p.h>
 
index 70a259ffa4b18442a6f4a8c46ff308e528398e9b..facd24773541be9e1c49ab4bfa2aa68560b5f109 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//      $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/polynomials_piecewise.h>
 
@@ -72,7 +74,7 @@ namespace Polynomials
               }
           }
         else
-          { 
+          {
             const double offset = step * interval;
             if (x<offset || x>offset+step)
               {
index 367b2443e16f9af05ac5cd414db5f3d4729e53c0..e880e1c38f51081ec08c25d764815f95daedd25a 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/polynomials_raviart_thomas.h>
 #include <deal.II/base/quadrature_lib.h>
index df037e405f546f1ba0bc9f16dd8afb414a5d7ebe..ef9aa1bf2b75df70d8b8a41c39bb420b66bf5a90 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/geometry_info.h>
 #include <deal.II/base/quadrature.h>
index bee1e324b09e5684a967983439240c0207b013f3..bd328b4e002e50c5617d1a256fe09daa9eac063b 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/geometry_info.h>
index 0d5b8054f425ccf7856a30157690749db4c39866..e417c10f30cf0bbe1db6cd72b58313012babaa6c 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/quadrature_selector.h>
 #include <deal.II/base/quadrature_lib.h>
index 17278853fae2a7d8098ea23a006a788c166281b9..fa2af252e4140a848fa2c537dfe7244a21d72757 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/thread_management.h>
 #include <deal.II/base/subscriptor.h>
@@ -69,13 +71,6 @@ Subscriptor::~Subscriptor ()
   // running the c++filt program over
   // the output.
 #ifdef DEBUG
-  std::string infostring;
-  for (map_iterator it = counter_map.begin(); it != counter_map.end(); ++it)
-    {
-      if (it->second > 0)
-        infostring += std::string("\n  from Subscriber ")
-                      + std::string(it->first);
-    }
 
   // if there are still active pointers, show
   // a message and kill the program. However,
@@ -99,6 +94,17 @@ Subscriptor::~Subscriptor ()
     {
       if (std::uncaught_exception() == false)
         {
+          std::string infostring;
+          for (map_iterator it = counter_map.begin(); it != counter_map.end(); ++it)
+            {
+              if (it->second > 0)
+                infostring += std::string("\n  from Subscriber ")
+                              + std::string(it->first);
+            }
+
+          if (infostring == "")
+            infostring = "<none>";
+
           Assert (counter == 0,
                   ExcInUse (counter, object_info->name(), infostring));
         }
index e28632398181d5072b50c19e7720c0cb061108a0..6df63ebf92ab7d50badd7ba8b35f61aeec4cdbd0 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/symmetric_tensor.h>
 
index d9b500718c7f0a7903f46ad045558e4aa91f0061..aed67bee637e93477d67317d8ec70181dcb5b30e 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/table_handler.h>
 #include <deal.II/base/table.h>
index ec2d4a1a378adb19083fb5b54321ba59b8aaa5ce..93c80d0eb2dd622570bacadb0582d219fa693a61 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/tensor_function.h>
 #include <vector>
@@ -21,6 +23,7 @@
 DEAL_II_NAMESPACE_OPEN
 
 
+
 //////////////////////////////////////////////////////////////////////
 // TensorFunction
 //////////////////////////////////////////////////////////////////////
@@ -82,6 +85,90 @@ TensorFunction<rank, dim>::gradient_list (const std::vector<Point<dim> >   &poin
 }
 
 
+
+//////////////////////////////////////////////////////////////////////
+// ConstantTensorFunction
+//////////////////////////////////////////////////////////////////////
+
+
+template <int rank, int dim>
+ConstantTensorFunction<rank, dim>::ConstantTensorFunction (const Tensor<rank, dim> &value,
+                                                           const double initial_time)
+  :
+  TensorFunction<rank, dim> (initial_time),
+  _value(value)
+{}
+
+
+template <int rank, int dim>
+ConstantTensorFunction<rank, dim>::~ConstantTensorFunction ()
+{}
+
+
+template <int rank, int dim>
+typename TensorFunction<rank, dim>::value_type
+ConstantTensorFunction<rank, dim>::value (const Point<dim> &/*point*/) const
+{
+  return _value;
+}
+
+
+template <int rank, int dim>
+void
+ConstantTensorFunction<rank, dim>::value_list (const std::vector<Point<dim> > &points,
+                                               std::vector<typename TensorFunction<rank, dim>::value_type> &values) const
+{
+  Assert (values.size() == points.size(),
+          ExcDimensionMismatch(values.size(), points.size()));
+
+  for (unsigned int i=0; i<values.size(); ++i)
+    values[i]  = _value;
+}
+
+
+template <int rank, int dim>
+typename TensorFunction<rank, dim>::gradient_type
+ConstantTensorFunction<rank, dim>::gradient (const Point<dim> &) const
+{
+  static const Tensor<rank+1,dim> zero;
+
+  return zero;
+}
+
+
+template <int rank, int dim>
+void
+ConstantTensorFunction<rank, dim>::gradient_list (const std::vector<Point<dim> >   &points,
+                                                  std::vector<typename TensorFunction<rank, dim>::gradient_type> &gradients) const
+{
+  Assert (gradients.size() == points.size(),
+          ExcDimensionMismatch(gradients.size(), points.size()));
+
+  static const Tensor<rank+1,dim> zero;
+
+  for (unsigned int i=0; i<gradients.size(); ++i)
+    gradients[i] = zero;
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+// ZeroTensorFunction
+//////////////////////////////////////////////////////////////////////
+
+
+template <int rank, int dim>
+ZeroTensorFunction<rank, dim>::ZeroTensorFunction (const double initial_time)
+  :
+  ConstantTensorFunction<rank, dim> (dealii::Tensor<rank, dim>(), initial_time)
+{}
+
+
+
+//////////////////////////////////////////////////////////////////////
+// Explicit instantiations:
+//////////////////////////////////////////////////////////////////////
+
 template class TensorFunction<1,1>;
 template class TensorFunction<2,1>;
 template class TensorFunction<3,1>;
@@ -95,4 +182,31 @@ template class TensorFunction<2,3>;
 template class TensorFunction<3,3>;
 template class TensorFunction<4,3>;
 
+template class ConstantTensorFunction<1,1>;
+template class ConstantTensorFunction<2,1>;
+template class ConstantTensorFunction<3,1>;
+template class ConstantTensorFunction<4,1>;
+template class ConstantTensorFunction<1,2>;
+template class ConstantTensorFunction<2,2>;
+template class ConstantTensorFunction<3,2>;
+template class ConstantTensorFunction<4,2>;
+template class ConstantTensorFunction<1,3>;
+template class ConstantTensorFunction<2,3>;
+template class ConstantTensorFunction<3,3>;
+template class ConstantTensorFunction<4,3>;
+
+template class ZeroTensorFunction<1,1>;
+template class ZeroTensorFunction<2,1>;
+template class ZeroTensorFunction<3,1>;
+template class ZeroTensorFunction<4,1>;
+template class ZeroTensorFunction<1,2>;
+template class ZeroTensorFunction<2,2>;
+template class ZeroTensorFunction<3,2>;
+template class ZeroTensorFunction<4,2>;
+template class ZeroTensorFunction<1,3>;
+template class ZeroTensorFunction<2,3>;
+template class ZeroTensorFunction<3,3>;
+template class ZeroTensorFunction<4,3>;
+
+
 DEAL_II_NAMESPACE_CLOSE
index 7a9329fa1a2f0f1766cff0d156ee28382161a460..318f022658fa46e0ea3f8fce0f0fad94451888a3 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/tensor_product_polynomials.h>
 #include <deal.II/base/polynomials_piecewise.h>
@@ -33,7 +35,7 @@ namespace internal
     void compute_tensor_index(const unsigned int,
                               const unsigned int,
                               const unsigned int,
-                              unsigned int      (&)[dim])
+                              unsigned int      ( &)[dim])
     {
       Assert(false, ExcNotImplemented());
     }
index 6d6e6876b2fa5db755c767a3e30364ceb79eed7e..724114c4ad74e9b053bdea893a93f798a18f83f7 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id: trilinos_sparse_matrix.cc 27985 2013-01-08 21:36:23Z bangerth $
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012, 2013 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/tensor_product_polynomials_const.h>
 #include <deal.II/base/exceptions.h>
index 47a38591209d22a42ca4d5dcc97079135a033de9..5f9d75edc88606d0ef3f0b9e36b83e638567b930 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/thread_management.h>
 
index 2c0b9cf2f9b13270e010362b3be946088f3cf4ca..d931000e8296ad411d1cc5098fac2138322b1507 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/timer.h>
 #include <deal.II/base/exceptions.h>
@@ -329,7 +331,7 @@ TimerOutput::~TimerOutput()
     leave_subsection();
 
   if ( (output_frequency == summary || output_frequency == every_call_and_summary)
-      && output_is_enabled == true)
+       && output_is_enabled == true)
     print_summary();
 }
 
index 47db7dd009eb2fb99c9a11a60f569c2cc60736b7..16c8d1ab31a06b239fa209b65df09b250c0e4c1c 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//      $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/exceptions.h>
@@ -464,6 +468,82 @@ namespace Utilities
     return out;
   }
 
+  std::vector<unsigned long long int>
+  reverse_permutation (const std::vector<unsigned long long int> &permutation)
+  {
+    const unsigned long long int n = permutation.size();
+
+    std::vector<unsigned long long int> out (n);
+    for (unsigned long long int i=0; i<n; ++i)
+      out[i] = n - 1 - permutation[i];
+
+    return out;
+  }
+
+
+
+  std::vector<unsigned long long int>
+  invert_permutation (const std::vector<unsigned long long int> &permutation)
+  {
+    const unsigned long long int n = permutation.size();
+
+    std::vector<unsigned long long int> out (n, numbers::invalid_unsigned_int);
+
+    for (unsigned long long int i=0; i<n; ++i)
+      {
+        Assert (permutation[i] < n, ExcIndexRange (permutation[i], 0, n));
+        out[permutation[i]] = i;
+      }
+
+    // check that we have actually reached
+    // all indices
+    for (unsigned long long int i=0; i<n; ++i)
+      Assert (out[i] != numbers::invalid_unsigned_int,
+              ExcMessage ("The given input permutation had duplicate entries!"));
+
+    return out;
+  }
+
+
+  template <typename Integer>
+  std::vector<Integer>
+  reverse_permutation (const std::vector<Integer> &permutation)
+  {
+    const unsigned int n = permutation.size();
+
+    std::vector<Integer> out (n);
+    for (unsigned int i=0; i<n; ++i)
+      out[i] = n - 1 - permutation[i];
+
+    return out;
+  }
+
+
+
+  template <typename Integer>
+  std::vector<Integer>
+  invert_permutation (const std::vector<Integer> &permutation)
+  {
+    const unsigned int n = permutation.size();
+
+    std::vector<Integer> out (n, numbers::invalid_unsigned_int);
+
+    for (unsigned int i=0; i<n; ++i)
+      {
+        Assert (permutation[i] < n, ExcIndexRange (permutation[i], 0, n));
+        out[permutation[i]] = i;
+      }
+
+    // check that we have actually reached
+    // all indices
+    for (unsigned int i=0; i<n; ++i)
+      Assert (out[i] != numbers::invalid_unsigned_int,
+              ExcMessage ("The given input permutation had duplicate entries!"));
+
+    return out;
+  }
+
+
 
 
   namespace System
index 3334e88d9a36eb8d7fc4ef1b9d7ac7cee48bec66..9648b6ae597ea84693ce7360b146529e903bfb45 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index 28acfffcd6eae7476bb5a7336ec3e1202d36aed9..9b89144f91a705d6e0c99474bd44318b6ec543df 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 
 #include <deal.II/base/utilities.h>
index ab54188964b9b358d46e8aba4cd2df5dd15dbbbc..556d53ea75e061cd24ad413f65ff2231f4107412 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 
index c328a6e230f55b4e7e71fe9619f6b292dfae9fab..f5aced6a3e968c8a8598bbcd749eec47092ab551 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/config.h>
 
index 70d0ef4fab039c887259e4cf87bc7bb8693ef459..d4b2ace584e1560f9422e54b4ca5699945ade053 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index b9c7d52c33711560b5019ee02b76eb01e39dd1e1..3613f5b7ca1f72d34d5b971a4891f514cd978b33 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/memory_consumption.h>
@@ -732,7 +736,7 @@ namespace
                             const std::vector<std::list<
                             std::pair<typename Triangulation<dim,spacedim>::active_cell_iterator,unsigned int> > >
                             & vertex_to_cell,
-                            const std::vector<unsigned int> &coarse_cell_to_p4est_tree_permutation,
+                            const std::vector<types::global_dof_index> &coarse_cell_to_p4est_tree_permutation,
                             const bool set_vertex_info,
                             typename internal::p4est::types<dim>::connectivity *connectivity)
   {
@@ -1077,7 +1081,8 @@ namespace
       {
         // yes, cell found in local part of p4est
         delete_all_children<dim,spacedim> (dealii_cell);
-        dealii_cell->set_subdomain_id(my_subdomain);
+        if (!dealii_cell->has_children())
+          dealii_cell->set_subdomain_id(my_subdomain);
       }
     else
       {
@@ -1171,12 +1176,14 @@ namespace
     if (internal::p4est::functions<dim>::quadrant_is_equal(&this_quadrant, &ghost_quadrant))
       {
         // this is the ghostcell
-        dealii_cell->set_subdomain_id(ghost_owner);
 
         if (dealii_cell->has_children())
           delete_all_children<dim,spacedim> (dealii_cell);
         else
-          dealii_cell->clear_coarsen_flag();
+          {
+            dealii_cell->clear_coarsen_flag();
+            dealii_cell->set_subdomain_id(ghost_owner);
+          }
         return;
       }
 
@@ -1455,7 +1462,7 @@ namespace
         void *ptr = static_cast<char *>(q->p.user_data) + offset;
         typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus
         status = * static_cast<
-                 typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus*
+                 typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus *
                  >(q->p.user_data);
         switch (status)
           {
@@ -1497,7 +1504,7 @@ namespace
   {
   public:
     RefineAndCoarsenList (const Triangulation<dim,spacedim> &triangulation,
-                          const std::vector<unsigned int> &p4est_tree_to_coarse_cell_permutation,
+                          const std::vector<types::global_dof_index> &p4est_tree_to_coarse_cell_permutation,
                           const types::subdomain_id                   my_subdomain,
                           typename internal::p4est::types<dim>::forest &forest);
 
@@ -1571,7 +1578,7 @@ namespace
   template <int dim, int spacedim>
   RefineAndCoarsenList<dim,spacedim>::
   RefineAndCoarsenList (const Triangulation<dim,spacedim>            &triangulation,
-                        const std::vector<unsigned int> &p4est_tree_to_coarse_cell_permutation,
+                        const std::vector<types::global_dof_index> &p4est_tree_to_coarse_cell_permutation,
                         const types::subdomain_id                   my_subdomain,
                         typename internal::p4est::types<dim>::forest &forest)
     :
@@ -1897,6 +1904,16 @@ namespace parallel
     /* ---------------------- class Triangulation<dim,spacedim> ------------------------------ */
 
 
+
+    template <int dim, int spacedim>
+    Triangulation<dim,spacedim>::NumberCache::NumberCache()
+      :
+      n_global_active_cells(0),
+      n_global_levels(0)
+    {}
+
+
+
     template <int dim, int spacedim>
     Triangulation<dim,spacedim>::
     Triangulation (MPI_Comm mpi_communicator,
@@ -2553,7 +2570,8 @@ namespace parallel
       Assert (ghostlayer, ExcInternalError());
 
 
-      //set all cells to artificial
+      // set all cells to artificial. we will later set it to the correct
+      // subdomain in match_tree_recursively
       for (typename Triangulation<dim,spacedim>::cell_iterator
            cell = this->begin(0);
            cell != this->end(0);
@@ -2580,7 +2598,8 @@ namespace parallel
                   == false)
                 {
                   delete_all_children<dim,spacedim> (cell);
-                  cell->set_subdomain_id (numbers::artificial_subdomain_id);
+                  if (!cell->has_children())
+                    cell->set_subdomain_id (numbers::artificial_subdomain_id);
                 }
 
               else
@@ -2607,7 +2626,7 @@ namespace parallel
             }
 
           // check mesh for ghostcells,
-          // refine as neccessary.
+          // refine as necessary.
           // iterate over every ghostquadrant,
           // find corresponding deal coarsecell
           // and recurse.
@@ -2760,21 +2779,19 @@ namespace parallel
               --lvl;
               for (typename Triangulation<dim,spacedim>::cell_iterator cell = this->begin(lvl); cell!=this->end(lvl); ++cell)
                 {
-                  if (cell->has_children() && cell->subdomain_id()!=this->locally_owned_subdomain())
-                    {
-                      //not our cell
-                      for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
-                        {
-                          if (cell->child(c)->level_subdomain_id()==this->locally_owned_subdomain())
-                            {
-                              types::subdomain_id mark = numbers::artificial_subdomain_id;
-                              mark = cell->child(0)->level_subdomain_id();
-                              Assert(mark != numbers::artificial_subdomain_id, ExcInternalError()); //we should know the child(0)
-                              cell->set_level_subdomain_id(mark);
-                              break;
-                            }
-                        }
-                    }
+                  if (cell->has_children())
+                    for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
+                      {
+                        if (cell->child(c)->level_subdomain_id()==this->locally_owned_subdomain())
+                          {
+                            //at least one of the children belongs to us, so make sure we set the level subdomain id
+                            types::subdomain_id mark = numbers::artificial_subdomain_id;
+                            mark = cell->child(0)->level_subdomain_id();
+                            Assert(mark != numbers::artificial_subdomain_id, ExcInternalError()); //we should know the child(0)
+                            cell->set_level_subdomain_id(mark);
+                            break;
+                          }
+                      }
                 }
             }
 
@@ -2846,12 +2863,12 @@ namespace parallel
       // do not allow anisotropic refinement
 #ifdef DEBUG
       for (typename Triangulation<dim,spacedim>::active_cell_iterator
-                 cell = this->begin_active();
-                 cell != this->end(); ++cell)
-              if (cell->is_locally_owned() && cell->refine_flag_set())
-                  Assert (cell->refine_flag_set() ==
-                          RefinementPossibilities<dim>::isotropic_refinement,
-                          ExcMessage ("This class does not support anisotropic refinement"));
+           cell = this->begin_active();
+           cell != this->end(); ++cell)
+        if (cell->is_locally_owned() && cell->refine_flag_set())
+          Assert (cell->refine_flag_set() ==
+                  RefinementPossibilities<dim>::isotropic_refinement,
+                  ExcMessage ("This class does not support anisotropic refinement"));
 #endif
 
 
@@ -2859,11 +2876,11 @@ namespace parallel
       if (this->n_levels()==dealii::internal::p4est::functions<dim>::max_level)
         {
           for (typename Triangulation<dim,spacedim>::active_cell_iterator
-                     cell = this->begin_active(dealii::internal::p4est::functions<dim>::max_level-1);
-                     cell != this->end(dealii::internal::p4est::functions<dim>::max_level-1); ++cell)
+               cell = this->begin_active(dealii::internal::p4est::functions<dim>::max_level-1);
+               cell != this->end(dealii::internal::p4est::functions<dim>::max_level-1); ++cell)
             {
               AssertThrow(!(cell->refine_flag_set()),
-                  ExcMessage("Fatal Error: maximum refinement level of p4est reached."));
+                          ExcMessage("Fatal Error: maximum refinement level of p4est reached."));
             }
         }
 
@@ -3020,7 +3037,11 @@ namespace parallel
       number_cache.n_global_active_cells
         = std::accumulate (number_cache.n_locally_owned_active_cells.begin(),
                            number_cache.n_locally_owned_active_cells.end(),
-                           0);
+                           /* ensure sum is
+                              computed with
+                              correct data
+                              type:*/
+                           static_cast<types::global_dof_index>(0));
       number_cache.n_global_levels = Utilities::MPI::max(this->n_levels(), mpi_communicator);
     }
 
@@ -3046,7 +3067,7 @@ namespace parallel
 
 
     template <int dim, int spacedim>
-    unsigned int
+    types::global_dof_index
     Triangulation<dim,spacedim>::n_global_active_cells () const
     {
       return number_cache.n_global_active_cells;
@@ -3164,7 +3185,7 @@ namespace parallel
 
 
     template <int dim, int spacedim>
-    const std::vector<unsigned int> &
+    const std::vector<types::global_dof_index> &
     Triangulation<dim, spacedim>::get_p4est_tree_to_coarse_cell_permutation() const
     {
       return p4est_tree_to_coarse_cell_permutation;
@@ -3221,9 +3242,70 @@ namespace parallel
     template <int dim, int spacedim>
     void
     Triangulation<dim,spacedim>::
-    copy_triangulation (const dealii::Triangulation<dim, spacedim> &)
+    copy_triangulation (const dealii::Triangulation<dim, spacedim> &old_tria)
     {
-      Assert (false, ExcNotImplemented());
+      try
+        {
+          dealii::Triangulation<dim,spacedim>::
+          copy_triangulation (old_tria);
+        }
+      catch (const typename dealii::Triangulation<dim,spacedim>::DistortedCellList &)
+        {
+          // the underlying
+          // triangulation should not
+          // be checking for
+          // distorted cells
+          AssertThrow (false, ExcInternalError());
+        }
+
+      // note that now we have some content in
+      // the p4est objects and call the
+      // functions that do the actual work
+      // (which are dimension dependent, so
+      // separate)
+      triangulation_has_content = true;
+
+      Assert (old_tria.n_levels() == 1,
+              ExcMessage ("Parallel distributed triangulations can only be copied, "
+                          "if they are not refined!"));
+
+      if (const dealii::parallel::distributed::Triangulation<dim,spacedim> *
+          old_tria_x = dynamic_cast<const dealii::parallel::distributed::Triangulation<dim,spacedim> *>(&old_tria))
+        {
+          Assert (!old_tria_x->refinement_in_progress,
+                  ExcMessage ("Parallel distributed triangulations can only "
+                              "be copied, if no refinement is in progress!"));
+
+          mpi_communicator = Utilities::MPI::duplicate_communicator (old_tria_x->get_communicator ());
+
+          coarse_cell_to_p4est_tree_permutation = old_tria_x->coarse_cell_to_p4est_tree_permutation;
+          p4est_tree_to_coarse_cell_permutation = old_tria_x->p4est_tree_to_coarse_cell_permutation;
+          attached_data_size = old_tria_x->attached_data_size;
+          n_attached_datas   = old_tria_x->n_attached_datas;
+
+          settings           = old_tria_x->settings;
+        }
+      else
+        {
+          setup_coarse_cell_to_p4est_tree_permutation ();
+        }
+
+      copy_new_triangulation_to_p4est (dealii::internal::int2type<dim>());
+
+      try
+        {
+          copy_local_forest_to_triangulation ();
+        }
+      catch (const typename Triangulation<dim>::DistortedCellList &)
+        {
+          // the underlying
+          // triangulation should not
+          // be checking for
+          // distorted cells
+          AssertThrow (false, ExcInternalError());
+        }
+
+      update_number_cache ();
     }
 
 
@@ -3307,7 +3389,7 @@ namespace parallel
 
 
     template <>
-    unsigned int
+    types::global_dof_index
     Triangulation<1,1>::n_global_active_cells () const
     {
       Assert (false, ExcNotImplemented());
@@ -3365,7 +3447,7 @@ namespace parallel
 
 
     template <>
-    unsigned int
+    types::global_dof_index
     Triangulation<1,2>::n_global_active_cells () const
     {
       Assert (false, ExcNotImplemented());
@@ -3415,7 +3497,7 @@ namespace parallel
 
 
     template <>
-    unsigned int
+    types::global_dof_index
     Triangulation<1,3>::n_global_active_cells () const
     {
       Assert (false, ExcNotImplemented());
index 9f1eae89b8dbecefc74bd2039f99de06b83ed69e..b5199699f313c3042d6c45c4d93bd97daea2d829 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index c85db4f35c9791d0e904a1b4e085117a8c67d835..f791bd398eaab9db171fe0ae3996ecd5d506853f 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index a81c86c2527e4db534566b905792c7f8ef511a6d..5a231134199ca3cf3781d207aa00ea2e79ff1310 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/dofs/block_info.h>
 #include <deal.II/dofs/dof_handler.h>
@@ -30,14 +32,14 @@ BlockInfo::initialize(const DoFHandler<dim, spacedim> &dof, bool levels_only, bo
   if (!levels_only && dof.has_active_dofs())
     {
       const FiniteElement<dim, spacedim> &fe = dof.get_fe();
-      std::vector<unsigned int> sizes(fe.n_blocks());
+      std::vector<types::global_dof_index> sizes(fe.n_blocks());
       DoFTools::count_dofs_per_block(dof, sizes);
       bi_global.reinit(sizes);
     }
 
   if (!active_only && dof.has_level_dofs())
     {
-      std::vector<std::vector<unsigned int> > sizes (dof.get_tria ().n_levels ());
+      std::vector<std::vector<types::global_dof_index> > sizes (dof.get_tria ().n_levels ());
 
       for (unsigned int i = 0; i < sizes.size (); ++i)
         sizes[i].resize (dof.get_fe ().n_blocks ());
@@ -56,7 +58,7 @@ void
 BlockInfo::initialize_local(const DoFHandler<dim, spacedim> &dof)
 {
   const FiniteElement<dim, spacedim> &fe = dof.get_fe();
-  std::vector<unsigned int> sizes(fe.n_blocks());
+  std::vector<types::global_dof_index> sizes(fe.n_blocks());
 
   base_elements.resize(fe.n_blocks());
 
index 5e5b2ed5714a2861286ce8ef4ec3342cb1dfce06..a416b87ba8a64e3fa91d429af9bf28f945fb1912 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
   {
index e5282b7d63d927b31640ce1f9bcd9eec53822876..59b8c4833404a969bec960f284849ed4f09998a1 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/block_vector.h>
@@ -68,7 +70,7 @@ DoFCellAccessor<DH,lda>::update_cell_dof_indices_cache () const
 
 template <class DH, bool lda>
 void
-DoFCellAccessor<DH,lda>::set_dof_indices (const std::vector<unsigned int> &local_dof_indices)
+DoFCellAccessor<DH,lda>::set_dof_indices (const std::vector<types::global_dof_index> &local_dof_indices)
 {
   Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
           ExcMessage ("DoFHandler not initialized"));
index e433bbb5991f3093297729be30b23130d2c34733..103290a71178172230acd97d6aa97a1ad9a82169 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 // TODO: This could surely be made more systematic!
index 66f146b63d5be15251b291d047d39b14770b1d23..e5944bf73cdbcdf6bc4510fff93895fdce36d8ab 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/memory_consumption.h>
index 8d575a0ceb87993577f58e311bbdaa0acb8bf522..6aaaef2dd86d7fa7940b919b4bd119b952f3386a 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/dofs/dof_handler.h>
@@ -42,7 +44,7 @@ template<int dim, int spacedim>
 const unsigned int DoFHandler<dim,spacedim>::space_dimension;
 
 template <int dim, int spacedim>
-const unsigned int DoFHandler<dim,spacedim>::invalid_dof_index;
+const types::global_dof_index DoFHandler<dim,spacedim>::invalid_dof_index;
 
 template <int dim, int spacedim>
 const unsigned int DoFHandler<dim,spacedim>::default_fe_index;
@@ -53,7 +55,7 @@ const unsigned int DoFHandler<dim,spacedim>::default_fe_index;
 namespace internal
 {
   template <int dim, int spacedim>
-  const unsigned int *dummy ()
+  const types::global_dof_index *dummy ()
   {
     return &dealii::DoFHandler<dim,spacedim>::invalid_dof_index;
   }
@@ -86,8 +88,8 @@ namespace internal
       unsigned int
       max_couplings_between_dofs (const DoFHandler<1,spacedim> &dof_handler)
       {
-        return std::min(3*dof_handler.selected_fe->dofs_per_vertex +
-                        2*dof_handler.selected_fe->dofs_per_line,
+        return std::min(static_cast<types::global_dof_index>(3*dof_handler.selected_fe->dofs_per_vertex +
+                                                             2*dof_handler.selected_fe->dofs_per_line),
                         dof_handler.n_dofs());
       }
 
@@ -120,7 +122,7 @@ namespace internal
         // nodes)
         // count lines -> 28 (don't forget to count
         // mother and children separately!)
-        unsigned int max_couplings;
+        types::global_dof_index max_couplings;
         switch (dof_handler.tria->max_adjacent_cells())
           {
           case 4:
@@ -223,7 +225,7 @@ namespace internal
         const unsigned int max_adjacent_cells
           = dof_handler.tria->max_adjacent_cells();
 
-        unsigned int max_couplings;
+        types::global_dof_index max_couplings;
         if (max_adjacent_cells <= 8)
           max_couplings=7*7*7*dof_handler.selected_fe->dofs_per_vertex +
                         7*6*7*3*dof_handler.selected_fe->dofs_per_line +
@@ -364,7 +366,7 @@ namespace internal
         for (unsigned int i = 0; i < n_levels; ++i)
           {
             dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<1>);
-            dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<unsigned int> (tria.n_raw_lines (i) * dofs_per_line, DoFHandler<1>::invalid_dof_index);
+            dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_lines (i) * dofs_per_line, DoFHandler<1>::invalid_dof_index);
           }
 
         const unsigned int &n_vertices = tria.n_vertices ();
@@ -420,11 +422,11 @@ namespace internal
         for (unsigned int i = 0; i < n_levels; ++i)
           {
             dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<2>);
-            dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<unsigned int> (tria.n_raw_quads (i) * fe.dofs_per_quad, DoFHandler<2>::invalid_dof_index);
+            dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_quads (i) * fe.dofs_per_quad, DoFHandler<2>::invalid_dof_index);
           }
 
         dof_handler.mg_faces = new internal::DoFHandler::DoFFaces<2>;
-        dof_handler.mg_faces->lines.dofs = std::vector<unsigned int> (tria.n_raw_lines () * fe.dofs_per_line, DoFHandler<2>::invalid_dof_index);
+        dof_handler.mg_faces->lines.dofs = std::vector<types::global_dof_index> (tria.n_raw_lines () * fe.dofs_per_line, DoFHandler<2>::invalid_dof_index);
 
         const unsigned int &n_vertices = tria.n_vertices ();
 
@@ -479,12 +481,12 @@ namespace internal
         for (unsigned int i = 0; i < n_levels; ++i)
           {
             dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<3>);
-            dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<unsigned int> (tria.n_raw_hexs (i) * fe.dofs_per_hex, DoFHandler<3>::invalid_dof_index);
+            dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_hexs (i) * fe.dofs_per_hex, DoFHandler<3>::invalid_dof_index);
           }
 
         dof_handler.mg_faces = new internal::DoFHandler::DoFFaces<3>;
-        dof_handler.mg_faces->lines.dofs = std::vector<unsigned int> (tria.n_raw_lines () * fe.dofs_per_line, DoFHandler<3>::invalid_dof_index);
-        dof_handler.mg_faces->quads.dofs = std::vector<unsigned int> (tria.n_raw_quads () * fe.dofs_per_quad, DoFHandler<3>::invalid_dof_index);
+        dof_handler.mg_faces->lines.dofs = std::vector<types::global_dof_index> (tria.n_raw_lines () * fe.dofs_per_line, DoFHandler<3>::invalid_dof_index);
+        dof_handler.mg_faces->quads.dofs = std::vector<types::global_dof_index> (tria.n_raw_quads () * fe.dofs_per_quad, DoFHandler<3>::invalid_dof_index);
 
         const unsigned int &n_vertices = tria.n_vertices ();
 
@@ -527,7 +529,7 @@ namespace internal
 
       template<int spacedim>
       static
-      unsigned int distribute_dofs_on_cell (typename DoFHandler<1, spacedim>::cell_iterator &cell, unsigned int next_free_dof)
+      types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<1, spacedim>::cell_iterator &cell, types::global_dof_index next_free_dof)
       {
         const FiniteElement<1, spacedim> &fe = cell->get_fe ();
 
@@ -564,7 +566,7 @@ namespace internal
 
       template<int spacedim>
       static
-      unsigned int distribute_dofs_on_cell (typename DoFHandler<2, spacedim>::cell_iterator &cell, unsigned int next_free_dof)
+      types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<2, spacedim>::cell_iterator &cell, types::global_dof_index next_free_dof)
       {
         const FiniteElement<2, spacedim> &fe = cell->get_fe ();
 
@@ -594,7 +596,7 @@ namespace internal
 
       template<int spacedim>
       static
-      unsigned int distribute_dofs_on_cell (typename DoFHandler<3, spacedim>::cell_iterator &cell, unsigned int next_free_dof)
+      types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<3, spacedim>::cell_iterator &cell, types::global_dof_index next_free_dof)
       {
         const FiniteElement<3, spacedim> &fe = cell->get_fe ();
 
@@ -634,7 +636,8 @@ namespace internal
 
       template<int spacedim>
       static
-      unsigned int get_dof_index (
+      types::global_dof_index
+      get_dof_index (
         const DoFHandler<1, spacedim> &dof_handler,
         internal::DoFHandler::DoFLevel<1> &mg_level,
         internal::DoFHandler::DoFFaces<1> &,
@@ -648,77 +651,82 @@ namespace internal
 
       template<int spacedim>
       static
-      unsigned int get_dof_index (const DoFHandler<2, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<2> &, internal::DoFHandler::DoFFaces<2> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>)
+      types::global_dof_index
+      get_dof_index (const DoFHandler<2, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<2> &, internal::DoFHandler::DoFFaces<2> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>)
       {
         return mg_faces.lines.get_dof_index (dof_handler, obj_index, fe_index, local_index);
       }
 
       template<int spacedim>
       static
-      unsigned int get_dof_index (const DoFHandler<2, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<2> &mg_level, internal::DoFHandler::DoFFaces<2> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>)
+      types::global_dof_index
+      get_dof_index (const DoFHandler<2, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<2> &mg_level, internal::DoFHandler::DoFFaces<2> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>)
       {
         return mg_level.dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
       }
 
       template<int spacedim>
       static
-      unsigned int get_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &, internal::DoFHandler::DoFFaces<3> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>)
+      types::global_dof_index
+      get_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &, internal::DoFHandler::DoFFaces<3> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>)
       {
         return mg_faces.lines.get_dof_index (dof_handler, obj_index, fe_index, local_index);
       }
 
       template<int spacedim>
       static
-      unsigned int get_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &, internal::DoFHandler::DoFFaces<3> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>)
+      types::global_dof_index
+      get_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &, internal::DoFHandler::DoFFaces<3> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>)
       {
         return mg_faces.quads.get_dof_index (dof_handler, obj_index, fe_index, local_index);
       }
 
       template<int spacedim>
       static
-      unsigned int get_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &mg_level, internal::DoFHandler::DoFFaces<3> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<3>)
+      types::global_dof_index
+      get_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &mg_level, internal::DoFHandler::DoFFaces<3> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<3>)
       {
         return mg_level.dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
       }
 
       template<int spacedim>
       static
-      void set_dof_index (const DoFHandler<1, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<1> &mg_level, internal::DoFHandler::DoFFaces<1> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>)
+      void set_dof_index (const DoFHandler<1, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<1> &mg_level, internal::DoFHandler::DoFFaces<1> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<1>)
       {
         mg_level.dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
       }
 
       template<int spacedim>
       static
-      void set_dof_index (const DoFHandler<2, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<2> &, internal::DoFHandler::DoFFaces<2> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>)
+      void set_dof_index (const DoFHandler<2, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<2> &, internal::DoFHandler::DoFFaces<2> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<1>)
       {
         mg_faces.lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
       }
 
       template<int spacedim>
       static
-      void set_dof_index (const DoFHandler<2, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<2> &mg_level, internal::DoFHandler::DoFFaces<2> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<2>)
+      void set_dof_index (const DoFHandler<2, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<2> &mg_level, internal::DoFHandler::DoFFaces<2> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<2>)
       {
         mg_level.dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
       }
 
       template<int spacedim>
       static
-      void set_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &, internal::DoFHandler::DoFFaces<3> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>)
+      void set_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &, internal::DoFHandler::DoFFaces<3> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<1>)
       {
         mg_faces.lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
       }
 
       template<int spacedim>
       static
-      void set_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &, internal::DoFHandler::DoFFaces<3> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<2>)
+      void set_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &, internal::DoFHandler::DoFFaces<3> &mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<2>)
       {
         mg_faces.quads.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
       }
 
       template<int spacedim>
       static
-      void set_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &mg_level, internal::DoFHandler::DoFFaces<3> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<3>)
+      void set_dof_index (const DoFHandler<3, spacedim> &dof_handler, internal::DoFHandler::DoFLevel<3> &mg_level, internal::DoFHandler::DoFFaces<3> &, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<3>)
       {
         mg_level.dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
       }
@@ -797,8 +805,10 @@ template <int dim, int spacedim>
 typename DoFHandler<dim,spacedim>::cell_iterator
 DoFHandler<dim,spacedim>::begin (const unsigned int level) const
 {
-  return cell_iterator (*this->get_tria().begin(level),
-                        this);
+  typename Triangulation<dim,spacedim>::cell_iterator cell = this->get_tria().begin(level);
+  if (cell == this->get_tria().end(level))
+    return end(level);
+  return cell_iterator (*cell, this);
 }
 
 
@@ -834,9 +844,10 @@ template <int dim, int spacedim>
 typename DoFHandler<dim,spacedim>::cell_iterator
 DoFHandler<dim,spacedim>::end (const unsigned int level) const
 {
-  return (level == this->get_tria().n_levels()-1 ?
-          end() :
-          begin (level+1));
+  typename Triangulation<dim,spacedim>::cell_iterator cell = this->get_tria().end(level);
+  if (cell.state() != IteratorState::valid)
+    return end();
+  return cell_iterator (*cell, this);
 }
 
 
@@ -844,9 +855,10 @@ template <int dim, int spacedim>
 typename DoFHandler<dim, spacedim>::active_cell_iterator
 DoFHandler<dim, spacedim>::end_active (const unsigned int level) const
 {
-  return (level == this->get_tria().n_levels()-1 ?
-          active_cell_iterator(end()) :
-          begin_active (level+1));
+  typename Triangulation<dim,spacedim>::cell_iterator cell = this->get_tria().end_active(level);
+  if (cell.state() != IteratorState::valid)
+    return active_cell_iterator(end());
+  return active_cell_iterator (*cell, this);
 }
 
 
@@ -857,8 +869,10 @@ DoFHandler<dim, spacedim>::begin_mg (const unsigned int level) const
 {
   // Assert(this->has_level_dofs(), ExcMessage("You can only iterate over mg "
   //     "levels if mg dofs got distributed."));
-  return level_cell_iterator (*this->get_tria().begin(level),
-                              this);
+  typename Triangulation<dim,spacedim>::cell_iterator cell = this->get_tria().begin(level);
+  if (cell == this->get_tria().end(level))
+    return end_mg(level);
+  return level_cell_iterator (*cell, this);
 }
 
 
@@ -868,9 +882,10 @@ DoFHandler<dim, spacedim>::end_mg (const unsigned int level) const
 {
   // Assert(this->has_level_dofs(), ExcMessage("You can only iterate over mg "
   //     "levels if mg dofs got distributed."));
-  return (level == this->get_tria().n_levels()-1 ?
-          end() :
-          begin (level+1));
+  typename Triangulation<dim,spacedim>::cell_iterator cell = this->get_tria().end(level);
+  if (cell.state() != IteratorState::valid)
+    return end();
+  return level_cell_iterator (*cell, this);
 }
 
 
@@ -888,7 +903,7 @@ DoFHandler<dim, spacedim>::end_mg () const
 
 
 template <>
-unsigned int DoFHandler<1>::n_boundary_dofs () const
+types::global_dof_index DoFHandler<1>::n_boundary_dofs () const
 {
   return 2*get_fe().dofs_per_vertex;
 }
@@ -896,7 +911,7 @@ unsigned int DoFHandler<1>::n_boundary_dofs () const
 
 
 template <>
-unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
+types::global_dof_index DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
 {
   // check that only boundary
   // indicators 0 and 1 are allowed
@@ -912,7 +927,7 @@ unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicat
 
 
 template <>
-unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
+types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
 {
   // check that only boundary
   // indicators 0 and 1 are allowed
@@ -927,7 +942,7 @@ unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id>
 
 
 template <>
-unsigned int DoFHandler<1,2>::n_boundary_dofs () const
+types::global_dof_index DoFHandler<1,2>::n_boundary_dofs () const
 {
   return 2*get_fe().dofs_per_vertex;
 }
@@ -935,7 +950,7 @@ unsigned int DoFHandler<1,2>::n_boundary_dofs () const
 
 
 template <>
-unsigned int DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
+types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
 {
   // check that only boundary
   // indicators 0 and 1 are allowed
@@ -951,7 +966,7 @@ unsigned int DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &boundary_indic
 
 
 template <>
-unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
+types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
 {
   // check that only boundary
   // indicators 0 and 1 are allowed
@@ -967,12 +982,12 @@ unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id
 
 
 template<int dim, int spacedim>
-unsigned int DoFHandler<dim,spacedim>::n_boundary_dofs () const
+types::global_dof_index DoFHandler<dim,spacedim>::n_boundary_dofs () const
 {
   std::set<int> boundary_dofs;
 
   const unsigned int dofs_per_face = get_fe().dofs_per_face;
-  std::vector<unsigned int> dofs_on_face(dofs_per_face);
+  std::vector<types::global_dof_index> dofs_on_face(dofs_per_face);
 
   // loop over all faces of all cells
   // and see whether they are at a
@@ -1005,7 +1020,7 @@ unsigned int DoFHandler<dim,spacedim>::n_boundary_dofs () const
 
 
 template<int dim, int spacedim>
-unsigned int
+types::global_dof_index
 DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
 {
   Assert (boundary_indicators.find(numbers::internal_face_boundary_id) == boundary_indicators.end(),
@@ -1014,7 +1029,7 @@ DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicator
   std::set<int> boundary_dofs;
 
   const unsigned int dofs_per_face = get_fe().dofs_per_face;
-  std::vector<unsigned int> dofs_on_face(dofs_per_face);
+  std::vector<types::global_dof_index> dofs_on_face(dofs_per_face);
 
   // same as in the previous
   // function, but with an additional
@@ -1039,7 +1054,7 @@ DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicator
 
 
 template<int dim, int spacedim>
-unsigned int
+types::global_dof_index
 DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
 {
   Assert (boundary_indicators.find (numbers::internal_face_boundary_id) == boundary_indicators.end(),
@@ -1048,7 +1063,7 @@ DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id> &b
   std::set<int> boundary_dofs;
 
   const unsigned int dofs_per_face = get_fe().dofs_per_face;
-  std::vector<unsigned int> dofs_on_face(dofs_per_face);
+  std::vector<types::global_dof_index> dofs_on_face(dofs_per_face);
 
   // same as in the previous
   // function, but with a different
@@ -1097,7 +1112,7 @@ DoFHandler<dim,spacedim>::memory_consumption () const
     mem += MemoryConsumption::memory_consumption (*mg_faces);
 
   for (unsigned int i = 0; i < mg_vertex_dofs.size (); ++i)
-    mem += sizeof (MGVertexDoFs) + (1 + mg_vertex_dofs[i].get_finest_level () - mg_vertex_dofs[i].get_coarsest_level ()) * sizeof (unsigned int);
+    mem += sizeof (MGVertexDoFs) + (1 + mg_vertex_dofs[i].get_finest_level () - mg_vertex_dofs[i].get_coarsest_level ()) * sizeof (types::global_dof_index);
 
   return mem;
 }
@@ -1213,7 +1228,7 @@ void DoFHandler<dim,spacedim>::clear ()
 
 template <int dim, int spacedim>
 void
-DoFHandler<dim,spacedim>::renumber_dofs (const std::vector<unsigned int> &new_numbers)
+DoFHandler<dim,spacedim>::renumber_dofs (const std::vector<types::global_dof_index> &new_numbers)
 {
   Assert (new_numbers.size() == n_locally_owned_dofs(),
           ExcRenumberingIncomplete());
@@ -1230,15 +1245,15 @@ DoFHandler<dim,spacedim>::renumber_dofs (const std::vector<unsigned int> &new_nu
   // processor
   if (n_locally_owned_dofs() == n_dofs())
     {
-      std::vector<unsigned int> tmp(new_numbers);
+      std::vector<types::global_dof_index> tmp(new_numbers);
       std::sort (tmp.begin(), tmp.end());
-      std::vector<unsigned int>::const_iterator p = tmp.begin();
-      unsigned int                         i = 0;
+      std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
+      types::global_dof_index i = 0;
       for (; p!=tmp.end(); ++p, ++i)
         Assert (*p == i, ExcNewNumbersNotConsecutive(i));
     }
   else
-    for (unsigned int i=0; i<new_numbers.size(); ++i)
+    for (types::global_dof_index i=0; i<new_numbers.size(); ++i)
       Assert (new_numbers[i] < n_dofs(),
               ExcMessage ("New DoF index is not less than the total number of dofs."));
 #endif
@@ -1250,7 +1265,7 @@ DoFHandler<dim,spacedim>::renumber_dofs (const std::vector<unsigned int> &new_nu
 template <int dim, int spacedim>
 void
 DoFHandler<dim,spacedim>::renumber_dofs (const unsigned int,
-                                         const std::vector<unsigned int> &)
+                                         const std::vector<types::global_dof_index> &)
 {
   Assert(false, ExcNotImplemented());
 }
@@ -1258,7 +1273,7 @@ DoFHandler<dim,spacedim>::renumber_dofs (const unsigned int,
 
 template<>
 void DoFHandler<1>::renumber_dofs (const unsigned int level,
-                                   const std::vector<unsigned int> &new_numbers)
+                                   const std::vector<types::global_dof_index> &new_numbers)
 {
   Assert (new_numbers.size() == n_dofs(level), DoFHandler<1>::ExcRenumberingIncomplete());
 
@@ -1277,7 +1292,7 @@ void DoFHandler<1>::renumber_dofs (const unsigned int level,
       for (unsigned int d=0; d<this->get_fe().dofs_per_vertex; ++d)
         i->set_index (level, d, new_numbers[i->get_index (level, d)]);
 
-  for (std::vector<unsigned int>::iterator i=mg_levels[level]->dof_object.dofs.begin();
+  for (std::vector<types::global_dof_index>::iterator i=mg_levels[level]->dof_object.dofs.begin();
        i!=mg_levels[level]->dof_object.dofs.end(); ++i)
     {
       if (*i != DoFHandler<1>::invalid_dof_index)
@@ -1292,7 +1307,7 @@ void DoFHandler<1>::renumber_dofs (const unsigned int level,
 
 template<>
 void DoFHandler<2>::renumber_dofs (const unsigned int  level,
-                                   const std::vector<unsigned int>  &new_numbers)
+                                   const std::vector<types::global_dof_index>  &new_numbers)
 {
   Assert (new_numbers.size() == n_dofs(level),
           DoFHandler<2>::ExcRenumberingIncomplete());
@@ -1336,7 +1351,7 @@ void DoFHandler<2>::renumber_dofs (const unsigned int  level,
       const_cast<Triangulation<2> &>(this->get_tria()).load_user_flags (user_flags);
     }
 
-  for (std::vector<unsigned int>::iterator i=mg_levels[level]->dof_object.dofs.begin();
+  for (std::vector<types::global_dof_index>::iterator i=mg_levels[level]->dof_object.dofs.begin();
        i!=mg_levels[level]->dof_object.dofs.end(); ++i)
     {
       if (*i != DoFHandler<2>::invalid_dof_index)
@@ -1351,7 +1366,7 @@ void DoFHandler<2>::renumber_dofs (const unsigned int  level,
 
 template<>
 void DoFHandler<3>::renumber_dofs (const unsigned int  level,
-                                   const std::vector<unsigned int>  &new_numbers)
+                                   const std::vector<types::global_dof_index>  &new_numbers)
 {
   Assert (new_numbers.size() == n_dofs(level),
           DoFHandler<3>::ExcRenumberingIncomplete());
@@ -1430,7 +1445,7 @@ void DoFHandler<3>::renumber_dofs (const unsigned int  level,
     }
 
   //HEX DoFs
-  for (std::vector<unsigned int>::iterator i=mg_levels[level]->dof_object.dofs.begin();
+  for (std::vector<types::global_dof_index>::iterator i=mg_levels[level]->dof_object.dofs.begin();
        i!=mg_levels[level]->dof_object.dofs.end(); ++i)
     {
       if (*i != DoFHandler<3>::invalid_dof_index)
@@ -1502,7 +1517,7 @@ void DoFHandler<dim,spacedim>::clear_space ()
   delete faces;
   faces = 0;
 
-  std::vector<unsigned int> tmp;
+  std::vector<types::global_dof_index> tmp;
   std::swap (vertex_dofs, tmp);
 
   number_cache.clear ();
@@ -1510,7 +1525,8 @@ void DoFHandler<dim,spacedim>::clear_space ()
 
 template<int dim, int spacedim>
 template<int structdim>
-unsigned int DoFHandler<dim, spacedim>::get_dof_index (
+types::global_dof_index
+DoFHandler<dim, spacedim>::get_dof_index (
   const unsigned int obj_level,
   const unsigned int obj_index,
   const unsigned int fe_index,
@@ -1524,16 +1540,18 @@ unsigned int DoFHandler<dim, spacedim>::get_dof_index (
 
 template<int dim, int spacedim>
 template<int structdim>
-void DoFHandler<dim, spacedim>::set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index) const
+void DoFHandler<dim, spacedim>::set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index) const
 {
   internal::DoFHandler::Implementation::set_dof_index (*this, *this->mg_levels[obj_level], *this->mg_faces, obj_index, fe_index, local_index, global_index, internal::int2type<structdim> ());
 }
 
+
 template<int dim, int spacedim>
 DoFHandler<dim, spacedim>::MGVertexDoFs::MGVertexDoFs (): coarsest_level (numbers::invalid_unsigned_int), finest_level (0), indices (0), indices_offset (0)
 {
 }
 
+
 template<int dim, int spacedim>
 DoFHandler<dim, spacedim>::MGVertexDoFs::~MGVertexDoFs ()
 {
@@ -1565,13 +1583,13 @@ void DoFHandler<dim, spacedim>::MGVertexDoFs::init (const unsigned int cl, const
   const unsigned int n_levels = finest_level - coarsest_level + 1;
   const unsigned int n_indices = n_levels * dofs_per_vertex;
 
-  indices = new unsigned int[n_indices];
+  indices = new types::global_dof_index[n_indices];
   Assert (indices != 0, ExcNoMemory ());
 
   for (unsigned int i = 0; i < n_indices; ++i)
     indices[i] = DoFHandler<dim, spacedim>::invalid_dof_index;
 
-  indices_offset = new unsigned int[n_levels];
+  indices_offset = new types::global_dof_index[n_levels];
   Assert (indices != 0, ExcNoMemory ());
 
   for (unsigned int i = 0; i < n_levels; ++i)
index 6a2e07d419baf2800dee2941ada613b5659efe77..594bbd4c4a951550d8dab4a3eddd831bf8e2d084 100644 (file)
@@ -1,24 +1,28 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
   {
     namespace internal
     \{
-      template const unsigned int * dummy<deal_II_dimension,deal_II_dimension> ();
+      template const types::global_dof_index * dummy<deal_II_dimension,deal_II_dimension> ();
 #if deal_II_dimension < 3
-      template const unsigned int * dummy<deal_II_dimension,deal_II_dimension+1> ();
+      template const types::global_dof_index * dummy<deal_II_dimension,deal_II_dimension+1> ();
 #endif
     \}
 
@@ -33,7 +37,7 @@ for (deal_II_dimension : DIMENSIONS)
     template class DoFHandler<1,deal_II_dimension>;
     
     template
-    unsigned int
+    types::global_dof_index
     DoFHandler<1,3>::
     get_dof_index<1> (const unsigned int       obj_level,
                              const unsigned int       obj_index,
@@ -42,7 +46,7 @@ for (deal_II_dimension : DIMENSIONS)
 #endif
 
 template
-unsigned int
+types::global_dof_index
 DoFHandler<deal_II_dimension,deal_II_dimension>::
 get_dof_index<1> (const unsigned int       obj_level,
                  const unsigned int       obj_index,
@@ -51,7 +55,7 @@ get_dof_index<1> (const unsigned int       obj_level,
 
 #if deal_II_dimension < 3
 template
-unsigned int
+types::global_dof_index
 DoFHandler<deal_II_dimension,deal_II_dimension+1>::
 get_dof_index<1> (const unsigned int       obj_level,
                  const unsigned int       obj_index,
@@ -61,7 +65,7 @@ get_dof_index<1> (const unsigned int       obj_level,
 
 #if deal_II_dimension >= 2
 template
-unsigned int
+types::global_dof_index
 DoFHandler<deal_II_dimension,deal_II_dimension>::
 get_dof_index<2> (const unsigned int       obj_level,
                  const unsigned int       obj_index,
@@ -70,7 +74,7 @@ get_dof_index<2> (const unsigned int       obj_level,
 
 #if deal_II_dimension < 3
 template
-unsigned int
+types::global_dof_index
 DoFHandler<deal_II_dimension,deal_II_dimension+1>::
 get_dof_index<2> (const unsigned int       obj_level,
                  const unsigned int       obj_index,
@@ -80,7 +84,7 @@ get_dof_index<2> (const unsigned int       obj_level,
 
 #if deal_II_dimension >= 3
 template
-unsigned int
+types::global_dof_index
 DoFHandler<deal_II_dimension,deal_II_dimension>::
 get_dof_index<3> (const unsigned int       obj_level,
                  const unsigned int       obj_index,
@@ -93,20 +97,20 @@ template
 void
 DoFHandler<deal_II_dimension,deal_II_dimension>::
 set_dof_index<1> (const unsigned int       obj_level,
-                 const unsigned int       obj_index,
-                 const unsigned int       fe_index,
-                 const unsigned int       local_index,
-                 const unsigned int       global_index) const;
+                 const unsigned int            obj_index,
+                 const unsigned int            fe_index,
+                 const unsigned int            local_index,
+                 const types::global_dof_index global_index) const;
 
 #if deal_II_dimension < 3
 template
 void
 DoFHandler<deal_II_dimension,deal_II_dimension+1>::
 set_dof_index<1> (const unsigned int       obj_level,
-                 const unsigned int       obj_index,
-                 const unsigned int       fe_index,
-                 const unsigned int       local_index,
-                 const unsigned int       global_index) const;
+                 const unsigned int            obj_index,
+                 const unsigned int            fe_index,
+                 const unsigned int            local_index,
+                 const types::global_dof_index global_index) const;
 #endif
 
 #if deal_II_dimension < 2
@@ -114,10 +118,10 @@ template
 void
 DoFHandler<deal_II_dimension,deal_II_dimension+2>::
 set_dof_index<1> (const unsigned int       obj_level,
-                 const unsigned int       obj_index,
-                 const unsigned int       fe_index,
-                 const unsigned int       local_index,
-                 const unsigned int       global_index) const;
+                 const unsigned int            obj_index,
+                 const unsigned int            fe_index,
+                 const unsigned int            local_index,
+                 const types::global_dof_index global_index) const;
 #endif
 
 #if deal_II_dimension >= 2
@@ -125,20 +129,20 @@ template
 void
 DoFHandler<deal_II_dimension,deal_II_dimension>::
 set_dof_index<2> (const unsigned int       obj_level,
-                 const unsigned int       obj_index,
-                 const unsigned int       fe_index,
-                 const unsigned int       local_index,
-                 const unsigned int       global_index) const;
+                 const unsigned int            obj_index,
+                 const unsigned int            fe_index,
+                 const unsigned int            local_index,
+                 const types::global_dof_index global_index) const;
 
 #if deal_II_dimension < 3
 template
 void
 DoFHandler<deal_II_dimension,deal_II_dimension+1>::
 set_dof_index<2> (const unsigned int       obj_level,
-                 const unsigned int       obj_index,
-                 const unsigned int       fe_index,
-                 const unsigned int       local_index,
-                 const unsigned int       global_index) const;
+                 const unsigned int            obj_index,
+                 const unsigned int            fe_index,
+                 const unsigned int            local_index,
+                 const types::global_dof_index global_index) const;
 #endif
 
 #if deal_II_dimension >= 3
@@ -146,10 +150,10 @@ template
 void
 DoFHandler<deal_II_dimension,deal_II_dimension>::
 set_dof_index<3> (const unsigned int       obj_level,
-                 const unsigned int       obj_index,
-                 const unsigned int       fe_index,
-                 const unsigned int       local_index,
-                 const unsigned int       global_index) const;
+                 const unsigned int            obj_index,
+                 const unsigned int            fe_index,
+                 const unsigned int            local_index,
+                 const types::global_dof_index global_index) const;
 #endif
 #endif
   }
index a45fd8c1676a838ffbb07a600e013a3e2ac3952c..30a9c96ecb4b3a00d25dad3d2d6469f78bd57050 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 //TODO [TH]: renumber DoFs for multigrid is not done yet
 
@@ -59,10 +63,10 @@ namespace internal
          */
         template <int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_dofs_on_cell (const DoFHandler<1,spacedim> &dof_handler,
                                  const typename DoFHandler<1,spacedim>::active_cell_iterator &cell,
-                                 unsigned int          next_free_dof)
+                                 types::global_dof_index next_free_dof)
         {
 
           // distribute dofs of vertices
@@ -103,10 +107,10 @@ namespace internal
 
         template <int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_dofs_on_cell (const DoFHandler<2,spacedim> &dof_handler,
                                  const typename DoFHandler<2,spacedim>::active_cell_iterator &cell,
-                                 unsigned int          next_free_dof)
+                                 types::global_dof_index next_free_dof)
         {
           if (dof_handler.get_fe().dofs_per_vertex > 0)
             // number dofs on vertices
@@ -150,10 +154,10 @@ namespace internal
 
         template <int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_dofs_on_cell (const DoFHandler<3,spacedim> &dof_handler,
                                  const typename DoFHandler<3,spacedim>::active_cell_iterator &cell,
-                                 unsigned int          next_free_dof)
+                                 types::global_dof_index next_free_dof)
         {
           if (dof_handler.get_fe().dofs_per_vertex > 0)
             // number dofs on vertices
@@ -216,12 +220,12 @@ namespace internal
          * Distribute degrees of freedom on all cells, or on cells with the
          * correct subdomain_id if the corresponding argument is not equal to
          * numbers::invalid_subdomain_id. Return the total number of dofs
-         * returned.
+         * distributed.
          */
         template <int dim, int spacedim>
         static
-        unsigned int
-        distribute_dofs (const unsigned int        offset,
+        types::global_dof_index
+        distribute_dofs (const types::global_dof_index offset,
                          const types::subdomain_id subdomain_id,
                          DoFHandler<dim,spacedim> &dof_handler)
         {
@@ -237,7 +241,7 @@ namespace internal
           tria.save_user_flags(user_flags);
           const_cast<dealii::Triangulation<dim,spacedim> &>(tria).clear_user_flags ();
 
-          unsigned int next_free_dof = offset;
+          types::global_dof_index next_free_dof = offset;
           typename DoFHandler<dim,spacedim>::active_cell_iterator
           cell = dof_handler.begin_active(),
           endc = dof_handler.end();
@@ -252,9 +256,8 @@ namespace internal
                                                            next_free_dof);
 
           // update the cache used for cell dof indices
-          for (typename DoFHandler<dim,spacedim>::level_cell_iterator
-               cell = dof_handler.begin(); cell != dof_handler.end(); ++cell)
-            if (cell->subdomain_id() != numbers::artificial_subdomain_id)
+          for (cell = dof_handler.begin_active(); cell != endc; ++cell)
+            if (!cell->is_artificial())
               cell->update_cell_dof_indices_cache ();
 
           // finally restore the user flags
@@ -529,7 +532,7 @@ namespace internal
         template <int spacedim>
         static
         void
-        renumber_dofs (const std::vector<unsigned int> &new_numbers,
+        renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
                        const IndexSet &,
                        DoFHandler<1,spacedim>          &dof_handler,
                        const bool check_validity)
@@ -544,7 +547,7 @@ namespace internal
           // numbers may be invalid_dof_index,
           // namely when the appropriate
           // vertex/line/etc is unused
-          for (std::vector<unsigned int>::iterator
+          for (std::vector<types::global_dof_index>::iterator
                i=dof_handler.vertex_dofs.begin();
                i!=dof_handler.vertex_dofs.end(); ++i)
             if (*i != DoFHandler<1,spacedim>::invalid_dof_index)
@@ -561,7 +564,7 @@ namespace internal
                       ExcInternalError ());
 
           for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
-            for (std::vector<unsigned int>::iterator
+            for (std::vector<types::global_dof_index>::iterator
                  i=dof_handler.levels[level]->dof_object.dofs.begin();
                  i!=dof_handler.levels[level]->dof_object.dofs.end(); ++i)
               if (*i != DoFHandler<1,spacedim>::invalid_dof_index)
@@ -579,23 +582,23 @@ namespace internal
         template <int spacedim>
         static
         void
-        renumber_mg_dofs (const std::vector<unsigned int> &new_numbers,
+        renumber_mg_dofs (const std::vector<dealii::types::global_dof_index> &new_numbers,
                           const IndexSet &indices,
                           DoFHandler<1,spacedim>          &dof_handler,
                           const unsigned int level,
                           const bool check_validity)
         {
           for (typename std::vector<typename DoFHandler<1,spacedim>::MGVertexDoFs>::iterator
-                i=dof_handler.mg_vertex_dofs.begin();
+               i=dof_handler.mg_vertex_dofs.begin();
                i!=dof_handler.mg_vertex_dofs.end();
-              ++i)
+               ++i)
             // if the present vertex lives on
             // the current level
             if ((i->get_coarsest_level() <= level) &&
                 (i->get_finest_level() >= level))
               for (unsigned int d=0; d<dof_handler.get_fe().dofs_per_vertex; ++d)
                 {
-                  unsigned int idx = i->get_index (level, d);
+                  dealii::types::global_dof_index idx = i->get_index (level, d);
                   if (idx != DoFHandler<1>::invalid_dof_index)
                     i->set_index (level, d,
                                   (indices.n_elements() == 0)?
@@ -607,10 +610,10 @@ namespace internal
                 }
 
 
-          for (std::vector<unsigned int>::iterator
-                i=dof_handler.mg_levels[level]->dof_object.dofs.begin();
+          for (std::vector<types::global_dof_index>::iterator
+               i=dof_handler.mg_levels[level]->dof_object.dofs.begin();
                i!=dof_handler.mg_levels[level]->dof_object.dofs.end();
-              ++i)
+               ++i)
             {
               if (*i != DoFHandler<1>::invalid_dof_index)
                 {
@@ -626,9 +629,9 @@ namespace internal
         template <int spacedim>
         static
         void
-        renumber_dofs (const std::vector<unsigned int> &new_numbers,
+        renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
                        const IndexSet &indices,
-                       DoFHandler<2,spacedim>          &dof_handler,
+                       DoFHandler<2,spacedim> &dof_handler,
                        const bool check_validity)
         {
           // note that we can not use cell
@@ -641,7 +644,7 @@ namespace internal
           // numbers may be invalid_dof_index,
           // namely when the appropriate
           // vertex/line/etc is unused
-          for (std::vector<unsigned int>::iterator
+          for (std::vector<types::global_dof_index>::iterator
                i=dof_handler.vertex_dofs.begin();
                i!=dof_handler.vertex_dofs.end(); ++i)
             if (*i != DoFHandler<2,spacedim>::invalid_dof_index)
@@ -658,7 +661,7 @@ namespace internal
                       == false,
                       ExcInternalError ());
 
-          for (std::vector<unsigned int>::iterator
+          for (std::vector<types::global_dof_index>::iterator
                i=dof_handler.faces->lines.dofs.begin();
                i!=dof_handler.faces->lines.dofs.end(); ++i)
             if (*i != DoFHandler<2,spacedim>::invalid_dof_index)
@@ -668,7 +671,7 @@ namespace internal
 
           for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
             {
-              for (std::vector<unsigned int>::iterator
+              for (std::vector<types::global_dof_index>::iterator
                    i=dof_handler.levels[level]->dof_object.dofs.begin();
                    i!=dof_handler.levels[level]->dof_object.dofs.end(); ++i)
                 if (*i != DoFHandler<2,spacedim>::invalid_dof_index)
@@ -689,7 +692,7 @@ namespace internal
         template <int spacedim>
         static
         void
-        renumber_mg_dofs (const std::vector<unsigned int> &new_numbers,
+        renumber_mg_dofs (const std::vector<dealii::types::global_dof_index> &new_numbers,
                           const IndexSet &indices,
                           DoFHandler<2,spacedim>          &dof_handler,
                           const unsigned int level,
@@ -705,7 +708,7 @@ namespace internal
                 (i->get_finest_level() >= level))
               for (unsigned int d=0; d<dof_handler.get_fe().dofs_per_vertex; ++d)
                 {
-                  unsigned int idx =i->get_index (level, d/*,                    dof_handler.get_fe().dofs_per_vertex*/);
+                  dealii::types::global_dof_index idx =i->get_index (level, d/*,                    dof_handler.get_fe().dofs_per_vertex*/);
                   if (idx != DoFHandler<1>::invalid_dof_index)
                     i->set_index (level, d/*, dof_handler.get_fe().dofs_per_vertex*/,
                                   ((indices.n_elements() == 0) ?
@@ -740,7 +743,7 @@ namespace internal
                     {
                       for (unsigned int d=0; d<dof_handler.get_fe().dofs_per_line; ++d)
                         {
-                          unsigned int idx = cell->line(l)->mg_dof_index(level, d);
+                          dealii::types::global_dof_index idx = cell->line(l)->mg_dof_index(level, d);
                           if (idx != DoFHandler<1>::invalid_dof_index)
                             cell->line(l)->set_mg_dof_index (level, d, ((indices.n_elements() == 0) ?
                                                                         new_numbers[idx] :
@@ -754,7 +757,7 @@ namespace internal
               const_cast<dealii::Triangulation<2,spacedim> &>(dof_handler.get_tria()).load_user_flags (user_flags);
             }
 
-          for (std::vector<unsigned int>::iterator i=dof_handler.mg_levels[level]->dof_object.dofs.begin();
+          for (std::vector<types::global_dof_index>::iterator i=dof_handler.mg_levels[level]->dof_object.dofs.begin();
                i!=dof_handler.mg_levels[level]->dof_object.dofs.end(); ++i)
             {
               if (*i != DoFHandler<2>::invalid_dof_index)
@@ -772,7 +775,7 @@ namespace internal
         template <int spacedim>
         static
         void
-        renumber_dofs (const std::vector<unsigned int> &new_numbers,
+        renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
                        const IndexSet &indices,
                        DoFHandler<3,spacedim>          &dof_handler,
                        const bool check_validity)
@@ -787,7 +790,7 @@ namespace internal
           // numbers may be invalid_dof_index,
           // namely when the appropriate
           // vertex/line/etc is unused
-          for (std::vector<unsigned int>::iterator
+          for (std::vector<types::global_dof_index>::iterator
                i=dof_handler.vertex_dofs.begin();
                i!=dof_handler.vertex_dofs.end(); ++i)
             if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
@@ -804,14 +807,14 @@ namespace internal
                       == false,
                       ExcInternalError ());
 
-          for (std::vector<unsigned int>::iterator
+          for (std::vector<types::global_dof_index>::iterator
                i=dof_handler.faces->lines.dofs.begin();
                i!=dof_handler.faces->lines.dofs.end(); ++i)
             if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
               *i = ((indices.n_elements() == 0) ?
                     new_numbers[*i] :
                     new_numbers[indices.index_within_set(*i)]);
-          for (std::vector<unsigned int>::iterator
+          for (std::vector<types::global_dof_index>::iterator
                i=dof_handler.faces->quads.dofs.begin();
                i!=dof_handler.faces->quads.dofs.end(); ++i)
             if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
@@ -821,7 +824,7 @@ namespace internal
 
           for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
             {
-              for (std::vector<unsigned int>::iterator
+              for (std::vector<types::global_dof_index>::iterator
                    i=dof_handler.levels[level]->dof_object.dofs.begin();
                    i!=dof_handler.levels[level]->dof_object.dofs.end(); ++i)
                 if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
@@ -842,9 +845,9 @@ namespace internal
         template <int spacedim>
         static
         void
-        renumber_mg_dofs (const std::vector<unsigned int> &,
-                          const IndexSet                  &,
-                          DoFHandler<3,spacedim>          &,
+        renumber_mg_dofs (const std::vector<dealii::types::global_dof_index> &,
+                          const IndexSet &,
+                          DoFHandler<3,spacedim> &,
                           const unsigned int               ,
                           const bool                       )
         {
@@ -872,7 +875,7 @@ namespace internal
       Sequential<dim,spacedim>::
       distribute_dofs (DoFHandler<dim,spacedim> &dof_handler) const
       {
-        const unsigned int n_dofs =
+        const types::global_dof_index n_dofs =
           Implementation::distribute_dofs (0,
                                            numbers::invalid_subdomain_id,
                                            dof_handler);
@@ -890,8 +893,8 @@ namespace internal
         number_cache.locally_owned_dofs.compress();
 
         number_cache.n_locally_owned_dofs_per_processor
-          = std::vector<unsigned int> (1,
-                                       number_cache.n_global_dofs);
+          = std::vector<types::global_dof_index> (1,
+                                                  number_cache.n_global_dofs);
 
         number_cache.locally_owned_dofs_per_processor
           = std::vector<IndexSet> (1,
@@ -913,19 +916,23 @@ namespace internal
 
         for (unsigned int level = 0; level < dof_handler.get_tria().n_levels(); ++level)
           {
-            unsigned int next_free_dof = Implementation::distribute_dofs_on_level(0, numbers::invalid_subdomain_id, dof_handler, level);
+            types::global_dof_index next_free_dof = Implementation::distribute_dofs_on_level(0, numbers::invalid_subdomain_id, dof_handler, level);
 
             number_caches[level].n_global_dofs = next_free_dof;
             number_caches[level].n_locally_owned_dofs = next_free_dof;
+            number_caches[level].locally_owned_dofs = complete_index_set(next_free_dof);
+            number_caches[level].locally_owned_dofs_per_processor.resize(1);
+            number_caches[level].locally_owned_dofs_per_processor[0] = complete_index_set(next_free_dof);
+            number_caches[level].n_locally_owned_dofs_per_processor.resize(1);
+            number_caches[level].n_locally_owned_dofs_per_processor[0] = next_free_dof;
           }
-
         const_cast<dealii::Triangulation<dim, spacedim>&>(dof_handler.get_tria()).load_user_flags (user_flags);
       }
 
       template <int dim, int spacedim>
       NumberCache
       Sequential<dim,spacedim>::
-      renumber_dofs (const std::vector<unsigned int>  &new_numbers,
+      renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
                      dealii::DoFHandler<dim,spacedim> &dof_handler) const
       {
         Implementation::renumber_dofs (new_numbers, IndexSet(0),
@@ -948,8 +955,8 @@ namespace internal
         number_cache.locally_owned_dofs.compress();
 
         number_cache.n_locally_owned_dofs_per_processor
-          = std::vector<unsigned int> (1,
-                                       number_cache.n_global_dofs);
+          = std::vector<types::global_dof_index> (1,
+                                                  number_cache.n_global_dofs);
 
         number_cache.locally_owned_dofs_per_processor
           = std::vector<IndexSet> (1,
@@ -982,7 +989,7 @@ namespace internal
           {
             std::vector<unsigned int> tree_index;
             std::vector<typename dealii::internal::p4est::types<dim>::quadrant> quadrants;
-            std::vector<unsigned int> dofs;
+            std::vector<dealii::types::global_dof_index> dofs;
 
             unsigned int bytes_for_buffer () const
             {
@@ -990,7 +997,7 @@ namespace internal
                       tree_index.size() * sizeof(unsigned int) +
                       quadrants.size() * sizeof(typename dealii::internal::p4est
                                                 ::types<dim>::quadrant) +
-                      dofs.size() * sizeof(unsigned int));
+                      dofs.size() * sizeof(dealii::types::global_dof_index));
             }
 
             void pack_data (std::vector<char> &buffer) const
@@ -1017,8 +1024,8 @@ namespace internal
 
               std::memcpy(ptr,
                           &dofs[0],
-                          dofs.size() * sizeof(unsigned int));
-              ptr += dofs.size() * sizeof(unsigned int);
+                          dofs.size() * sizeof(dealii::types::global_dof_index));
+              ptr += dofs.size() * sizeof(dealii::types::global_dof_index);
 
               Assert (ptr == &buffer[0]+buffer.size(),
                       ExcInternalError());
@@ -1092,7 +1099,7 @@ namespace internal
                   // this cell's dof_indices
                   // need to be sent to
                   // someone
-                  std::vector<unsigned int>
+                  std::vector<dealii::types::global_dof_index>
                   local_dof_indices (dealii_cell->get_fe().dofs_per_cell);
                   dealii_cell->get_dof_indices (local_dof_indices);
 
@@ -1210,7 +1217,7 @@ namespace internal
                   // this cell's dof_indices
                   // need to be sent to
                   // someone
-                  std::vector<unsigned int>
+                  std::vector<dealii::types::global_dof_index>
                   local_dof_indices (dealii_cell->get_fe().dofs_per_cell);
                   dealii_cell->get_mg_dof_indices (local_dof_indices);
 
@@ -1253,7 +1260,7 @@ namespace internal
           const typename dealii::internal::p4est::types<dim>::quadrant &p4est_cell,
           const typename DoFHandler<dim,spacedim>::level_cell_iterator &dealii_cell,
           const typename dealii::internal::p4est::types<dim>::quadrant &quadrant,
-          unsigned int *dofs)
+          dealii::types::global_dof_index *dofs)
         {
           if (internal::p4est::quadrant_is_equal<dim>(p4est_cell, quadrant))
             {
@@ -1261,7 +1268,7 @@ namespace internal
               Assert(dealii_cell->is_ghost(), ExcInternalError());
 
               // update dof indices of cell
-              std::vector<unsigned int>
+              std::vector<dealii::types::global_dof_index>
               dof_indices (dealii_cell->get_fe().dofs_per_cell);
               dealii_cell->update_cell_dof_indices_cache();
               dealii_cell->get_dof_indices(dof_indices);
@@ -1320,7 +1327,7 @@ namespace internal
           const typename dealii::internal::p4est::types<dim>::quadrant &p4est_cell,
           const typename DoFHandler<dim,spacedim>::level_cell_iterator &dealii_cell,
           const typename dealii::internal::p4est::types<dim>::quadrant &quadrant,
-          unsigned int *dofs,
+          dealii::types::global_dof_index *dofs,
           unsigned int level)
         {
           if (internal::p4est::quadrant_is_equal<dim>(p4est_cell, quadrant))
@@ -1329,7 +1336,7 @@ namespace internal
               Assert(dealii_cell->level()==(int)level, ExcInternalError());
 
               // update dof indices of cell
-              std::vector<unsigned int>
+              std::vector<dealii::types::global_dof_index>
               dof_indices (dealii_cell->get_fe().dofs_per_cell);
               dealii_cell->get_mg_dof_indices(dof_indices);
 
@@ -1432,8 +1439,8 @@ namespace internal
         communicate_dof_indices_on_marked_cells
         (const DoFHandler<1,spacedim> &,
          const std::map<unsigned int, std::set<dealii::types::subdomain_id> > &,
-         const std::vector<unsigned int> &,
-         const std::vector<unsigned int> &)
+         const std::vector<dealii::types::global_dof_index> &,
+         const std::vector<dealii::types::global_dof_index> &)
         {
           Assert (false, ExcNotImplemented());
         }
@@ -1445,8 +1452,8 @@ namespace internal
         communicate_dof_indices_on_marked_cells
         (const DoFHandler<dim,spacedim> &dof_handler,
          const std::map<unsigned int, std::set<dealii::types::subdomain_id> > &vertices_with_ghost_neighbors,
-         const std::vector<unsigned int> &coarse_cell_to_p4est_tree_permutation,
-         const std::vector<unsigned int> &p4est_tree_to_coarse_cell_permutation)
+         const std::vector<dealii::types::global_dof_index> &coarse_cell_to_p4est_tree_permutation,
+         const std::vector<dealii::types::global_dof_index> &p4est_tree_to_coarse_cell_permutation)
         {
 #ifndef DEAL_II_WITH_P4EST
           (void)vertices_with_ghost_neighbors;
@@ -1520,7 +1527,7 @@ namespace internal
           // that are going to send stuff to us
           std::set<dealii::types::subdomain_id> senders;
           {
-            std::vector<unsigned int> local_dof_indices;
+            std::vector<dealii::types::global_dof_index> local_dof_indices;
             typename DoFHandler<dim,spacedim>::active_cell_iterator
             cell, endc = dof_handler.end();
 
@@ -1568,14 +1575,17 @@ namespace internal
               memcpy(&cells, ptr, sizeof(unsigned int));
               ptr+=sizeof(unsigned int);
 
-              //reinterpret too evil?
+              //TODO: reinterpret too evil?
               unsigned int *treeindex=reinterpret_cast<unsigned int *>(ptr);
               ptr+=cells*sizeof(unsigned int);
               typename dealii::internal::p4est::types<dim>::quadrant *quadrant
                 =reinterpret_cast<typename dealii::internal::p4est::types<dim>::quadrant *>(ptr);
               ptr+=cells*sizeof(typename dealii::internal::p4est::types<dim>::quadrant);
-              unsigned int *dofs=reinterpret_cast<unsigned int *>(ptr);
+              dealii::types::global_dof_index *dofs
+                = reinterpret_cast<dealii::types::global_dof_index *>(ptr);
 
+              // the dofs pointer contains for each cell the number of dofs
+              // on that cell (dofs[0]) followed by the dof indices itself.
               for (unsigned int c=0; c<cells; ++c, dofs+=1+dofs[0])
                 {
                   typename DoFHandler<dim,spacedim>::level_cell_iterator
@@ -1654,8 +1664,8 @@ namespace internal
         communicate_mg_dof_indices_on_marked_cells
         (const DoFHandler<1,spacedim> &,
          const std::map<unsigned int, std::set<dealii::types::subdomain_id> > &,
-         const std::vector<unsigned int> &,
-         const std::vector<unsigned int> &,
+         const std::vector<dealii::types::global_dof_index> &,
+         const std::vector<dealii::types::global_dof_index> &,
          const unsigned int)
         {
           Assert (false, ExcNotImplemented());
@@ -1668,8 +1678,8 @@ namespace internal
         communicate_mg_dof_indices_on_marked_cells
         (const DoFHandler<dim,spacedim> &dof_handler,
          const std::map<unsigned int, std::set<dealii::types::subdomain_id> > &vertices_with_ghost_neighbors,
-         const std::vector<unsigned int> &coarse_cell_to_p4est_tree_permutation,
-         const std::vector<unsigned int> &p4est_tree_to_coarse_cell_permutation,
+         const std::vector<dealii::types::global_dof_index> &coarse_cell_to_p4est_tree_permutation,
+         const std::vector<dealii::types::global_dof_index> &p4est_tree_to_coarse_cell_permutation,
          const unsigned int level)
         {
 #ifndef DEAL_II_WITH_P4EST
@@ -1751,7 +1761,7 @@ namespace internal
           std::set<dealii::types::subdomain_id> senders;
           if (level < tr->n_levels())
             {
-              std::vector<unsigned int> local_dof_indices;
+              std::vector<dealii::types::global_dof_index> local_dof_indices;
               typename DoFHandler<dim,spacedim>::level_cell_iterator
               cell, endc = dof_handler.end(level);
 
@@ -1810,8 +1820,11 @@ namespace internal
               typename dealii::internal::p4est::types<dim>::quadrant *quadrant
                 =reinterpret_cast<typename dealii::internal::p4est::types<dim>::quadrant *>(ptr);
               ptr+=cells*sizeof(typename dealii::internal::p4est::types<dim>::quadrant);
-              unsigned int *dofs=reinterpret_cast<unsigned int *>(ptr);
+              dealii::types::global_dof_index *dofs
+                = reinterpret_cast<dealii::types::global_dof_index *>(ptr);
 
+              // the dofs pointer contains for each cell the number of dofs
+              // on that cell (dofs[0]) followed by the dof indices itself.
               for (unsigned int c=0; c<cells; ++c, dofs+=1+dofs[0])
                 {
                   typename DoFHandler<dim,spacedim>::level_cell_iterator
@@ -1907,19 +1920,19 @@ namespace internal
 
         //* 1. distribute on own
         //* subdomain
-        const unsigned int n_initial_local_dofs =
+        const dealii::types::global_dof_index n_initial_local_dofs =
           Implementation::distribute_dofs (0, tr->locally_owned_subdomain(),
                                            dof_handler);
 
         //* 2. iterate over ghostcells and
         //kill dofs that are not owned
         //by us
-        std::vector<unsigned int> renumbering(n_initial_local_dofs);
+        std::vector<dealii::types::global_dof_index> renumbering(n_initial_local_dofs);
         for (unsigned int i=0; i<renumbering.size(); ++i)
           renumbering[i] = i;
 
         {
-          std::vector<unsigned int> local_dof_indices;
+          std::vector<dealii::types::global_dof_index> local_dof_indices;
 
           typename DoFHandler<dim,spacedim>::active_cell_iterator
           cell = dof_handler.begin_active(),
@@ -1953,7 +1966,7 @@ namespace internal
 
         // make indices consecutive
         number_cache.n_locally_owned_dofs = 0;
-        for (std::vector<unsigned int>::iterator it=renumbering.begin();
+        for (std::vector<dealii::types::global_dof_index>::iterator it=renumbering.begin();
              it!=renumbering.end(); ++it)
           if (*it != DoFHandler<dim,spacedim>::invalid_dof_index)
             *it = number_cache.n_locally_owned_dofs++;
@@ -1963,19 +1976,19 @@ namespace internal
         number_cache.n_locally_owned_dofs_per_processor.resize(n_cpus);
 
         MPI_Allgather ( &number_cache.n_locally_owned_dofs,
-                        1, MPI_UNSIGNED,
+                        1, DEAL_II_DOF_INDEX_MPI_TYPE,
                         &number_cache.n_locally_owned_dofs_per_processor[0],
-                        1, MPI_UNSIGNED,
+                        1, DEAL_II_DOF_INDEX_MPI_TYPE,
                         tr->get_communicator());
 
-        const unsigned int
+        const dealii::types::global_dof_index
         shift = std::accumulate (number_cache
                                  .n_locally_owned_dofs_per_processor.begin(),
                                  number_cache
                                  .n_locally_owned_dofs_per_processor.begin()
                                  + tr->locally_owned_subdomain(),
-                                 0);
-        for (std::vector<unsigned int>::iterator it=renumbering.begin();
+                                 static_cast<dealii::types::global_dof_index>(0));
+        for (std::vector<dealii::types::global_dof_index>::iterator it=renumbering.begin();
              it!=renumbering.end(); ++it)
           if (*it != DoFHandler<dim,spacedim>::invalid_dof_index)
             (*it) += shift;
@@ -1995,7 +2008,7 @@ namespace internal
                              .n_locally_owned_dofs_per_processor.begin(),
                              number_cache
                              .n_locally_owned_dofs_per_processor.end(),
-                             0);
+                             static_cast<dealii::types::global_dof_index>(0));
 
         number_cache.locally_owned_dofs = IndexSet(number_cache.n_global_dofs);
         number_cache.locally_owned_dofs
@@ -2006,7 +2019,7 @@ namespace internal
         // fill global_dof_indexsets
         number_cache.locally_owned_dofs_per_processor.resize(n_cpus);
         {
-          unsigned int lshift = 0;
+          dealii::types::global_dof_index lshift = 0;
           for (unsigned int i=0; i<n_cpus; ++i)
             {
               number_cache.locally_owned_dofs_per_processor[i]
@@ -2086,7 +2099,7 @@ namespace internal
 #ifdef DEBUG
         //check that we are really done
         {
-          std::vector<unsigned int> local_dof_indices;
+          std::vector<dealii::types::global_dof_index> local_dof_indices;
           typename DoFHandler<dim,spacedim>::active_cell_iterator
           cell, endc = dof_handler.end();
 
@@ -2158,13 +2171,13 @@ namespace internal
             //* 2. iterate over ghostcells and
             //kill dofs that are not owned
             //by us
-            std::vector<unsigned int> renumbering(n_initial_local_dofs);
-            for (unsigned int i=0; i<renumbering.size(); ++i)
+            std::vector<dealii::types::global_dof_index> renumbering(n_initial_local_dofs);
+            for (dealii::types::global_dof_index i=0; i<renumbering.size(); ++i)
               renumbering[i] = i;
 
             if (level<tr->n_levels())
               {
-                std::vector<unsigned int> local_dof_indices;
+                std::vector<dealii::types::global_dof_index> local_dof_indices;
 
                 typename DoFHandler<dim,spacedim>::level_cell_iterator
                 cell = dof_handler.begin(level),
@@ -2198,7 +2211,7 @@ namespace internal
 
             // make indices consecutive
             number_cache.n_locally_owned_dofs = 0;
-            for (std::vector<unsigned int>::iterator it=renumbering.begin();
+            for (std::vector<dealii::types::global_dof_index>::iterator it=renumbering.begin();
                  it!=renumbering.end(); ++it)
               if (*it != DoFHandler<dim,spacedim>::invalid_dof_index)
                 *it = number_cache.n_locally_owned_dofs++;
@@ -2208,19 +2221,19 @@ namespace internal
             number_cache.n_locally_owned_dofs_per_processor.resize(n_cpus);
 
             MPI_Allgather ( &number_cache.n_locally_owned_dofs,
-                            1, MPI_UNSIGNED,
+                            1, DEAL_II_DOF_INDEX_MPI_TYPE,
                             &number_cache.n_locally_owned_dofs_per_processor[0],
-                            1, MPI_UNSIGNED,
+                            1, DEAL_II_DOF_INDEX_MPI_TYPE,
                             tr->get_communicator());
 
-            const unsigned int
+            const dealii::types::global_dof_index
             shift = std::accumulate (number_cache
                                      .n_locally_owned_dofs_per_processor.begin(),
                                      number_cache
                                      .n_locally_owned_dofs_per_processor.begin()
                                      + tr->locally_owned_subdomain(),
                                      0);
-            for (std::vector<unsigned int>::iterator it=renumbering.begin();
+            for (std::vector<dealii::types::global_dof_index>::iterator it=renumbering.begin();
                  it!=renumbering.end(); ++it)
               if (*it != DoFHandler<dim,spacedim>::invalid_dof_index)
                 (*it) += shift;
@@ -2251,7 +2264,7 @@ namespace internal
             // fill global_dof_indexsets
             number_cache.locally_owned_dofs_per_processor.resize(n_cpus);
             {
-              unsigned int lshift = 0;
+              dealii::types::global_dof_index lshift = 0;
               for (unsigned int i=0; i<n_cpus; ++i)
                 {
                   number_cache.locally_owned_dofs_per_processor[i]
@@ -2337,7 +2350,7 @@ namespace internal
             //check that we are really done
             if (level < tr->n_levels())
               {
-                std::vector<unsigned int> local_dof_indices;
+                std::vector<dealii::types::global_dof_index> local_dof_indices;
                 typename DoFHandler<dim,spacedim>::level_cell_iterator
                 cell, endc = dof_handler.end(level);
 
@@ -2366,7 +2379,7 @@ namespace internal
       template <int dim, int spacedim>
       NumberCache
       ParallelDistributed<dim, spacedim>::
-      renumber_dofs (const std::vector<unsigned int> &new_numbers,
+      renumber_dofs (const std::vector<dealii::types::global_dof_index> &new_numbers,
                      dealii::DoFHandler<dim,spacedim> &dof_handler) const
       {
         Assert (new_numbers.size() == dof_handler.locally_owned_dofs().n_elements(),
@@ -2391,9 +2404,9 @@ namespace internal
         number_cache.locally_owned_dofs = IndexSet (dof_handler.n_dofs());
         if (dof_handler.locally_owned_dofs().n_elements()>0)
           {
-            std::vector<unsigned int>::const_iterator it = new_numbers.begin();
+            std::vector<dealii::types::global_dof_index>::const_iterator it = new_numbers.begin();
             const unsigned int n_blocks = dof_handler.get_fe().n_blocks();
-            std::vector<std::pair<unsigned int,unsigned int> > block_indices(n_blocks);
+            std::vector<std::pair<dealii::types::global_dof_index,unsigned int> > block_indices(n_blocks);
             block_indices[0].first = *it++;
             block_indices[0].second = 1;
             unsigned int current_block = 0, n_filled_blocks = 1;
@@ -2442,7 +2455,7 @@ namespace internal
             // to blocks. If yes, we can add the block
             // ranges to the IndexSet, otherwise we need
             // to go through the indices once again and
-            // add each element individually (slow!)
+            // add each element individually
             unsigned int sum = 0;
             for (unsigned int i=0; i<n_filled_blocks; ++i)
               sum += block_indices[i].second;
@@ -2452,8 +2465,7 @@ namespace internal
                                                            block_indices[i].first+
                                                            block_indices[i].second);
             else
-              for (it=new_numbers.begin() ; it != new_numbers.end(); ++it)
-                number_cache.locally_owned_dofs.add_index (*it);
+              number_cache.locally_owned_dofs.add_indices(new_numbers.begin(), new_numbers.end());
           }
 
 
@@ -2476,7 +2488,7 @@ namespace internal
         // mark not locally active DoFs as
         // invalid
         {
-          std::vector<unsigned int> local_dof_indices;
+          std::vector<dealii::types::global_dof_index> local_dof_indices;
 
           typename DoFHandler<dim,spacedim>::active_cell_iterator
           cell = dof_handler.begin_active(),
@@ -2621,7 +2633,7 @@ namespace internal
                                .n_locally_owned_dofs_per_processor.begin(),
                                number_cache
                                .n_locally_owned_dofs_per_processor.end(),
-                               0);
+                               static_cast<dealii::types::global_dof_index>(0));
 
           tr->load_user_flags(user_flags);
         }
index dbe008f66473af6a45b9840d8b769eac74eb15dc..9b86beb03f213fecafa74be4337e3a66dc0f293f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index f5709f131394e0a506a20c6ae5cb6b8ee1a73ce1..113bf75afbb2ee2453177c16c7498669af3fc8bd 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/memory_consumption.h>
@@ -41,7 +43,7 @@ namespace internal
                    const unsigned int       obj_index,
                    const unsigned int       fe_index,
                    const unsigned int       local_index,
-                   const unsigned int       global_index)
+                   const types::global_dof_index       global_index)
     {
       Assert ((fe_index == dealii::DoFHandler<dh_dim, spacedim>::default_fe_index),
               ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
index b2563c8dbe4dd30f3f10e2d12def6e0b887b01d7..5f234b43b62e086df3c610094fbfe58529509245 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2010 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
@@ -21,7 +25,7 @@ for (deal_II_dimension : DIMENSIONS)
 for (deal_II_dimension, structdim : DIMENSIONS)
   {
     template
-    unsigned int
+    types::global_dof_index
     DoFObjects<structdim>::
     get_dof_index (const dealii::DoFHandler<deal_II_dimension> &dof_handler,
                   const unsigned int       obj_index,
@@ -35,12 +39,12 @@ for (deal_II_dimension, structdim : DIMENSIONS)
                   const unsigned int       obj_index,
                   const unsigned int       fe_index,
                   const unsigned int       local_index,
-                  const unsigned int       global_index);
+                  const types::global_dof_index       global_index);
 
 #if (deal_II_dimension < 3) && (structdim < 3)
 
     template
-    unsigned int
+    types::global_dof_index
     DoFObjects<structdim>::
     get_dof_index (const dealii::DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_handler,
                   const unsigned int       obj_index,
@@ -54,14 +58,14 @@ for (deal_II_dimension, structdim : DIMENSIONS)
                   const unsigned int       obj_index,
                   const unsigned int       fe_index,
                   const unsigned int       local_index,
-                  const unsigned int       global_index);
+                  const types::global_dof_index global_index);
 #endif
 
 
 #if (deal_II_dimension == 3) && (structdim < 3)
 
     template
-    unsigned int
+    types::global_dof_index
     DoFObjects<structdim>::
     get_dof_index (const dealii::DoFHandler<1,3> &dof_handler,
                   const unsigned int       obj_index,
@@ -75,7 +79,7 @@ for (deal_II_dimension, structdim : DIMENSIONS)
                   const unsigned int       obj_index,
                   const unsigned int       fe_index,
                   const unsigned int       local_index,
-                  const unsigned int       global_index);
+                  const types::global_dof_index       global_index);
 #endif
   }
 
index 8295743bfa0ccdfe770b6b78eef9fc2b9d16b659..52646d1be30c247f8c75645b467595a01d6c80c3 100644 (file)
@@ -1,20 +1,23 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/thread_management.h>
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/quadrature_lib.h>
+#include <deal.II/base/types.h>
 #include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/sparsity_pattern.h>
@@ -68,7 +71,7 @@ namespace DoFRenumbering
 {
   namespace boost
   {
-    namespace types
+    namespace boosttypes
     {
       using namespace ::boost;
       using namespace std;
@@ -88,8 +91,8 @@ namespace DoFRenumbering
       template <class DH>
       void create_graph (const DH                                                       &dof_handler,
                          const bool                                                      use_constraints,
-                         types::Graph                                                   &graph,
-                         types::property_map<types::Graph,types::vertex_degree_t>::type &graph_degree)
+                         boosttypes::Graph                                                   &graph,
+                         boosttypes::property_map<boosttypes::Graph,boosttypes::vertex_degree_t>::type &graph_degree)
       {
         {
           // create intermediate sparsity pattern
@@ -109,7 +112,7 @@ namespace DoFRenumbering
               add_edge (row, csp.column_number (row, col), graph);
         }
 
-        types::graph_traits<types::Graph>::vertex_iterator ui, ui_end;
+        boosttypes::graph_traits<boosttypes::Graph>::vertex_iterator ui, ui_end;
 
         graph_degree = get(::boost::vertex_degree, graph);
         for (::boost::tie(ui, ui_end) = vertices(graph); ui != ui_end; ++ui)
@@ -124,8 +127,8 @@ namespace DoFRenumbering
                    const bool       reversed_numbering,
                    const bool       use_constraints)
     {
-      std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
-                                            DH::invalid_dof_index);
+      std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
+                                                       DH::invalid_dof_index);
       compute_Cuthill_McKee(renumbering, dof_handler, reversed_numbering,
                             use_constraints);
 
@@ -138,23 +141,23 @@ namespace DoFRenumbering
 
     template <class DH>
     void
-    compute_Cuthill_McKee (std::vector<unsigned int> &new_dof_indices,
+    compute_Cuthill_McKee (std::vector<types::global_dof_index> &new_dof_indices,
                            const DH        &dof_handler,
                            const bool       reversed_numbering,
                            const bool       use_constraints)
     {
-      types::Graph
+      boosttypes::Graph
       graph(dof_handler.n_dofs());
-      types::property_map<types::Graph,types::vertex_degree_t>::type
+      boosttypes::property_map<boosttypes::Graph,boosttypes::vertex_degree_t>::type
       graph_degree;
 
       internal::create_graph (dof_handler, use_constraints, graph, graph_degree);
 
-      types::property_map<types::Graph, types::vertex_index_t>::type
+      boosttypes::property_map<boosttypes::Graph, boosttypes::vertex_index_t>::type
       index_map = get(::boost::vertex_index, graph);
 
 
-      std::vector<types::Vertex> inv_perm(num_vertices(graph));
+      std::vector<boosttypes::Vertex> inv_perm(num_vertices(graph));
 
       if (reversed_numbering == false)
         ::boost::cuthill_mckee_ordering(graph, inv_perm.rbegin(),
@@ -165,7 +168,7 @@ namespace DoFRenumbering
                                         get(::boost::vertex_color, graph),
                                         make_degree_map(graph));
 
-      for (types::size_type c = 0; c != inv_perm.size(); ++c)
+      for (boosttypes::size_type c = 0; c != inv_perm.size(); ++c)
         new_dof_indices[index_map[inv_perm[c]]] = c;
 
       Assert (std::find (new_dof_indices.begin(), new_dof_indices.end(),
@@ -181,8 +184,8 @@ namespace DoFRenumbering
                    const bool       reversed_numbering,
                    const bool       use_constraints)
     {
-      std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
-                                            DH::invalid_dof_index);
+      std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
+                                                       DH::invalid_dof_index);
       compute_king_ordering(renumbering, dof_handler, reversed_numbering,
                             use_constraints);
 
@@ -195,30 +198,30 @@ namespace DoFRenumbering
 
     template <class DH>
     void
-    compute_king_ordering (std::vector<unsigned int> &new_dof_indices,
+    compute_king_ordering (std::vector<types::global_dof_index> &new_dof_indices,
                            const DH        &dof_handler,
                            const bool       reversed_numbering,
                            const bool       use_constraints)
     {
-      types::Graph
+      boosttypes::Graph
       graph(dof_handler.n_dofs());
-      types::property_map<types::Graph,types::vertex_degree_t>::type
+      boosttypes::property_map<boosttypes::Graph,boosttypes::vertex_degree_t>::type
       graph_degree;
 
       internal::create_graph (dof_handler, use_constraints, graph, graph_degree);
 
-      types::property_map<types::Graph, types::vertex_index_t>::type
+      boosttypes::property_map<boosttypes::Graph, boosttypes::vertex_index_t>::type
       index_map = get(::boost::vertex_index, graph);
 
 
-      std::vector<types::Vertex> inv_perm(num_vertices(graph));
+      std::vector<boosttypes::Vertex> inv_perm(num_vertices(graph));
 
       if (reversed_numbering == false)
         ::boost::king_ordering(graph, inv_perm.rbegin());
       else
         ::boost::king_ordering(graph, inv_perm.begin());
 
-      for (types::size_type c = 0; c != inv_perm.size(); ++c)
+      for (boosttypes::size_type c = 0; c != inv_perm.size(); ++c)
         new_dof_indices[index_map[inv_perm[c]]] = c;
 
       Assert (std::find (new_dof_indices.begin(), new_dof_indices.end(),
@@ -234,8 +237,8 @@ namespace DoFRenumbering
                     const bool       reversed_numbering,
                     const bool       use_constraints)
     {
-      std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
-                                            DH::invalid_dof_index);
+      std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
+                                                       DH::invalid_dof_index);
       compute_minimum_degree(renumbering, dof_handler, reversed_numbering,
                              use_constraints);
 
@@ -248,7 +251,7 @@ namespace DoFRenumbering
 
     template <class DH>
     void
-    compute_minimum_degree (std::vector<unsigned int> &new_dof_indices,
+    compute_minimum_degree (std::vector<types::global_dof_index> &new_dof_indices,
                             const DH        &dof_handler,
                             const bool       reversed_numbering,
                             const bool       use_constraints)
@@ -275,7 +278,7 @@ namespace DoFRenumbering
 
       Graph G(n);
 
-      std::vector<unsigned int> dofs_on_this_cell;
+      std::vector<dealii::types::global_dof_index> dofs_on_this_cell;
 
       typename DH::active_cell_iterator cell = dof_handler.begin_active(),
                                         endc = dof_handler.end();
@@ -353,10 +356,10 @@ namespace DoFRenumbering
   Cuthill_McKee (DH              &dof_handler,
                  const bool       reversed_numbering,
                  const bool       use_constraints,
-                 const std::vector<unsigned int> &starting_indices)
+                 const std::vector<types::global_dof_index> &starting_indices)
   {
-    std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
-                                          DH::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
+                                                     DH::invalid_dof_index);
     compute_Cuthill_McKee(renumbering, dof_handler, reversed_numbering,
                           use_constraints, starting_indices);
 
@@ -370,11 +373,11 @@ namespace DoFRenumbering
 
   template <class DH>
   void
-  compute_Cuthill_McKee (std::vector<unsigned int> &new_indices,
+  compute_Cuthill_McKee (std::vector<types::global_dof_index> &new_indices,
                          const DH                  &dof_handler,
                          const bool                 reversed_numbering,
                          const bool                 use_constraints,
-                         const std::vector<unsigned int> &starting_indices)
+                         const std::vector<types::global_dof_index> &starting_indices)
   {
     // make the connection graph. in
     // more than 2d use an intermediate
@@ -432,18 +435,30 @@ namespace DoFRenumbering
   void Cuthill_McKee (DH               &dof_handler,
                       const unsigned int               level,
                       const bool                       reversed_numbering,
-                      const std::vector<unsigned int> &starting_indices)
+                      const std::vector<types::global_dof_index> &starting_indices)
   {
-    Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int,
+    Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcNotInitialized());
-//TODO: we should be doing the same here as in the other compute_CMK function to preserve some memory
 
     // make the connection graph
-    SparsityPattern sparsity (dof_handler.n_dofs(level),
-                              dof_handler.max_couplings_between_dofs());
-    MGTools::make_sparsity_pattern (dof_handler, sparsity, level);
+    SparsityPattern sparsity;
+    if (DH::dimension < 2)
+      {
+        sparsity.reinit (dof_handler.n_dofs(level),
+                         dof_handler.n_dofs(level),
+                         dof_handler.max_couplings_between_dofs());
+        MGTools::make_sparsity_pattern (dof_handler, sparsity, level);
+        sparsity.compress();
+      }
+    else
+      {
+        CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(level),
+                                             dof_handler.n_dofs(level));
+        MGTools::make_sparsity_pattern (dof_handler, csp, level);
+        sparsity.copy_from (csp);
+      }
 
-    std::vector<unsigned int> new_indices(sparsity.n_rows());
+    std::vector<types::global_dof_index> new_indices(sparsity.n_rows());
     SparsityTools::reorder_Cuthill_McKee (sparsity, new_indices,
                                           starting_indices);
 
@@ -463,19 +478,19 @@ namespace DoFRenumbering
   component_wise (DoFHandler<dim,spacedim>        &dof_handler,
                   const std::vector<unsigned int> &component_order_arg)
   {
-    std::vector<unsigned int> renumbering (dof_handler.n_locally_owned_dofs(),
-                                           DoFHandler<dim>::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering (dof_handler.n_locally_owned_dofs(),
+                                                      DoFHandler<dim>::invalid_dof_index);
 
     typename DoFHandler<dim,spacedim>::active_cell_iterator
     start = dof_handler.begin_active();
     const typename DoFHandler<dim,spacedim>::level_cell_iterator
     end = dof_handler.end();
 
-    const unsigned int result =
+    const types::global_dof_index result =
       compute_component_wise<dim,spacedim,
       typename DoFHandler<dim,spacedim>::active_cell_iterator,
       typename DoFHandler<dim,spacedim>::level_cell_iterator>
-      (renumbering, start, end, component_order_arg);
+      (renumbering, start, end, component_order_arg, false);
     if (result == 0)
       return;
 
@@ -496,7 +511,7 @@ namespace DoFRenumbering
     dof_handler.renumber_dofs (renumbering);
 
     // for (unsigned int level=0;level<dof_handler.get_tria().n_levels();++level)
-    //   if (dof_handler.n_dofs(level) != numbers::invalid_unsigned_int)
+    //   if (dof_handler.n_dofs(level) != numbers::invalid_dof_index)
     //  component_wise(dof_handler, level, component_order_arg);
   }
 
@@ -519,19 +534,19 @@ namespace DoFRenumbering
                   const std::vector<unsigned int> &component_order_arg)
   {
 //TODO: Merge with previous function
-    std::vector<unsigned int> renumbering (dof_handler.n_dofs(),
-                                           hp::DoFHandler<dim>::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering (dof_handler.n_dofs(),
+                                                      hp::DoFHandler<dim>::invalid_dof_index);
 
     typename hp::DoFHandler<dim>::active_cell_iterator
     start = dof_handler.begin_active();
     const typename hp::DoFHandler<dim>::level_cell_iterator
     end = dof_handler.end();
 
-    const unsigned int result =
+    const types::global_dof_index result =
       compute_component_wise<hp::DoFHandler<dim>::dimension,hp::DoFHandler<dim>::space_dimension,
       typename hp::DoFHandler<dim>::active_cell_iterator,
       typename hp::DoFHandler<dim>::level_cell_iterator>
-      (renumbering, start, end, component_order_arg);
+      (renumbering, start, end, component_order_arg, false);
 
     if (result == 0) return;
 
@@ -549,19 +564,19 @@ namespace DoFRenumbering
                   const unsigned int level,
                   const std::vector<unsigned int> &component_order_arg)
   {
-    Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int,
+    Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcNotInitialized());
 
-    std::vector<unsigned int> renumbering (dof_handler.n_dofs(level),
-                                           DH::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering (dof_handler.n_dofs(level),
+                                                      DH::invalid_dof_index);
 
     typename DH::level_cell_iterator start =dof_handler.begin(level);
     typename DH::level_cell_iterator end = dof_handler.end(level);
 
-    const unsigned int result =
+    const types::global_dof_index result =
       compute_component_wise<DH::dimension, DH::space_dimension,
       typename DH::level_cell_iterator, typename DH::level_cell_iterator>
-      (renumbering, start, end, component_order_arg);
+      (renumbering, start, end, component_order_arg, true);
 
     if (result == 0) return;
 
@@ -575,11 +590,12 @@ namespace DoFRenumbering
 
 
   template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
-  unsigned int
-  compute_component_wise (std::vector<unsigned int> &new_indices,
+  types::global_dof_index
+  compute_component_wise (std::vector<types::global_dof_index> &new_indices,
                           const ITERATOR    &start,
                           const ENDITERATOR &end,
-                          const std::vector<unsigned int> &component_order_arg)
+                          const std::vector<unsigned int> &component_order_arg,
+                          bool is_level_operation)
   {
     const hp::FECollection<dim,spacedim>
     fe_collection (start->get_dof_handler().get_fe ());
@@ -612,7 +628,7 @@ namespace DoFRenumbering
 
     // vector to hold the dof indices on
     // the cell we visit at a time
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
 
     // prebuilt list to which component
     // a given dof on a cell
@@ -657,23 +673,37 @@ namespace DoFRenumbering
     // dof indices are entered
     // multiply, so we will have to
     // take care of that
-    std::vector<std::vector<unsigned int> >
+    std::vector<std::vector<types::global_dof_index> >
     component_to_dof_map (fe_collection.n_components());
     for (ITERATOR cell=start; cell!=end; ++cell)
-      if (cell->is_locally_owned())
-        {
-          // on each cell: get dof indices
-          // and insert them into the global
-          // list using their component
-          const unsigned int fe_index = cell->active_fe_index();
-          const unsigned int dofs_per_cell = fe_collection[fe_index].dofs_per_cell;
-          local_dof_indices.resize (dofs_per_cell);
-          cell->get_active_or_mg_dof_indices (local_dof_indices);
-          for (unsigned int i=0; i<dofs_per_cell; ++i)
-            if (start->get_dof_handler().locally_owned_dofs().is_element(local_dof_indices[i]))
-              component_to_dof_map[component_list[fe_index][i]].
-              push_back (local_dof_indices[i]);
-        }
+      {
+        if (is_level_operation)
+          {
+            //we are dealing with mg dofs, skip foreign level cells:
+            if ((start->get_dof_handler().get_tria().locally_owned_subdomain() != numbers::invalid_subdomain_id)
+                &&
+                (cell->level_subdomain_id()!=start->get_dof_handler().get_tria().locally_owned_subdomain()))
+              continue;
+          }
+        else
+          {
+            //we are dealing with active dofs, skip the loop if not locally
+            // owned:
+            if (!cell->active() || !cell->is_locally_owned())
+              continue;
+          }
+        // on each cell: get dof indices
+        // and insert them into the global
+        // list using their component
+        const unsigned int fe_index = cell->active_fe_index();
+        const unsigned int dofs_per_cell = fe_collection[fe_index].dofs_per_cell;
+        local_dof_indices.resize (dofs_per_cell);
+        cell->get_active_or_mg_dof_indices (local_dof_indices);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          if (start->get_dof_handler().locally_owned_dofs().is_element(local_dof_indices[i]))
+            component_to_dof_map[component_list[fe_index][i]].
+            push_back (local_dof_indices[i]);
+      }
 
     // now we've got all indices sorted
     // into buckets labeled by their
@@ -712,26 +742,29 @@ namespace DoFRenumbering
     // calculate the number of locally owned
     // DoFs per bucket
     const unsigned int n_buckets = fe_collection.n_components();
-    std::vector<unsigned int> shifts(n_buckets);
+    std::vector<types::global_dof_index> shifts(n_buckets);
 
     if (const parallel::distributed::Triangulation<dim,spacedim> *tria
         = (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
            (&start->get_dof_handler().get_tria())))
       {
 #ifdef DEAL_II_WITH_P4EST
-        std::vector<unsigned int> local_dof_count(n_buckets);
+        std::vector<types::global_dof_index> local_dof_count(n_buckets);
 
         for (unsigned int c=0; c<n_buckets; ++c)
           local_dof_count[c] = component_to_dof_map[c].size();
 
 
         // gather information from all CPUs
-        std::vector<unsigned int>
+        std::vector<types::global_dof_index>
         all_dof_counts(fe_collection.n_components() *
                        Utilities::MPI::n_mpi_processes (tria->get_communicator()));
 
-        MPI_Allgather ( &local_dof_count[0], n_buckets, MPI_UNSIGNED, &all_dof_counts[0],
-                        n_buckets, MPI_UNSIGNED, tria->get_communicator());
+        MPI_Allgather ( &local_dof_count[0],
+                        n_buckets, DEAL_II_DOF_INDEX_MPI_TYPE,
+                        &all_dof_counts[0],
+                        n_buckets, DEAL_II_DOF_INDEX_MPI_TYPE,
+                        tria->get_communicator());
 
         for (unsigned int i=0; i<n_buckets; ++i)
           Assert (all_dof_counts[n_buckets*tria->locally_owned_subdomain()+i]
@@ -767,16 +800,16 @@ namespace DoFRenumbering
     // now concatenate all the
     // components in the order the user
     // desired to see
-    unsigned int next_free_index = 0;
+    types::global_dof_index next_free_index = 0;
     for (unsigned int component=0; component<fe_collection.n_components(); ++component)
       {
-        const typename std::vector<unsigned int>::const_iterator
+        const typename std::vector<types::global_dof_index>::const_iterator
         begin_of_component = component_to_dof_map[component].begin(),
         end_of_component   = component_to_dof_map[component].end();
 
         next_free_index = shifts[component];
 
-        for (typename std::vector<unsigned int>::const_iterator
+        for (typename std::vector<types::global_dof_index>::const_iterator
              dof_index = begin_of_component;
              dof_index != end_of_component; ++dof_index)
           {
@@ -800,15 +833,15 @@ namespace DoFRenumbering
   void
   block_wise (DoFHandler<dim,spacedim> &dof_handler)
   {
-    std::vector<unsigned int> renumbering (dof_handler.n_locally_owned_dofs(),
-                                           DoFHandler<dim>::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering (dof_handler.n_locally_owned_dofs(),
+                                                      DoFHandler<dim>::invalid_dof_index);
 
     typename DoFHandler<dim,spacedim>::active_cell_iterator
     start = dof_handler.begin_active();
     const typename DoFHandler<dim,spacedim>::level_cell_iterator
     end = dof_handler.end();
 
-    const unsigned int result =
+    const types::global_dof_index result =
       compute_block_wise<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator,
       typename DoFHandler<dim,spacedim>::level_cell_iterator>
       (renumbering, start, end);
@@ -838,15 +871,15 @@ namespace DoFRenumbering
   void
   block_wise (hp::DoFHandler<dim> &dof_handler)
   {
-    std::vector<unsigned int> renumbering (dof_handler.n_dofs(),
-                                           hp::DoFHandler<dim>::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering (dof_handler.n_dofs(),
+                                                      hp::DoFHandler<dim>::invalid_dof_index);
 
     typename hp::DoFHandler<dim>::active_cell_iterator
     start = dof_handler.begin_active();
     const typename hp::DoFHandler<dim>::level_cell_iterator
     end = dof_handler.end();
 
-    const unsigned int result =
+    const types::global_dof_index result =
       compute_block_wise<dim, dim, typename hp::DoFHandler<dim>::active_cell_iterator,
       typename hp::DoFHandler<dim>::level_cell_iterator>(renumbering,
                                                          start, end);
@@ -866,18 +899,18 @@ namespace DoFRenumbering
   void
   block_wise (DoFHandler<dim> &dof_handler, const unsigned int level)
   {
-    Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int,
+    Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcNotInitialized());
 
-    std::vector<unsigned int> renumbering (dof_handler.n_dofs(level),
-                                           DoFHandler<dim>::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering (dof_handler.n_dofs(level),
+                                                      DoFHandler<dim>::invalid_dof_index);
 
     typename DoFHandler<dim>::level_cell_iterator
     start =dof_handler.begin(level);
     typename DoFHandler<dim>::level_cell_iterator
     end = dof_handler.end(level);
 
-    const unsigned int result =
+    const types::global_dof_index result =
       compute_block_wise<dim, dim, typename DoFHandler<dim>::level_cell_iterator,
       typename DoFHandler<dim>::level_cell_iterator>(
         renumbering, start, end);
@@ -919,8 +952,8 @@ namespace DoFRenumbering
 
 
   template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
-  unsigned int
-  compute_block_wise (std::vector<unsigned int> &new_indices,
+  types::global_dof_index
+  compute_block_wise (std::vector<types::global_dof_index> &new_indices,
                       const ITERATOR    &start,
                       const ENDITERATOR &end)
   {
@@ -937,12 +970,12 @@ namespace DoFRenumbering
 
     // vector to hold the dof indices on
     // the cell we visit at a time
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
 
     // prebuilt list to which block
     // a given dof on a cell
     // should go.
-    std::vector<std::vector<unsigned int> > block_list (fe_collection.size());
+    std::vector<std::vector<types::global_dof_index> > block_list (fe_collection.size());
     for (unsigned int f=0; f<fe_collection.size(); ++f)
       {
         const FiniteElement<dim,spacedim> &fe = fe_collection[f];
@@ -963,7 +996,7 @@ namespace DoFRenumbering
     // dof indices are entered
     // multiply, so we will have to
     // take care of that
-    std::vector<std::vector<unsigned int> >
+    std::vector<std::vector<types::global_dof_index> >
     block_to_dof_map (fe_collection.n_blocks());
     for (ITERATOR cell=start; cell!=end; ++cell)
       if (cell->is_locally_owned())
@@ -1007,26 +1040,31 @@ namespace DoFRenumbering
     // calculate the number of locally owned
     // DoFs per bucket
     const unsigned int n_buckets = fe_collection.n_blocks();
-    std::vector<unsigned int> shifts(n_buckets);
+    std::vector<types::global_dof_index> shifts(n_buckets);
 
     if (const parallel::distributed::Triangulation<dim,spacedim> *tria
         = (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
            (&start->get_dof_handler().get_tria())))
       {
 #ifdef DEAL_II_WITH_P4EST
-        std::vector<unsigned int> local_dof_count(n_buckets);
+        std::vector<types::global_dof_index> local_dof_count(n_buckets);
 
         for (unsigned int c=0; c<n_buckets; ++c)
           local_dof_count[c] = block_to_dof_map[c].size();
 
 
         // gather information from all CPUs
-        std::vector<unsigned int>
+        std::vector<types::global_dof_index>
         all_dof_counts(fe_collection.n_components() *
                        Utilities::MPI::n_mpi_processes (tria->get_communicator()));
 
-        MPI_Allgather ( &local_dof_count[0], n_buckets, MPI_UNSIGNED, &all_dof_counts[0],
-                        n_buckets, MPI_UNSIGNED, tria->get_communicator());
+        Assert (sizeof(types::global_dof_index) == sizeof(unsigned int),
+                ExcNotImplemented());
+        MPI_Allgather ( &local_dof_count[0],
+                        n_buckets, DEAL_II_DOF_INDEX_MPI_TYPE,
+                        &all_dof_counts[0],
+                        n_buckets, DEAL_II_DOF_INDEX_MPI_TYPE,
+                        tria->get_communicator());
 
         for (unsigned int i=0; i<n_buckets; ++i)
           Assert (all_dof_counts[n_buckets*tria->locally_owned_subdomain()+i]
@@ -1062,16 +1100,16 @@ namespace DoFRenumbering
     // now concatenate all the
     // components in the order the user
     // desired to see
-    unsigned int next_free_index = 0;
+    types::global_dof_index next_free_index = 0;
     for (unsigned int block=0; block<fe_collection.n_blocks(); ++block)
       {
-        const typename std::vector<unsigned int>::const_iterator
+        const typename std::vector<types::global_dof_index>::const_iterator
         begin_of_component = block_to_dof_map[block].begin(),
         end_of_component   = block_to_dof_map[block].end();
 
         next_free_index = shifts[block];
 
-        for (typename std::vector<unsigned int>::const_iterator
+        for (typename std::vector<types::global_dof_index>::const_iterator
              dof_index = begin_of_component;
              dof_index != end_of_component; ++dof_index)
           {
@@ -1097,10 +1135,10 @@ namespace DoFRenumbering
 
 // Note that this function only works for active dofs.
     template <int dim, class iterator>
-    unsigned int
+    types::global_dof_index
     compute_hierarchical_recursive (
-      unsigned int next_free,
-      std::vector<unsigned int> &new_indices,
+      types::global_dof_index next_free,
+      std::vector<types::global_dof_index> &new_indices,
       const iterator &cell,
       const IndexSet &locally_owned)
     {
@@ -1119,7 +1157,7 @@ namespace DoFRenumbering
           if (cell->is_locally_owned())
             {
               const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
-              std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+              std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
               cell->get_dof_indices (local_dof_indices);
 
               for (unsigned int i = 0; i < dofs_per_cell; ++i)
@@ -1147,12 +1185,12 @@ namespace DoFRenumbering
   void
   hierarchical (DoFHandler<dim> &dof_handler)
   {
-    std::vector<unsigned int> renumbering (dof_handler.n_locally_owned_dofs(),
-                                           DoFHandler<dim>::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering (dof_handler.n_locally_owned_dofs(),
+                                                      DoFHandler<dim>::invalid_dof_index);
 
     typename DoFHandler<dim>::level_cell_iterator cell;
 
-    unsigned int next_free = 0;
+    types::global_dof_index next_free = 0;
     const IndexSet locally_owned = dof_handler.locally_owned_dofs();
 
     const parallel::distributed::Triangulation<dim> *tria
@@ -1208,7 +1246,7 @@ namespace DoFRenumbering
 
     // make sure that all local DoFs got new numbers assigned
     Assert (std::find (renumbering.begin(), renumbering.end(),
-                       numbers::invalid_unsigned_int)
+                       numbers::invalid_dof_index)
             == renumbering.end(),
             ExcInternalError());
 
@@ -1222,8 +1260,8 @@ namespace DoFRenumbering
   sort_selected_dofs_back (DH                      &dof_handler,
                            const std::vector<bool> &selected_dofs)
   {
-    std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
-                                          DH::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
+                                                     DH::invalid_dof_index);
     compute_sort_selected_dofs_back(renumbering, dof_handler, selected_dofs);
 
     dof_handler.renumber_dofs(renumbering);
@@ -1237,11 +1275,11 @@ namespace DoFRenumbering
                            const std::vector<bool> &selected_dofs,
                            const unsigned int       level)
   {
-    Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int,
+    Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcNotInitialized());
 
-    std::vector<unsigned int> renumbering(dof_handler.n_dofs(level),
-                                          DH::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(level),
+                                                     DH::invalid_dof_index);
     compute_sort_selected_dofs_back(renumbering, dof_handler, selected_dofs, level);
 
     dof_handler.renumber_dofs(level, renumbering);
@@ -1251,11 +1289,11 @@ namespace DoFRenumbering
 
   template <class DH>
   void
-  compute_sort_selected_dofs_back (std::vector<unsigned int> &new_indices,
+  compute_sort_selected_dofs_back (std::vector<types::global_dof_index> &new_indices,
                                    const DH                  &dof_handler,
                                    const std::vector<bool>   &selected_dofs)
   {
-    const unsigned int n_dofs = dof_handler.n_dofs();
+    const types::global_dof_index n_dofs = dof_handler.n_dofs();
     Assert (selected_dofs.size() == n_dofs,
             ExcDimensionMismatch (selected_dofs.size(), n_dofs));
 
@@ -1264,13 +1302,13 @@ namespace DoFRenumbering
     Assert (new_indices.size() == n_dofs,
             ExcDimensionMismatch(new_indices.size(), n_dofs));
 
-    const unsigned int   n_selected_dofs = std::count (selected_dofs.begin(),
-                                                       selected_dofs.end(),
-                                                       false);
+    const types::global_dof_index   n_selected_dofs = std::count (selected_dofs.begin(),
+                                                      selected_dofs.end(),
+                                                      false);
 
-    unsigned int next_unselected = 0;
-    unsigned int next_selected   = n_selected_dofs;
-    for (unsigned int i=0; i<n_dofs; ++i)
+    types::global_dof_index next_unselected = 0;
+    types::global_dof_index next_selected   = n_selected_dofs;
+    for (types::global_dof_index i=0; i<n_dofs; ++i)
       if (selected_dofs[i] == false)
         {
           new_indices[i] = next_unselected;
@@ -1289,12 +1327,12 @@ namespace DoFRenumbering
 
   template <class DH>
   void
-  compute_sort_selected_dofs_back (std::vector<unsigned int> &new_indices,
+  compute_sort_selected_dofs_back (std::vector<types::global_dof_index> &new_indices,
                                    const DH                  &dof_handler,
                                    const std::vector<bool>   &selected_dofs,
                                    const unsigned int         level)
   {
-    Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int,
+    Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcNotInitialized());
 
     const unsigned int n_dofs = dof_handler.n_dofs(level);
@@ -1333,8 +1371,8 @@ namespace DoFRenumbering
   void
   cell_wise (DH &dof, const std::vector<typename DH::active_cell_iterator> &cells)
   {
-    std::vector<unsigned int> renumbering(dof.n_dofs());
-    std::vector<unsigned int> reverse(dof.n_dofs());
+    std::vector<types::global_dof_index> renumbering(dof.n_dofs());
+    std::vector<types::global_dof_index> reverse(dof.n_dofs());
     compute_cell_wise(renumbering, reverse, dof, cells);
 
     dof.renumber_dofs(renumbering);
@@ -1344,8 +1382,8 @@ namespace DoFRenumbering
   template <class DH>
   void
   compute_cell_wise (
-    std::vector<unsigned int> &new_indices,
-    std::vector<unsigned int> &reverse,
+    std::vector<types::global_dof_index> &new_indices,
+    std::vector<types::global_dof_index> &reverse,
     const DH &dof,
     const typename std::vector<typename DH::active_cell_iterator> &cells)
   {
@@ -1353,7 +1391,7 @@ namespace DoFRenumbering
            ExcDimensionMismatch(cells.size(),
                                 dof.get_tria().n_active_cells()));
 
-    unsigned int n_global_dofs = dof.n_dofs();
+    types::global_dof_index n_global_dofs = dof.n_dofs();
 
     // Actually, we compute the
     // inverse of the reordering
@@ -1371,7 +1409,7 @@ namespace DoFRenumbering
     // make sure, that each dof is
     // reordered only once.
     std::vector<bool> already_sorted(n_global_dofs, false);
-    std::vector<unsigned int> cell_dofs;
+    std::vector<types::global_dof_index> cell_dofs;
 
     unsigned int global_index = 0;
 
@@ -1405,7 +1443,7 @@ namespace DoFRenumbering
       }
     Assert(global_index == n_global_dofs, ExcRenumberingIncomplete());
 
-    for (unsigned int i=0; i<reverse.size(); ++i)
+    for (types::global_dof_index i=0; i<reverse.size(); ++i)
       new_indices[reverse[i]] = i;
   }
 
@@ -1417,11 +1455,11 @@ namespace DoFRenumbering
     const unsigned int level,
     const typename std::vector<typename DH::level_cell_iterator> &cells)
   {
-    Assert(dof.n_dofs(level) != numbers::invalid_unsigned_int,
+    Assert(dof.n_dofs(level) != numbers::invalid_dof_index,
            ExcNotInitialized());
 
-    std::vector<unsigned int> renumbering(dof.n_dofs(level));
-    std::vector<unsigned int> reverse(dof.n_dofs(level));
+    std::vector<types::global_dof_index> renumbering(dof.n_dofs(level));
+    std::vector<types::global_dof_index> reverse(dof.n_dofs(level));
 
     compute_cell_wise(renumbering, reverse, dof, level, cells);
     dof.renumber_dofs(level, renumbering);
@@ -1431,8 +1469,8 @@ namespace DoFRenumbering
 
   template <class DH>
   void compute_cell_wise (
-    std::vector<unsigned int> &new_order,
-    std::vector<unsigned int> &reverse,
+    std::vector<types::global_dof_index> &new_order,
+    std::vector<types::global_dof_index> &reverse,
     const DH &dof,
     const unsigned int level,
     const typename std::vector<typename DH::level_cell_iterator> &cells)
@@ -1449,7 +1487,7 @@ namespace DoFRenumbering
     unsigned int n_cell_dofs = dof.get_fe().n_dofs_per_cell();
 
     std::vector<bool> already_sorted(n_global_dofs, false);
-    std::vector<unsigned int> cell_dofs(n_cell_dofs);
+    std::vector<types::global_dof_index> cell_dofs(n_cell_dofs);
 
     unsigned int global_index = 0;
 
@@ -1473,7 +1511,7 @@ namespace DoFRenumbering
       }
     Assert(global_index == n_global_dofs, ExcRenumberingIncomplete());
 
-    for (unsigned int i=0; i<new_order.size(); ++i)
+    for (types::global_dof_index i=0; i<new_order.size(); ++i)
       new_order[reverse[i]] = i;
   }
 
@@ -1485,8 +1523,8 @@ namespace DoFRenumbering
               const Point<DH::space_dimension> &direction,
               const bool dof_wise_renumbering)
   {
-    std::vector<unsigned int> renumbering(dof.n_dofs());
-    std::vector<unsigned int> reverse(dof.n_dofs());
+    std::vector<types::global_dof_index> renumbering(dof.n_dofs());
+    std::vector<types::global_dof_index> reverse(dof.n_dofs());
     compute_downstream(renumbering, reverse, dof, direction,
                        dof_wise_renumbering);
 
@@ -1508,22 +1546,26 @@ namespace DoFRenumbering
   template <class DH>
   void
   compute_downstream (
-    std::vector<unsigned int> &new_indices,
-    std::vector<unsigned int> &reverse,
+    std::vector<types::global_dof_index> &new_indices,
+    std::vector<types::global_dof_index> &reverse,
     const DH &dof,
     const Point<DH::space_dimension> &direction,
     const bool dof_wise_renumbering)
   {
     if (dof_wise_renumbering == false)
       {
-        std::vector<typename DH::active_cell_iterator>
-        ordered_cells(dof.get_tria().n_active_cells());
+        std::vector<typename DH::active_cell_iterator> ordered_cells;
+        ordered_cells.reserve(dof.get_tria().n_active_cells());
         const CompareDownstream<typename DH::active_cell_iterator, DH::space_dimension> comparator(direction);
 
-        typename DH::active_cell_iterator begin = dof.begin_active();
+        typename DH::active_cell_iterator p = dof.begin_active();
         typename DH::active_cell_iterator end = dof.end();
 
-        copy (begin, end, ordered_cells.begin());
+        while (p!=end)
+          {
+            ordered_cells.push_back(p);
+            ++p;
+          }
         std::sort (ordered_cells.begin(), ordered_cells.end(), comparator);
 
         compute_cell_wise(new_indices, reverse, dof, ordered_cells);
@@ -1558,7 +1600,7 @@ namespace DoFRenumbering
 
         std::vector<bool> already_touched (n_dofs, false);
 
-        std::vector<unsigned int> local_dof_indices;
+        std::vector<types::global_dof_index> local_dof_indices;
         typename DH::active_cell_iterator begin = dof.begin_active();
         typename DH::active_cell_iterator end = dof.end();
         for ( ; begin != end; ++begin)
@@ -1584,7 +1626,7 @@ namespace DoFRenumbering
         ComparePointwiseDownstream<DH::space_dimension> comparator (direction);
         std::sort (support_point_list.begin(), support_point_list.end(),
                    comparator);
-        for (unsigned int i=0; i<n_dofs; ++i)
+        for (types::global_dof_index i=0; i<n_dofs; ++i)
           new_indices[support_point_list[i].second] = i;
       }
   }
@@ -1597,8 +1639,8 @@ namespace DoFRenumbering
                    const Point<DH::space_dimension>  &direction,
                    const bool         dof_wise_renumbering)
   {
-    std::vector<unsigned int> renumbering(dof.n_dofs(level));
-    std::vector<unsigned int> reverse(dof.n_dofs(level));
+    std::vector<types::global_dof_index> renumbering(dof.n_dofs(level));
+    std::vector<types::global_dof_index> reverse(dof.n_dofs(level));
     compute_downstream(renumbering, reverse, dof, level, direction,
                        dof_wise_renumbering);
 
@@ -1610,8 +1652,8 @@ namespace DoFRenumbering
   template <class DH>
   void
   compute_downstream (
-    std::vector<unsigned int> &new_indices,
-    std::vector<unsigned int> &reverse,
+    std::vector<types::global_dof_index> &new_indices,
+    std::vector<types::global_dof_index> &reverse,
     const DH &dof,
     const unsigned int level,
     const Point<DH::space_dimension> &direction,
@@ -1619,14 +1661,18 @@ namespace DoFRenumbering
   {
     if (dof_wise_renumbering == false)
       {
-        std::vector<typename DH::level_cell_iterator>
-        ordered_cells(dof.get_tria().n_cells(level));
+        std::vector<typename DH::level_cell_iterator> ordered_cells;
+        ordered_cells.reserve (dof.get_tria().n_cells(level));
         const CompareDownstream<typename DH::level_cell_iterator, DH::space_dimension> comparator(direction);
 
-        typename DH::level_cell_iterator begin = dof.begin(level);
+        typename DH::level_cell_iterator p = dof.begin(level);
         typename DH::level_cell_iterator end = dof.end(level);
 
-        std::copy (begin, end, ordered_cells.begin());
+        while (p!=end)
+          {
+            ordered_cells.push_back(p);
+            ++p;
+          }
         std::sort (ordered_cells.begin(), ordered_cells.end(), comparator);
 
         compute_cell_wise(new_indices, reverse, dof, level, ordered_cells);
@@ -1646,7 +1692,7 @@ namespace DoFRenumbering
         std::vector<bool> already_touched (dof.n_dofs(), false);
 
         const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
-        std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+        std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
         typename DH::level_cell_iterator begin = dof.begin(level);
         typename DH::level_cell_iterator end = dof.end(level);
         for ( ; begin != end; ++begin)
@@ -1669,7 +1715,7 @@ namespace DoFRenumbering
         ComparePointwiseDownstream<DH::space_dimension> comparator (direction);
         std::sort (support_point_list.begin(), support_point_list.end(),
                    comparator);
-        for (unsigned int i=0; i<n_dofs; ++i)
+        for (types::global_dof_index i=0; i<n_dofs; ++i)
           new_indices[support_point_list[i].second] = i;
       }
   }
@@ -1756,7 +1802,7 @@ namespace DoFRenumbering
     const Point<DH::space_dimension> &center,
     const bool counter)
   {
-    std::vector<unsigned int> renumbering(dof.n_dofs());
+    std::vector<types::global_dof_index> renumbering(dof.n_dofs());
     compute_clockwise_dg(renumbering, dof, center, counter);
 
     dof.renumber_dofs(renumbering);
@@ -1767,22 +1813,26 @@ namespace DoFRenumbering
   template <class DH>
   void
   compute_clockwise_dg (
-    std::vector<unsigned int> &new_indices,
+    std::vector<types::global_dof_index> &new_indices,
     const DH &dof,
     const Point<DH::space_dimension> &center,
     const bool counter)
   {
-    std::vector<typename DH::active_cell_iterator>
-    ordered_cells(dof.get_tria().n_active_cells());
+    std::vector<typename DH::active_cell_iterator> ordered_cells;
+    ordered_cells.reserve (dof.get_tria().n_active_cells());
     internal::ClockCells<DH::space_dimension> comparator(center, counter);
 
-    typename DH::active_cell_iterator begin = dof.begin_active();
+    typename DH::active_cell_iterator p = dof.begin_active();
     typename DH::active_cell_iterator end = dof.end();
 
-    std::copy (begin, end, ordered_cells.begin());
+    while (p!=end)
+      {
+        ordered_cells.push_back(p);
+        ++p;
+      }
     std::sort (ordered_cells.begin(), ordered_cells.end(), comparator);
 
-    std::vector<unsigned int> reverse(new_indices.size());
+    std::vector<types::global_dof_index> reverse(new_indices.size());
     compute_cell_wise(new_indices, reverse, dof, ordered_cells);
   }
 
@@ -1794,14 +1844,18 @@ namespace DoFRenumbering
                      const Point<DH::space_dimension> &center,
                      const bool counter)
   {
-    std::vector<typename DH::level_cell_iterator>
-    ordered_cells(dof.get_tria().n_cells(level));
+    std::vector<typename DH::level_cell_iterator> ordered_cells;
+    ordered_cells.reserve(dof.get_tria().n_active_cells());
     internal::ClockCells<DH::space_dimension> comparator(center, counter);
 
-    typename DH::level_cell_iterator begin = dof.begin(level);
+    typename DH::level_cell_iterator p = dof.begin(level);
     typename DH::level_cell_iterator end = dof.end(level);
 
-    std::copy (begin, end, ordered_cells.begin());
+    while (p!=end)
+      {
+        ordered_cells.push_back(p);
+        ++p;
+      }
     std::sort (ordered_cells.begin(), ordered_cells.end(), comparator);
 
     cell_wise(dof, level, ordered_cells);
@@ -1813,8 +1867,8 @@ namespace DoFRenumbering
   void
   random (DH &dof_handler)
   {
-    std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
-                                          DH::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
+                                                     DH::invalid_dof_index);
     compute_random(renumbering, dof_handler);
 
     dof_handler.renumber_dofs(renumbering);
@@ -1825,10 +1879,10 @@ namespace DoFRenumbering
   template <class DH>
   void
   compute_random (
-    std::vector<unsigned int> &new_indices,
+    std::vector<types::global_dof_index> &new_indices,
     const DH                  &dof_handler)
   {
-    const unsigned int n_dofs = dof_handler.n_dofs();
+    const types::global_dof_index n_dofs = dof_handler.n_dofs();
     Assert(new_indices.size() == n_dofs,
            ExcDimensionMismatch(new_indices.size(), n_dofs));
 
@@ -1844,8 +1898,8 @@ namespace DoFRenumbering
   void
   subdomain_wise (DH &dof_handler)
   {
-    std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
-                                          DH::invalid_dof_index);
+    std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
+                                                     DH::invalid_dof_index);
     compute_subdomain_wise(renumbering, dof_handler);
 
     dof_handler.renumber_dofs(renumbering);
@@ -1855,10 +1909,10 @@ namespace DoFRenumbering
 
   template <class DH>
   void
-  compute_subdomain_wise (std::vector<unsigned int> &new_dof_indices,
+  compute_subdomain_wise (std::vector<types::global_dof_index> &new_dof_indices,
                           const DH                  &dof_handler)
   {
-    const unsigned int n_dofs = dof_handler.n_dofs();
+    const types::global_dof_index n_dofs = dof_handler.n_dofs();
     Assert (new_dof_indices.size() == n_dofs,
             ExcDimensionMismatch (new_dof_indices.size(), n_dofs));
 
@@ -1880,13 +1934,13 @@ namespace DoFRenumbering
     // same subdomain, then they will be in
     // this order also after reordering
     std::fill (new_dof_indices.begin(), new_dof_indices.end(),
-               numbers::invalid_unsigned_int);
-    unsigned int next_free_index = 0;
+               numbers::invalid_dof_index);
+    types::global_dof_index next_free_index = 0;
     for (types::subdomain_id subdomain=0; subdomain<n_subdomains; ++subdomain)
-      for (unsigned int i=0; i<n_dofs; ++i)
+      for (types::global_dof_index i=0; i<n_dofs; ++i)
         if (subdomain_association[i] == subdomain)
           {
-            Assert (new_dof_indices[i] == numbers::invalid_unsigned_int,
+            Assert (new_dof_indices[i] == numbers::invalid_dof_index,
                     ExcInternalError());
             new_dof_indices[i] = next_free_index;
             ++next_free_index;
@@ -1895,7 +1949,7 @@ namespace DoFRenumbering
     // we should have numbered all dofs
     Assert (next_free_index == n_dofs, ExcInternalError());
     Assert (std::find (new_dof_indices.begin(), new_dof_indices.end(),
-                       numbers::invalid_unsigned_int)
+                       numbers::invalid_dof_index)
             == new_dof_indices.end(),
             ExcInternalError());
   }
index fcfc82d8433409f9616af5637bbfeca94f2c3f52..c8c111555857486dad4ba7db8e6733dfa33f4a5f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
@@ -28,16 +32,16 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
          (DoFHandler<deal_II_dimension,deal_II_space_dimension>&,
           const bool,
           const bool,
-          const std::vector<unsigned int>&);
+          const std::vector<types::global_dof_index>&);
 
        template
          void
          compute_Cuthill_McKee<DoFHandler<deal_II_dimension,deal_II_space_dimension> >
-         (std::vector<unsigned int>&,
+         (std::vector<types::global_dof_index>&,
           const DoFHandler<deal_II_dimension,deal_II_space_dimension>&,
           const bool,
           const bool,
-          const std::vector<unsigned int>&);
+          const std::vector<types::global_dof_index>&);
 
        template
          void component_wise<deal_II_dimension,deal_II_space_dimension>
@@ -72,7 +76,7 @@ namespace DoFRenumbering
 
     template
     void
-    compute_Cuthill_McKee (std::vector<unsigned int> &,
+    compute_Cuthill_McKee (std::vector<dealii::types::global_dof_index> &,
                           const DoFHandler<deal_II_dimension> &, bool, bool);
 
     template
@@ -81,7 +85,7 @@ namespace DoFRenumbering
 
     template
     void
-    compute_king_ordering (std::vector<unsigned int> &,
+    compute_king_ordering (std::vector<dealii::types::global_dof_index> &,
                           const DoFHandler<deal_II_dimension> &, bool, bool);
 
     template
@@ -90,7 +94,7 @@ namespace DoFRenumbering
 
     template
     void
-    compute_minimum_degree (std::vector<unsigned int> &,
+    compute_minimum_degree (std::vector<dealii::types::global_dof_index> &,
                            const DoFHandler<deal_II_dimension> &, bool, bool);
 
 
@@ -100,7 +104,7 @@ namespace DoFRenumbering
 
     template
     void
-    compute_Cuthill_McKee (std::vector<unsigned int> &,
+    compute_Cuthill_McKee (std::vector<dealii::types::global_dof_index> &,
                           const hp::DoFHandler<deal_II_dimension> &, bool, bool);
 
     template
@@ -109,7 +113,7 @@ namespace DoFRenumbering
 
     template
     void
-    compute_king_ordering (std::vector<unsigned int> &,
+    compute_king_ordering (std::vector<dealii::types::global_dof_index> &,
                           const hp::DoFHandler<deal_II_dimension> &, bool, bool);
 
     template
@@ -118,7 +122,7 @@ namespace DoFRenumbering
 
     template
     void
-    compute_minimum_degree (std::vector<unsigned int> &,
+    compute_minimum_degree (std::vector<dealii::types::global_dof_index> &,
                            const hp::DoFHandler<deal_II_dimension> &, bool, bool);
     \}
     
@@ -130,16 +134,16 @@ namespace DoFRenumbering
       (hp::DoFHandler<deal_II_dimension>&,
        const bool,
        const bool,
-       const std::vector<unsigned int>&);
+       const std::vector<types::global_dof_index>&);
 
     template
       void
       compute_Cuthill_McKee<hp::DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,
        const hp::DoFHandler<deal_II_dimension>&,
        const bool,
        const bool,
-       const std::vector<unsigned int>&);
+       const std::vector<types::global_dof_index>&);
 
     template
       void component_wise
@@ -183,7 +187,7 @@ namespace DoFRenumbering
 
     template void
       compute_cell_wise<DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&, std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&, std::vector<types::global_dof_index>&,
        const DoFHandler<deal_II_dimension>&,
        const std::vector<DoFHandler<deal_II_dimension>::active_cell_iterator>&);
 
@@ -194,7 +198,7 @@ namespace DoFRenumbering
 
     template void
       compute_cell_wise<DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&, std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&, std::vector<types::global_dof_index>&,
        const DoFHandler<deal_II_dimension>&, unsigned int,
        const std::vector<DoFHandler<deal_II_dimension>::level_cell_iterator>&);
 
@@ -205,7 +209,7 @@ namespace DoFRenumbering
 
     template void
       compute_downstream<DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,std::vector<types::global_dof_index>&,
        const DoFHandler<deal_II_dimension>&, const Point<deal_II_dimension>&,
        const bool);
 
@@ -217,7 +221,7 @@ namespace DoFRenumbering
     template
       void
       compute_clockwise_dg<DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&, const DoFHandler<deal_II_dimension>&,
+      (std::vector<types::global_dof_index>&, const DoFHandler<deal_II_dimension>&,
        const Point<deal_II_dimension>&, const bool);
 
 // Renumbering for hp::DoFHandler
@@ -229,7 +233,7 @@ namespace DoFRenumbering
 
     template void
       compute_cell_wise<hp::DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&, std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&, std::vector<types::global_dof_index>&,
        const hp::DoFHandler<deal_II_dimension>&,
        const std::vector<hp::DoFHandler<deal_II_dimension>::active_cell_iterator>&);
 
@@ -254,7 +258,7 @@ namespace DoFRenumbering
 
     template void
       compute_downstream<hp::DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,std::vector<types::global_dof_index>&,
        const hp::DoFHandler<deal_II_dimension>&,
        const Point<deal_II_dimension>&,
        const bool);
@@ -268,7 +272,7 @@ namespace DoFRenumbering
     template
       void
       compute_clockwise_dg<hp::DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,
        const hp::DoFHandler<deal_II_dimension>&,
        const Point<deal_II_dimension>&,
        const bool);
@@ -296,7 +300,7 @@ namespace DoFRenumbering
     template
       void
       compute_random<DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,
        const DoFHandler<deal_II_dimension> &);
 
     template
@@ -313,14 +317,14 @@ namespace DoFRenumbering
     template
       void
       compute_sort_selected_dofs_back<DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,
        const DoFHandler<deal_II_dimension> &,
        const std::vector<bool> &);
 
     template
       void
       compute_sort_selected_dofs_back<MGDoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,
        const MGDoFHandler<deal_II_dimension> &,
        const std::vector<bool> &,
        const unsigned int);
@@ -332,7 +336,7 @@ namespace DoFRenumbering
     template
       void
       compute_random<hp::DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,
        const hp::DoFHandler<deal_II_dimension> &);
 
     template
@@ -343,7 +347,7 @@ namespace DoFRenumbering
     template
       void
       compute_sort_selected_dofs_back<hp::DoFHandler<deal_II_dimension> >
-      (std::vector<unsigned int>&,
+      (std::vector<types::global_dof_index>&,
        const hp::DoFHandler<deal_II_dimension> &,
        const std::vector<bool> &);
 
@@ -357,14 +361,14 @@ namespace DoFRenumbering
       (DoFHandler<deal_II_dimension>&,
        const unsigned int,
        const bool,
-       const std::vector<unsigned int>&);
+       const std::vector<types::global_dof_index>&);
 
     template
       void Cuthill_McKee<MGDoFHandler<deal_II_dimension> >
       (MGDoFHandler<deal_II_dimension>&,
        const unsigned int,
        const bool,
-       const std::vector<unsigned int>&);
+       const std::vector<types::global_dof_index>&);
 
     \}  // namespace DoFRenumbering
 #endif
index 4772293030c1039569148d9267766da495cc5220..10bf20eae2c76186d5702adcdec4d883719c0375 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/multithread_info.h>
 #include <deal.II/base/thread_management.h>
@@ -61,7 +63,7 @@ namespace DoFTools
                          const bool              keep_constrained_dofs,
                          const types::subdomain_id subdomain_id)
   {
-    const unsigned int n_dofs = dof.n_dofs();
+    const types::global_dof_index n_dofs = dof.n_dofs();
 
     Assert (sparsity.n_rows() == n_dofs,
             ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
@@ -81,7 +83,7 @@ namespace DoFTools
                   "associated DoF handler objects, asking for any subdomain other "
                   "than the locally owned one does not make sense."));
 
-    std::vector<unsigned int> dofs_on_this_cell;
+    std::vector<types::global_dof_index> dofs_on_this_cell;
     dofs_on_this_cell.reserve (max_dofs_per_cell(dof));
     typename DH::active_cell_iterator cell = dof.begin_active(),
                                       endc = dof.end();
@@ -120,7 +122,7 @@ namespace DoFTools
                          const bool               keep_constrained_dofs,
                          const types::subdomain_id subdomain_id)
   {
-    const unsigned int n_dofs = dof.n_dofs();
+    const types::global_dof_index n_dofs = dof.n_dofs();
 
     Assert (sparsity.n_rows() == n_dofs,
             ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
@@ -192,7 +194,7 @@ namespace DoFTools
         }
 
 
-    std::vector<unsigned int> dofs_on_this_cell(fe_collection.max_dofs_per_cell());
+    std::vector<types::global_dof_index> dofs_on_this_cell(fe_collection.max_dofs_per_cell());
     typename DH::active_cell_iterator cell = dof.begin_active(),
                                       endc = dof.end();
 
@@ -232,8 +234,8 @@ namespace DoFTools
     const DH        &dof_col,
     SparsityPattern &sparsity)
   {
-    const unsigned int n_dofs_row = dof_row.n_dofs();
-    const unsigned int n_dofs_col = dof_col.n_dofs();
+    const types::global_dof_index n_dofs_row = dof_row.n_dofs();
+    const types::global_dof_index n_dofs_col = dof_col.n_dofs();
 
     Assert (sparsity.n_rows() == n_dofs_row,
             ExcDimensionMismatch (sparsity.n_rows(), n_dofs_row));
@@ -263,9 +265,9 @@ namespace DoFTools
               cell_row->get_fe().dofs_per_cell;
             const unsigned int dofs_per_cell_col =
               cell_col->get_fe().dofs_per_cell;
-            std::vector<unsigned int>
+            std::vector<types::global_dof_index>
             local_dof_indices_row(dofs_per_cell_row);
-            std::vector<unsigned int>
+            std::vector<types::global_dof_index>
             local_dof_indices_col(dofs_per_cell_col);
             cell_row->get_dof_indices (local_dof_indices_row);
             cell_col->get_dof_indices (local_dof_indices_col);
@@ -286,9 +288,9 @@ namespace DoFTools
                   cell_row_child->get_fe().dofs_per_cell;
                 const unsigned int dofs_per_cell_col =
                   cell_col->get_fe().dofs_per_cell;
-                std::vector<unsigned int>
+                std::vector<types::global_dof_index>
                 local_dof_indices_row(dofs_per_cell_row);
-                std::vector<unsigned int>
+                std::vector<types::global_dof_index>
                 local_dof_indices_col(dofs_per_cell_col);
                 cell_row_child->get_dof_indices (local_dof_indices_row);
                 cell_col->get_dof_indices (local_dof_indices_col);
@@ -310,9 +312,9 @@ namespace DoFTools
                   cell_row->get_fe().dofs_per_cell;
                 const unsigned int dofs_per_cell_col =
                   cell_col_child->get_fe().dofs_per_cell;
-                std::vector<unsigned int>
+                std::vector<types::global_dof_index>
                 local_dof_indices_row(dofs_per_cell_row);
-                std::vector<unsigned int>
+                std::vector<types::global_dof_index>
                 local_dof_indices_col(dofs_per_cell_col);
                 cell_row->get_dof_indices (local_dof_indices_row);
                 cell_col_child->get_dof_indices (local_dof_indices_col);
@@ -331,7 +333,7 @@ namespace DoFTools
   void
   make_boundary_sparsity_pattern (
     const DH                        &dof,
-    const std::vector<unsigned int> &dof_to_boundary_mapping,
+    const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
     SparsityPattern                 &sparsity)
   {
     if (DH::dimension == 1)
@@ -348,7 +350,7 @@ namespace DoFTools
         return;
       }
 
-    const unsigned int n_dofs = dof.n_dofs();
+    const types::global_dof_index n_dofs = dof.n_dofs();
 
     AssertDimension (dof_to_boundary_mapping.size(), n_dofs);
     AssertDimension (sparsity.n_rows(), dof.n_boundary_dofs());
@@ -356,8 +358,8 @@ namespace DoFTools
 #ifdef DEBUG
     if (sparsity.n_rows() != 0)
       {
-        unsigned int max_element = 0;
-        for (std::vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
+        types::global_dof_index max_element = 0;
+        for (std::vector<types::global_dof_index>::const_iterator i=dof_to_boundary_mapping.begin();
              i!=dof_to_boundary_mapping.end(); ++i)
           if ((*i != DH::invalid_dof_index) &&
               (*i > max_element))
@@ -366,7 +368,7 @@ namespace DoFTools
       };
 #endif
 
-    std::vector<unsigned int> dofs_on_this_face;
+    std::vector<types::global_dof_index> dofs_on_this_face;
     dofs_on_this_face.reserve (max_dofs_per_face(dof));
 
     // loop over all faces to check whether they are at a boundary. note
@@ -399,7 +401,7 @@ namespace DoFTools
   void make_boundary_sparsity_pattern (
     const DH                                        &dof,
     const typename FunctionMap<DH::space_dimension>::type &boundary_indicators,
-    const std::vector<unsigned int>                 &dof_to_boundary_mapping,
+    const std::vector<types::global_dof_index>                 &dof_to_boundary_mapping,
     SparsityPattern                                 &sparsity)
   {
     if (DH::dimension == 1)
@@ -421,7 +423,7 @@ namespace DoFTools
               cell = cell->child(direction);
 
             const unsigned int dofs_per_vertex = cell->get_fe().dofs_per_vertex;
-            std::vector<unsigned int> boundary_dof_boundary_indices (dofs_per_vertex);
+            std::vector<types::global_dof_index> boundary_dof_boundary_indices (dofs_per_vertex);
 
             // next get boundary mapped dof indices of boundary dofs
             for (unsigned int i=0; i<dofs_per_vertex; ++i)
@@ -436,7 +438,7 @@ namespace DoFTools
         return;
       }
 
-    const unsigned int n_dofs = dof.n_dofs();
+    const types::global_dof_index n_dofs = dof.n_dofs();
 
     AssertDimension (dof_to_boundary_mapping.size(), n_dofs);
     Assert (boundary_indicators.find(numbers::internal_face_boundary_id) == boundary_indicators.end(),
@@ -448,8 +450,8 @@ namespace DoFTools
 #ifdef DEBUG
     if (sparsity.n_rows() != 0)
       {
-        unsigned int max_element = 0;
-        for (std::vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
+        types::global_dof_index max_element = 0;
+        for (std::vector<types::global_dof_index>::const_iterator i=dof_to_boundary_mapping.begin();
              i!=dof_to_boundary_mapping.end(); ++i)
           if ((*i != DH::invalid_dof_index) &&
               (*i > max_element))
@@ -458,7 +460,7 @@ namespace DoFTools
       };
 #endif
 
-    std::vector<unsigned int> dofs_on_this_face;
+    std::vector<types::global_dof_index> dofs_on_this_face;
     dofs_on_this_face.reserve (max_dofs_per_face(dof));
     typename DH::active_cell_iterator cell = dof.begin_active(),
                                       endc = dof.end();
@@ -493,7 +495,7 @@ namespace DoFTools
   // TODO: QA: reduce the indentation level of this method..., Maier 2012
 
   {
-    const unsigned int n_dofs = dof.n_dofs();
+    const types::global_dof_index n_dofs = dof.n_dofs();
 
     AssertDimension (sparsity.n_rows(), n_dofs);
     AssertDimension (sparsity.n_cols(), n_dofs);
@@ -511,8 +513,8 @@ namespace DoFTools
                   "associated DoF handler objects, asking for any subdomain other "
                   "than the locally owned one does not make sense."));
 
-    std::vector<unsigned int> dofs_on_this_cell;
-    std::vector<unsigned int> dofs_on_other_cell;
+    std::vector<types::global_dof_index> dofs_on_this_cell;
+    std::vector<types::global_dof_index> dofs_on_other_cell;
     dofs_on_this_cell.reserve (max_dofs_per_cell(dof));
     dofs_on_other_cell.reserve (max_dofs_per_cell(dof));
     typename DH::active_cell_iterator cell = dof.begin_active(),
@@ -609,8 +611,10 @@ namespace DoFTools
                       // is not locally owned - otherwise, we touch each
                       // face twice and hence put the indices the other way
                       // around
-                      if (cell->neighbor(face)->subdomain_id() !=
-                          cell->subdomain_id())
+                      if (!cell->neighbor(face)->active()
+                          ||
+                          (cell->neighbor(face)->subdomain_id() !=
+                           cell->subdomain_id()))
                         constraints.add_entries_local_to_global
                         (dofs_on_other_cell, dofs_on_this_cell,
                          sparsity, keep_constrained_dofs);
@@ -709,8 +713,8 @@ namespace DoFTools
       {
         const FiniteElement<DH::dimension,DH::space_dimension> &fe = dof.get_fe();
 
-        std::vector<unsigned int> dofs_on_this_cell(fe.dofs_per_cell);
-        std::vector<unsigned int> dofs_on_other_cell(fe.dofs_per_cell);
+        std::vector<types::global_dof_index> dofs_on_this_cell(fe.dofs_per_cell);
+        std::vector<types::global_dof_index> dofs_on_other_cell(fe.dofs_per_cell);
 
         const Table<2,Coupling>
         int_dof_mask  = dof_couplings_from_component_couplings(fe, int_mask),
@@ -949,8 +953,8 @@ namespace DoFTools
 
         const dealii::hp::FECollection<dim,spacedim> &fe = dof.get_fe();
 
-        std::vector<unsigned int> dofs_on_this_cell(DoFTools::max_dofs_per_cell(dof));
-        std::vector<unsigned int> dofs_on_other_cell(DoFTools::max_dofs_per_cell(dof));
+        std::vector<types::global_dof_index> dofs_on_this_cell(DoFTools::max_dofs_per_cell(dof));
+        std::vector<types::global_dof_index> dofs_on_other_cell(DoFTools::max_dofs_per_cell(dof));
 
         const std::vector<Table<2,Coupling> >
         int_dof_mask
@@ -1133,7 +1137,7 @@ namespace DoFTools
   {
     // do the error checking and frame code here, and then pass on to more
     // specialized functions in the internal namespace
-    const unsigned int n_dofs = dof.n_dofs();
+    const types::global_dof_index n_dofs = dof.n_dofs();
     const unsigned int n_comp = dof.get_fe().n_components();
 
     Assert (sparsity.n_rows() == n_dofs,
@@ -1173,7 +1177,7 @@ namespace DoFTools
     {
       inline bool
       check_master_dof_list (const FullMatrix<double> &face_interpolation_matrix,
-                             const std::vector<unsigned int> &master_dof_list)
+                             const std::vector<types::global_dof_index> &master_dof_list)
       {
         const unsigned int N = master_dof_list.size();
 
@@ -1322,7 +1326,7 @@ namespace DoFTools
         // that base element are independent of that of the other one. this
         // latter case shows up when running hp/hp_constraints_q_system_06
 
-        std::vector<unsigned int> master_dof_list;
+        std::vector<types::global_dof_index> master_dof_list;
         unsigned int index = 0;
         for (int v=0;
              v<static_cast<signed int>(GeometryInfo<dim>::vertices_per_face);
@@ -1412,7 +1416,7 @@ namespace DoFTools
 
         // finally copy the list into the mask
         std::fill (master_dof_mask.begin(), master_dof_mask.end(), false);
-        for (std::vector<unsigned int>::const_iterator i=master_dof_list.begin();
+        for (std::vector<types::global_dof_index>::const_iterator i=master_dof_list.begin();
              i!=master_dof_list.end(); ++i)
           master_dof_mask[*i] = true;
       }
@@ -1670,8 +1674,8 @@ namespace DoFTools
        * avoid making the sparsity pattern fuller than necessary.
        */
       void
-      filter_constraints (const std::vector<unsigned int> &master_dofs,
-                          const std::vector<unsigned int> &slave_dofs,
+      filter_constraints (const std::vector<types::global_dof_index> &master_dofs,
+                          const std::vector<types::global_dof_index> &slave_dofs,
                           const FullMatrix<double> &face_constraints,
                           ConstraintMatrix &constraints)
       {
@@ -1688,10 +1692,10 @@ namespace DoFTools
         // check for a couple conditions that happened in parallel
         // distributed mode
         for (unsigned int row=0; row!=n_slave_dofs; ++row)
-          Assert (slave_dofs[row] != numbers::invalid_unsigned_int,
+          Assert (slave_dofs[row] != numbers::invalid_dof_index,
                   ExcInternalError());
         for (unsigned int col=0; col!=n_master_dofs; ++col)
-          Assert (master_dofs[col] != numbers::invalid_unsigned_int,
+          Assert (master_dofs[col] != numbers::invalid_dof_index,
                   ExcInternalError());
 
 
@@ -1885,8 +1889,8 @@ namespace DoFTools
 
       const unsigned int spacedim = DH::space_dimension;
 
-      std::vector<unsigned int> dofs_on_mother;
-      std::vector<unsigned int> dofs_on_children;
+      std::vector<types::global_dof_index> dofs_on_mother;
+      std::vector<types::global_dof_index> dofs_on_children;
 
       // loop over all lines; only on lines there can be constraints. We do
       // so by looping over all active cells and checking whether any of
@@ -2009,8 +2013,8 @@ namespace DoFTools
     {
       const unsigned int dim = 3;
 
-      std::vector<unsigned int> dofs_on_mother;
-      std::vector<unsigned int> dofs_on_children;
+      std::vector<types::global_dof_index> dofs_on_mother;
+      std::vector<types::global_dof_index> dofs_on_children;
 
       // loop over all quads; only on quads there can be constraints. We do
       // so by looping over all active cells and checking whether any of
@@ -2227,9 +2231,9 @@ namespace DoFTools
 
       // similarly have arrays that will hold master and slave dof numbers,
       // as well as a scratch array needed for the complicated case below
-      std::vector<unsigned int> master_dofs;
-      std::vector<unsigned int> slave_dofs;
-      std::vector<unsigned int> scratch_dofs;
+      std::vector<types::global_dof_index> master_dofs;
+      std::vector<types::global_dof_index> slave_dofs;
+      std::vector<types::global_dof_index> scratch_dofs;
 
       // caches for the face and subface interpolation matrices between
       // different (or the same) finite elements. we compute them only
@@ -2335,21 +2339,10 @@ namespace DoFTools
                     // Now create constraint matrix for the subfaces and
                     // assemble it. ignore all interfaces with artificial
                     // cells because we can only get to such interfaces if
-                    // the current cell is a ghost cell. also ignore the
-                    // interface if the neighboring cell is a ghost cell in
-                    // 2d: what we would compute here are the constraints
-                    // on the ghost cell's DoFs, but we are not interested
-                    // in those: we only want constraints on *locally
-                    // active* DoFs, not on *locally relevant* DoFs.
-                    // However, in 3d we must still compute those
-                    // constraints because it might happen that a
-                    // constraint is related to an edge where the hanging
-                    // node is only detected if we also look between ghosts
+                    // the current cell is a ghost cell
                     for (unsigned int c=0; c<cell->face(face)->n_children(); ++c)
                       {
-                        if (cell->neighbor_child_on_subface (face, c)->is_artificial()
-                            ||
-                            (dim == 2 && cell->neighbor_child_on_subface (face, c)->is_ghost()))
+                        if (cell->neighbor_child_on_subface (face, c)->is_artificial())
                           continue;
 
                         const typename DH::active_face_iterator
@@ -2383,7 +2376,7 @@ namespace DoFTools
                         subface->get_dof_indices (slave_dofs, subface_fe_index);
 
                         for (unsigned int i=0; i<slave_dofs.size(); ++i)
-                          Assert (slave_dofs[i] != numbers::invalid_unsigned_int,
+                          Assert (slave_dofs[i] != numbers::invalid_dof_index,
                                   ExcInternalError());
 
                         // Now create the element constraint for this
@@ -2862,8 +2855,8 @@ namespace DoFTools
 
           const unsigned int dofs_per_face = fe.dofs_per_face;
 
-          std::vector<unsigned int> dofs_1(dofs_per_face);
-          std::vector<unsigned int> dofs_2(dofs_per_face);
+          std::vector<types::global_dof_index> dofs_1(dofs_per_face);
+          std::vector<types::global_dof_index> dofs_2(dofs_per_face);
 
           face_1->get_dof_indices(dofs_1, face_1_index);
           face_2->get_dof_indices(dofs_2, face_2_index);
@@ -2900,9 +2893,9 @@ namespace DoFTools
           for (unsigned int i=0; i<dofs_per_face; ++i)
             if (!constraint_matrix.is_constrained(dofs_2[i]))
               if ((component_mask.n_selected_components(fe.n_components())
-                  == fe.n_components())
-                 ||
-                 component_mask[fe.face_system_to_component_index(i).first])
+                   == fe.n_components())
+                  ||
+                  component_mask[fe.face_system_to_component_index(i).first])
                 {
                   constraint_matrix.add_line(dofs_2[i]);
                   for (unsigned int jj=0; jj<dofs_per_face; ++jj)
@@ -2916,9 +2909,9 @@ namespace DoFTools
                                                                          face_orientation, face_flip, face_rotation)];
 
                       // And finally constrain the two DoFs respecting component_mask:
-                      if (transformation(i,j) != 0)
+                      if (transformation(i,jj) != 0)
                         constraint_matrix.add_entry(dofs_2[i], dofs_1[j],
-                                                    transformation(i,j));
+                                                    transformation(i,jj));
                     }
                 }
         }
@@ -3340,7 +3333,7 @@ namespace DoFTools
         }
 
       // then loop over all cells and do the work
-      std::vector<unsigned int> indices;
+      std::vector<types::global_dof_index> indices;
       for (typename DH::active_cell_iterator c=dof.begin_active();
            c!=dof.end(); ++ c)
         if (c->is_locally_owned())
@@ -3404,7 +3397,7 @@ namespace DoFTools
         }
 
       // then loop over all cells and do the work
-      std::vector<unsigned int> indices;
+      std::vector<types::global_dof_index> indices;
       for (typename DH::active_cell_iterator c=dof.begin_active();
            c!=dof.end(); ++ c)
         if (c->is_locally_owned())
@@ -3466,7 +3459,7 @@ namespace DoFTools
 
     typename DH::active_cell_iterator cell = dof_handler.begin_active(),
                                       endc = dof_handler.end();
-    std::vector<unsigned int> dof_indices;
+    std::vector<types::global_dof_index> dof_indices;
     dof_indices.reserve (max_dofs_per_cell(dof_handler));
 
     for (unsigned int present_cell = 0; cell!=endc; ++cell, ++present_cell)
@@ -3491,7 +3484,7 @@ namespace DoFTools
 
     // compute the mean value on all the dofs by dividing with the number
     // of summands.
-    for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+    for (types::global_dof_index i=0; i<dof_handler.n_dofs(); ++i)
       {
         // assert that each dof was used at least once. this needs not be
         // the case if the vector has more than one component
@@ -3541,7 +3534,7 @@ namespace DoFTools
     internal::get_component_association (dof, component_mask,
                                          dofs_by_component);
 
-    for (unsigned int i=0; i<dof.n_locally_owned_dofs(); ++i)
+    for (types::global_dof_index i=0; i<dof.n_locally_owned_dofs(); ++i)
       if (component_mask[dofs_by_component[i]] == true)
         selected_dofs[i] = true;
   }
@@ -3586,7 +3579,7 @@ namespace DoFTools
     internal::get_component_association (dof, component_mask,
                                          dofs_by_component);
 
-    for (unsigned int i=0; i<dof.n_dofs(); ++i)
+    for (types::global_dof_index i=0; i<dof.n_dofs(); ++i)
       if (component_mask[dofs_by_component[i]] == true)
         selected_dofs[i] = true;
   }
@@ -3659,7 +3652,7 @@ namespace DoFTools
       local_selected_dofs[i] = component_mask[local_component_asssociation[i]];
 
     // then loop over all cells and do work
-    std::vector<unsigned int> indices(fe.dofs_per_cell);
+    std::vector<types::global_dof_index> indices(fe.dofs_per_cell);
     typename DH::level_cell_iterator c;
     for (c = dof.begin(level) ; c != dof.end(level) ; ++ c)
       {
@@ -3740,7 +3733,7 @@ namespace DoFTools
          (component_mask.n_selected_components(n_components(dof_handler)) !=
           n_components(dof_handler)));
 
-    std::vector<unsigned int> face_dof_indices;
+    std::vector<types::global_dof_index> face_dof_indices;
     face_dof_indices.reserve (max_dofs_per_face(dof_handler));
 
     // now loop over all cells and check whether their faces are at the
@@ -3842,7 +3835,7 @@ namespace DoFTools
     // clear and reset array by default values
     selected_dofs.clear ();
     selected_dofs.resize (dof_handler.n_dofs(), false);
-    std::vector<unsigned int> cell_dof_indices;
+    std::vector<types::global_dof_index> cell_dof_indices;
     cell_dof_indices.reserve (max_dofs_per_cell(dof_handler));
 
     // now loop over all cells and check whether their faces are at the
@@ -4039,7 +4032,7 @@ namespace DoFTools
     // preset all values by false
     std::fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false);
 
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
     local_dof_indices.reserve (max_dofs_per_cell(dof_handler));
 
     // this function is similar to the make_sparsity_pattern function, see
@@ -4083,8 +4076,8 @@ namespace DoFTools
     // add the DoF on the adjacent ghost cells to the IndexSet, cache them
     // in a set. need to check each dof manually because we can't be sure
     // that the dof range of locally_owned_dofs is really contiguous.
-    std::vector<unsigned int> dof_indices;
-    std::set<unsigned int> global_dof_indices;
+    std::vector<types::global_dof_index> dof_indices;
+    std::set<types::global_dof_index> global_dof_indices;
 
     typename DH::active_cell_iterator cell = dof_handler.begin_active(),
                                       endc = dof_handler.end();
@@ -4094,7 +4087,7 @@ namespace DoFTools
           dof_indices.resize(cell->get_fe().dofs_per_cell);
           cell->get_dof_indices(dof_indices);
 
-          for (std::vector<unsigned int>::iterator it=dof_indices.begin();
+          for (std::vector<types::global_dof_index>::iterator it=dof_indices.begin();
                it!=dof_indices.end();
                ++it)
             if (!dof_set.is_element(*it))
@@ -4119,8 +4112,8 @@ namespace DoFTools
     // add the DoF on the adjacent ghost cells to the IndexSet, cache them
     // in a set. need to check each dof manually because we can't be sure
     // that the dof range of locally_owned_dofs is really contiguous.
-    std::vector<unsigned int> dof_indices;
-    std::set<unsigned int> global_dof_indices;
+    std::vector<types::global_dof_index> dof_indices;
+    std::set<types::global_dof_index> global_dof_indices;
 
     typename DH::active_cell_iterator cell = dof_handler.begin_active(),
                                       endc = dof_handler.end();
@@ -4130,7 +4123,7 @@ namespace DoFTools
           dof_indices.resize(cell->get_fe().dofs_per_cell);
           cell->get_dof_indices(dof_indices);
 
-          for (std::vector<unsigned int>::iterator it=dof_indices.begin();
+          for (std::vector<types::global_dof_index>::iterator it=dof_indices.begin();
                it!=dof_indices.end();
                ++it)
             if (!dof_set.is_element(*it))
@@ -4226,7 +4219,7 @@ namespace DoFTools
     std::fill_n (subdomain_association.begin(), dof_handler.n_dofs(),
                  numbers::invalid_subdomain_id);
 
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
     local_dof_indices.reserve (max_dofs_per_cell(dof_handler));
 
     // pseudo-randomly assign variables which lie on the interface between
@@ -4307,7 +4300,7 @@ namespace DoFTools
 
     IndexSet index_set (dof_handler.n_dofs());
 
-    std::vector<unsigned int> local_dof_indices;
+    std::vector<types::global_dof_index> local_dof_indices;
     local_dof_indices.reserve (max_dofs_per_cell(dof_handler));
 
     // first generate an unsorted list of all indices which we fill from
@@ -4315,7 +4308,7 @@ namespace DoFTools
     // that inserts indices in the middle, which is an O(n^2) algorithm and
     // hence too expensive. Could also use std::set, but that is in general
     // more expensive than a vector
-    std::vector<unsigned int> subdomain_indices;
+    std::vector<types::global_dof_index> subdomain_indices;
 
     typename DH::active_cell_iterator
     cell = dof_handler.begin_active(),
@@ -4385,7 +4378,7 @@ namespace DoFTools
 
     for (unsigned int c=0; c<dof_handler.get_fe().n_components(); ++c)
       {
-        for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+        for (types::global_dof_index i=0; i<dof_handler.n_dofs(); ++i)
           if ((subdomain_association[i] == subdomain) &&
               (component_association[i] == static_cast<unsigned char>(c)))
             ++n_dofs_on_subdomain[c];
@@ -4406,7 +4399,7 @@ namespace DoFTools
                         const std::vector<unsigned char> &dofs_by_component,
                         const std::vector<unsigned int>  &target_component,
                         const bool                        only_once,
-                        std::vector<unsigned int>        &dofs_per_component,
+                        std::vector<types::global_dof_index> &dofs_per_component,
                         unsigned int                     &component)
     {
       for (unsigned int b=0; b<fe.n_base_elements(); ++b)
@@ -4447,7 +4440,7 @@ namespace DoFTools
                         const std::vector<unsigned char> &dofs_by_component,
                         const std::vector<unsigned int>  &target_component,
                         const bool                        only_once,
-                        std::vector<unsigned int>        &dofs_per_component,
+                        std::vector<types::global_dof_index> &dofs_per_component,
                         unsigned int                     &component)
     {
       // assert that all elements in the collection have the same structure
@@ -4509,13 +4502,14 @@ namespace DoFTools
   void
   count_dofs_per_component (
     const DH      &dof_handler,
-    std::vector<unsigned int> &dofs_per_component,
+    std::vector<types::global_dof_index> &dofs_per_component,
     bool only_once,
     std::vector<unsigned int>  target_component)
   {
     const unsigned int n_components = dof_handler.get_fe().n_components();
 
-    std::fill (dofs_per_component.begin(), dofs_per_component.end(), 0U);
+    std::fill (dofs_per_component.begin(), dofs_per_component.end(),
+               types::global_dof_index(0));
 
     // If the empty vector was given as default argument, set up this
     // vector as identity.
@@ -4565,7 +4559,8 @@ namespace DoFTools
     Assert ((internal::all_elements_are_primitive(dof_handler.get_fe()) == false)
             ||
             (std::accumulate (dofs_per_component.begin(),
-                              dofs_per_component.end(), 0U)
+                              dofs_per_component.end(),
+                              types::global_dof_index(0))
              == dof_handler.n_locally_owned_dofs()),
             ExcInternalError());
 
@@ -4578,10 +4573,11 @@ namespace DoFTools
         = (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
            (&dof_handler.get_tria())))
       {
-        std::vector<unsigned int> local_dof_count = dofs_per_component;
+        std::vector<types::global_dof_index> local_dof_count = dofs_per_component;
 
         MPI_Allreduce ( &local_dof_count[0], &dofs_per_component[0], n_target_components,
-                        MPI_UNSIGNED, MPI_SUM, tria->get_communicator());
+                        DEAL_II_DOF_INDEX_MPI_TYPE,
+                        MPI_SUM, tria->get_communicator());
       }
 #endif
   }
@@ -4591,7 +4587,7 @@ namespace DoFTools
   template <class DH>
   void
   count_dofs_per_block (const DH &dof_handler,
-                        std::vector<unsigned int> &dofs_per_block,
+                        std::vector<types::global_dof_index> &dofs_per_block,
                         const std::vector<unsigned int>  &target_block_)
   {
     std::vector<unsigned int>  target_block = target_block_;
@@ -4603,7 +4599,8 @@ namespace DoFTools
     for (unsigned int this_fe=0; this_fe<fe_collection.size(); ++this_fe)
       {
         const FiniteElement<DH::dimension,DH::space_dimension> &fe = fe_collection[this_fe];
-        std::fill (dofs_per_block.begin(), dofs_per_block.end(), 0U);
+        std::fill (dofs_per_block.begin(), dofs_per_block.end(),
+                   types::global_dof_index(0));
 
         // If the empty vector was given as default argument, set up this
         // vector as identity.
@@ -4653,9 +4650,11 @@ namespace DoFTools
             = (dynamic_cast<const parallel::distributed::Triangulation<DH::dimension,DH::space_dimension>*>
                (&dof_handler.get_tria())))
           {
-            std::vector<unsigned int> local_dof_count = dofs_per_block;
-            MPI_Allreduce ( &local_dof_count[0], &dofs_per_block[0], n_target_blocks,
-                            MPI_UNSIGNED, MPI_SUM, tria->get_communicator());
+            std::vector<types::global_dof_index> local_dof_count = dofs_per_block;
+            MPI_Allreduce ( &local_dof_count[0], &dofs_per_block[0],
+                            n_target_blocks,
+                            DEAL_II_DOF_INDEX_MPI_TYPE,
+                            MPI_SUM, tria->get_communicator());
           }
 #endif
 #endif
@@ -4667,7 +4666,7 @@ namespace DoFTools
   template <int dim, int spacedim>
   void
   count_dofs_per_component (const DoFHandler<dim,spacedim> &dof_handler,
-                            std::vector<unsigned int>      &dofs_per_component,
+                            std::vector<types::global_dof_index>      &dofs_per_component,
                             std::vector<unsigned int>       target_component)
   {
     count_dofs_per_component (dof_handler, dofs_per_component,
@@ -4694,8 +4693,8 @@ namespace DoFTools
         const unsigned int                  coarse_component,
         const InterGridMap<dealii::DoFHandler<dim,spacedim> > &coarse_to_fine_grid_map,
         const std::vector<dealii::Vector<double> > &parameter_dofs,
-        const std::vector<int>             &weight_mapping,
-        std::vector<std::map<unsigned int, float> > &weights,
+        const std::vector<types::global_dof_index>             &weight_mapping,
+        std::vector<std::map<types::global_dof_index, float> > &weights,
         const typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator &begin,
         const typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator &end)
       {
@@ -4748,11 +4747,11 @@ namespace DoFTools
 
         // vector to hold the representation of a single degree of freedom
         // on the coarse grid (for the selected fe) on the fine grid
-        const unsigned int n_fine_dofs = weight_mapping.size();
+        const types::global_dof_index n_fine_dofs = weight_mapping.size();
         dealii::Vector<double> global_parameter_representation (n_fine_dofs);
 
         typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator cell;
-        std::vector<unsigned int> parameter_dof_indices (coarse_fe.dofs_per_cell);
+        std::vector<types::global_dof_index> parameter_dof_indices (coarse_fe.dofs_per_cell);
 
         for (cell=begin; cell!=end; ++cell)
           {
@@ -4806,15 +4805,15 @@ namespace DoFTools
                   // weights, have only one mutex for all of them
                   static Threads::Mutex mutex;
                   Threads::Mutex::ScopedLock lock (mutex);
-                  for (unsigned int i=0; i<global_parameter_representation.size(); ++i)
+                  for (types::global_dof_index i=0; i<global_parameter_representation.size(); ++i)
                     // set this weight if it belongs to a parameter dof.
-                    if (weight_mapping[i] != -1)
+                    if (weight_mapping[i] != numbers::invalid_dof_index)
                       {
                         // only overwrite old value if not by zero
                         if (global_parameter_representation(i) != 0)
                           {
-                            const unsigned int wi = parameter_dof_indices[local_dof],
-                                               wj = weight_mapping[i];
+                            const types::global_dof_index wi = parameter_dof_indices[local_dof],
+                                                          wj = weight_mapping[i];
                             weights[wi][wj] = global_parameter_representation(i);
                           };
                       }
@@ -4838,8 +4837,8 @@ namespace DoFTools
         const unsigned int                  coarse_component,
         const InterGridMap<dealii::DoFHandler<dim,spacedim> > &coarse_to_fine_grid_map,
         const std::vector<dealii::Vector<double> > &parameter_dofs,
-        const std::vector<int>             &weight_mapping,
-        std::vector<std::map<unsigned int,float> > &weights)
+        const std::vector<types::global_dof_index>             &weight_mapping,
+        std::vector<std::map<types::global_dof_index,float> > &weights)
       {
         // simply distribute the range of cells to different threads
         typedef typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator active_cell_iterator;
@@ -4855,8 +4854,8 @@ namespace DoFTools
                          const unsigned int                  ,
                          const InterGridMap<dealii::DoFHandler<dim,spacedim> > &,
                          const std::vector<dealii::Vector<double> > &,
-                         const std::vector<int> &,
-                         std::vector<std::map<unsigned int, float> > &,
+                         const std::vector<types::global_dof_index> &,
+                         std::vector<std::map<types::global_dof_index, float> > &,
                          const typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator &,
                          const typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator &)
           = &compute_intergrid_weights_3<dim>;
@@ -4887,16 +4886,16 @@ namespace DoFTools
         const dealii::DoFHandler<dim,spacedim>              &fine_grid,
         const unsigned int                  fine_component,
         const InterGridMap<dealii::DoFHandler<dim,spacedim> > &coarse_to_fine_grid_map,
-        std::vector<std::map<unsigned int, float> > &weights,
-        std::vector<int>                   &weight_mapping)
+        std::vector<std::map<types::global_dof_index, float> > &weights,
+        std::vector<types::global_dof_index>                   &weight_mapping)
       {
         // aliases to the finite elements used by the dof handlers:
         const FiniteElement<dim,spacedim> &coarse_fe = coarse_grid.get_fe(),
                                            &fine_fe   = fine_grid.get_fe();
 
         // global numbers of dofs
-        const unsigned int n_coarse_dofs = coarse_grid.n_dofs(),
-                           n_fine_dofs   = fine_grid.n_dofs();
+        const types::global_dof_index n_coarse_dofs = coarse_grid.n_dofs(),
+                                      n_fine_dofs   = fine_grid.n_dofs();
 
         // local numbers of dofs
         const unsigned int fine_dofs_per_cell   = fine_fe.dofs_per_cell;
@@ -4991,7 +4990,7 @@ namespace DoFTools
             // if this is an interesting dof. finally count how many true's
             // there
             std::vector<bool> dof_is_interesting (fine_grid.n_dofs(), false);
-            std::vector<unsigned int>  local_dof_indices (fine_fe.dofs_per_cell);
+            std::vector<types::global_dof_index>  local_dof_indices (fine_fe.dofs_per_cell);
 
             for (typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator
                  cell=fine_grid.begin_active();
@@ -5014,11 +5013,11 @@ namespace DoFTools
         weights.resize (n_coarse_dofs);
 
         weight_mapping.clear ();
-        weight_mapping.resize (n_fine_dofs, -1);
+        weight_mapping.resize (n_fine_dofs, numbers::invalid_dof_index);
 
         if (true)
           {
-            std::vector<unsigned int> local_dof_indices(fine_fe.dofs_per_cell);
+            std::vector<types::global_dof_index> local_dof_indices(fine_fe.dofs_per_cell);
             unsigned int next_free_index=0;
             for (typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator
                  cell=fine_grid.begin_active();
@@ -5029,7 +5028,7 @@ namespace DoFTools
                   // if this DoF is a parameter dof and has not yet been
                   // numbered, then do so
                   if ((fine_fe.system_to_component_index(i).first == fine_component) &&
-                      (weight_mapping[local_dof_indices[i]] == -1))
+                      (weight_mapping[local_dof_indices[i]] == numbers::invalid_dof_index))
                     {
                       weight_mapping[local_dof_indices[i]] = next_free_index;
                       ++next_free_index;
@@ -5070,7 +5069,7 @@ namespace DoFTools
         for (unsigned int col=0; col<n_parameters_on_fine_grid; ++col)
           {
             double sum=0;
-            for (unsigned int row=0; row<n_coarse_dofs; ++row)
+            for (types::global_dof_index row=0; row<n_coarse_dofs; ++row)
               if (weights[row].find(col) != weights[row].end())
                 sum += weights[row][col];
             Assert ((std::fabs(sum-1) < 1.e-12) ||
@@ -5119,13 +5118,13 @@ namespace DoFTools
     // to save some memory and since the weights are usually (negative)
     // powers of 2, we choose the value type of the matrix to be @p{float}
     // rather than @p{double}.
-    std::vector<std::map<unsigned int, float> > weights;
+    std::vector<std::map<types::global_dof_index, float> > weights;
 
     // this is this mapping. there is one entry for each dof on the fine
     // grid; if it is a parameter dof, then its value is the column in
     // weights for that parameter dof, if it is any other dof, then its
     // value is -1, indicating an error
-    std::vector<int> weight_mapping;
+    std::vector<types::global_dof_index> weight_mapping;
 
     const unsigned int n_parameters_on_fine_grid
       = internal::compute_intergrid_weights_1 (coarse_grid, coarse_component,
@@ -5134,8 +5133,8 @@ namespace DoFTools
                                                weights, weight_mapping);
 
     // global numbers of dofs
-    const unsigned int n_coarse_dofs = coarse_grid.n_dofs(),
-                       n_fine_dofs   = fine_grid.n_dofs();
+    const types::global_dof_index n_coarse_dofs = coarse_grid.n_dofs(),
+                                  n_fine_dofs   = fine_grid.n_dofs();
 
 
     // get an array in which we store which dof on the coarse grid is a
@@ -5158,8 +5157,8 @@ namespace DoFTools
     // element in this row with weight identical to one. the representant
     // will become an unconstrained degree of freedom, while all others
     // will be constrained to this dof (and possibly others)
-    std::vector<int> representants(n_coarse_dofs, -1);
-    for (unsigned int parameter_dof=0; parameter_dof<n_coarse_dofs;
+    std::vector<types::global_dof_index> representants(n_coarse_dofs, numbers::invalid_dof_index);
+    for (types::global_dof_index parameter_dof=0; parameter_dof<n_coarse_dofs;
          ++parameter_dof)
       if (coarse_dof_is_parameter[parameter_dof] == true)
         {
@@ -5169,19 +5168,19 @@ namespace DoFTools
           Assert (weights[parameter_dof].size() > 0, ExcInternalError());
 
           // find the column where the representant is mentioned
-          std::map<unsigned int,float>::const_iterator i = weights[parameter_dof].begin();
+          std::map<types::global_dof_index,float>::const_iterator i = weights[parameter_dof].begin();
           for (; i!=weights[parameter_dof].end(); ++i)
             if (i->second == 1)
               break;
           Assert (i!=weights[parameter_dof].end(), ExcInternalError());
-          const unsigned int column = i->first;
+          const types::global_dof_index column = i->first;
 
           // now we know in which column of weights the representant is,
           // but we don't know its global index. get it using the inverse
           // operation of the weight_mapping
-          unsigned int global_dof=0;
+          types::global_dof_index global_dof=0;
           for (; global_dof<weight_mapping.size(); ++global_dof)
-            if (weight_mapping[global_dof] == static_cast<int>(column))
+            if (weight_mapping[global_dof] == static_cast<types::global_dof_index>(column))
               break;
           Assert (global_dof < weight_mapping.size(), ExcInternalError());
 
@@ -5202,9 +5201,9 @@ namespace DoFTools
     // innocent block of code. basically, it must be the
     // ConstraintMatrix::add_entry call which takes the bulk of the time,
     // but it is not known to the author how to make it faster...
-    std::vector<std::pair<unsigned int,double> > constraint_line;
-    for (unsigned int global_dof=0; global_dof<n_fine_dofs; ++global_dof)
-      if (weight_mapping[global_dof] != -1)
+    std::vector<std::pair<types::global_dof_index,double> > constraint_line;
+    for (types::global_dof_index global_dof=0; global_dof<n_fine_dofs; ++global_dof)
+      if (weight_mapping[global_dof] != numbers::invalid_dof_index)
         // this global dof is a parameter dof, so it may carry a constraint
         // note that for each global dof, the sum of weights shall be one,
         // so we can find out whether this dof is constrained in the
@@ -5213,14 +5212,14 @@ namespace DoFTools
         // is is the present dof, then we consider this dof to be
         // unconstrained. otherwise, all other dofs are constrained
         {
-          const unsigned int col = weight_mapping[global_dof];
+          const types::global_dof_index col = weight_mapping[global_dof];
           Assert (col < n_parameters_on_fine_grid, ExcInternalError());
 
-          unsigned int first_used_row=0;
+          types::global_dof_index first_used_row=0;
 
           {
             Assert (weights.size() > 0, ExcInternalError());
-            std::map<unsigned int,float>::const_iterator
+            std::map<types::global_dof_index,float>::const_iterator
             col_entry = weights[0].end();
             for (; first_used_row<n_coarse_dofs; ++first_used_row)
               {
@@ -5232,7 +5231,7 @@ namespace DoFTools
             Assert (col_entry != weights[first_used_row].end(), ExcInternalError());
 
             if ((col_entry->second == 1) &&
-                (representants[first_used_row] == static_cast<int>(global_dof)))
+                (representants[first_used_row] == global_dof))
               // dof unconstrained or constrained to itself (in case this
               // cell is mapped to itself, rather than to children of
               // itself)
@@ -5244,13 +5243,13 @@ namespace DoFTools
           constraints.add_line (global_dof);
 
           constraint_line.clear ();
-          for (unsigned int row=first_used_row; row<n_coarse_dofs; ++row)
+          for (types::global_dof_index row=first_used_row; row<n_coarse_dofs; ++row)
             {
-              const std::map<unsigned int,float>::const_iterator
+              const std::map<types::global_dof_index,float>::const_iterator
               j = weights[row].find(col);
               if ((j != weights[row].end()) && (j->second != 0))
-                constraint_line.push_back (std::pair<unsigned int,double>(representants[row],
-                                                                          j->second));
+                constraint_line.push_back (std::pair<types::global_dof_index,double>(representants[row],
+                                           j->second));
             };
 
           constraints.add_entries (global_dof, constraint_line);
@@ -5267,7 +5266,7 @@ namespace DoFTools
     const DoFHandler<dim,spacedim>              &fine_grid,
     const unsigned int                  fine_component,
     const InterGridMap<DoFHandler<dim,spacedim> > &coarse_to_fine_grid_map,
-    std::vector<std::map<unsigned int, float> > &transfer_representation)
+    std::vector<std::map<types::global_dof_index, float> > &transfer_representation)
   {
     // store the weights with which a dof on the parameter grid contributes
     // to a dof on the fine grid. see the long doc below for more info
@@ -5290,13 +5289,13 @@ namespace DoFTools
     // to save some memory and since the weights are usually (negative)
     // powers of 2, we choose the value type of the matrix to be @p{float}
     // rather than @p{double}.
-    std::vector<std::map<unsigned int, float> > weights;
+    std::vector<std::map<types::global_dof_index, float> > weights;
 
     // this is this mapping. there is one entry for each dof on the fine
     // grid; if it is a parameter dof, then its value is the column in
     // weights for that parameter dof, if it is any other dof, then its
     // value is -1, indicating an error
-    std::vector<int> weight_mapping;
+    std::vector<types::global_dof_index> weight_mapping;
 
     internal::compute_intergrid_weights_1 (coarse_grid, coarse_component,
                                            fine_grid, fine_component,
@@ -5304,18 +5303,18 @@ namespace DoFTools
                                            weights, weight_mapping);
 
     // now compute the requested representation
-    const unsigned int n_global_parm_dofs
+    const types::global_dof_index n_global_parm_dofs
       = std::count_if (weight_mapping.begin(), weight_mapping.end(),
-                       std::bind2nd (std::not_equal_to<int> (), -1));
+                       std::bind2nd (std::not_equal_to<types::global_dof_index> (), numbers::invalid_dof_index));
 
     // first construct the inverse mapping of weight_mapping
-    std::vector<unsigned int> inverse_weight_mapping (n_global_parm_dofs,
-                                                      DoFHandler<dim,spacedim>::invalid_dof_index);
-    for (unsigned int i=0; i<weight_mapping.size(); ++i)
+    std::vector<types::global_dof_index> inverse_weight_mapping (n_global_parm_dofs,
+        DoFHandler<dim,spacedim>::invalid_dof_index);
+    for (types::global_dof_index i=0; i<weight_mapping.size(); ++i)
       {
-        const unsigned int parameter_dof = weight_mapping[i];
+        const types::global_dof_index parameter_dof = weight_mapping[i];
         // if this global dof is a parameter
-        if (parameter_dof != numbers::invalid_unsigned_int)
+        if (parameter_dof != numbers::invalid_dof_index)
           {
             Assert (parameter_dof < n_global_parm_dofs, ExcInternalError());
             Assert ((inverse_weight_mapping[parameter_dof] == DoFHandler<dim,spacedim>::invalid_dof_index),
@@ -5326,18 +5325,18 @@ namespace DoFTools
       };
 
     // next copy over weights array and replace respective numbers
-    const unsigned int n_rows = weight_mapping.size();
+    const types::global_dof_index n_rows = weight_mapping.size();
 
     transfer_representation.clear ();
     transfer_representation.resize (n_rows);
 
-    const unsigned int n_coarse_dofs = coarse_grid.n_dofs();
-    for (unsigned int i=0; i<n_coarse_dofs; ++i)
+    const types::global_dof_index n_coarse_dofs = coarse_grid.n_dofs();
+    for (types::global_dof_index i=0; i<n_coarse_dofs; ++i)
       {
-        std::map<unsigned int, float>::const_iterator j = weights[i].begin();
+        std::map<types::global_dof_index, float>::const_iterator j = weights[i].begin();
         for (; j!=weights[i].end(); ++j)
           {
-            const unsigned int p = inverse_weight_mapping[j->first];
+            const types::global_dof_index p = inverse_weight_mapping[j->first];
             Assert (p<n_rows, ExcInternalError());
 
             transfer_representation[p][i] = j->second;
@@ -5350,7 +5349,7 @@ namespace DoFTools
   template <class DH>
   void
   map_dof_to_boundary_indices (const DH                  &dof_handler,
-                               std::vector<unsigned int> &mapping)
+                               std::vector<types::global_dof_index> &mapping)
   {
     Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
 
@@ -5358,9 +5357,9 @@ namespace DoFTools
     mapping.insert (mapping.end(), dof_handler.n_dofs(),
                     DH::invalid_dof_index);
 
-    std::vector<unsigned int> dofs_on_face;
+    std::vector<types::global_dof_index> dofs_on_face;
     dofs_on_face.reserve (max_dofs_per_face(dof_handler));
-    unsigned int next_boundary_index = 0;
+    types::global_dof_index next_boundary_index = 0;
 
     // now loop over all cells and check whether their faces are at the
     // boundary. note that we need not take special care of single lines
@@ -5392,7 +5391,7 @@ namespace DoFTools
   void map_dof_to_boundary_indices (
     const DH                      &dof_handler,
     const std::set<types::boundary_id> &boundary_indicators,
-    std::vector<unsigned int>     &mapping)
+    std::vector<types::global_dof_index>     &mapping)
   {
     Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
     Assert (boundary_indicators.find (numbers::internal_face_boundary_id) == boundary_indicators.end(),
@@ -5406,9 +5405,9 @@ namespace DoFTools
     if (boundary_indicators.size() == 0)
       return;
 
-    std::vector<unsigned int> dofs_on_face;
+    std::vector<types::global_dof_index> dofs_on_face;
     dofs_on_face.reserve (max_dofs_per_face(dof_handler));
-    unsigned int next_boundary_index = 0;
+    types::global_dof_index next_boundary_index = 0;
 
     typename DH::active_cell_iterator cell = dof_handler.begin_active(),
                                       endc = dof_handler.end();
@@ -5436,8 +5435,8 @@ namespace DoFTools
       template <class DH>
       void
       map_dofs_to_support_points(const hp::MappingCollection<DH::dimension, DH::space_dimension> &mapping,
-                                 const DH  &dof_handler,
-                                 std::map<unsigned int,Point<DH::space_dimension> >  &support_points)
+                                 const DH &dof_handler,
+                                 std::map<types::global_dof_index,Point<DH::space_dimension> >  &support_points)
       {
         const unsigned int dim = DH::dimension;
         const unsigned int spacedim = DH::space_dimension;
@@ -5467,7 +5466,7 @@ namespace DoFTools
         typename DH::active_cell_iterator cell =
           dof_handler.begin_active(), endc = dof_handler.end();
 
-        std::vector<unsigned int> local_dof_indices;
+        std::vector<types::global_dof_index> local_dof_indices;
         for (; cell != endc; ++cell)
           // only work on locally relevant cells
           if (cell->is_artificial() == false)
@@ -5494,12 +5493,12 @@ namespace DoFTools
                                  std::vector<Point<DH::space_dimension> >  &support_points)
       {
         // get the data in the form of the map as above
-        std::map<unsigned int,Point<DH::space_dimension> >  x_support_points;
+        std::map<types::global_dof_index,Point<DH::space_dimension> >  x_support_points;
         map_dofs_to_support_points(mapping, dof_handler, x_support_points);
 
         // now convert from the map to the linear vector. make sure every
         // entry really appeared in the map
-        for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+        for (types::global_dof_index i=0; i<dof_handler.n_dofs(); ++i)
           {
             Assert (x_support_points.find(i) != x_support_points.end(),
                     ExcInternalError());
@@ -5559,7 +5558,7 @@ namespace DoFTools
   void
   map_dofs_to_support_points (const Mapping<dim,spacedim>       &mapping,
                               const DoFHandler<dim,spacedim>    &dof_handler,
-                              std::map<unsigned int, Point<spacedim> > &support_points)
+                              std::map<types::global_dof_index, Point<spacedim> > &support_points)
   {
     support_points.clear();
 
@@ -5577,7 +5576,7 @@ namespace DoFTools
   void
   map_dofs_to_support_points(const hp::MappingCollection<dim, spacedim> &mapping,
                              const hp::DoFHandler<dim, spacedim> &dof_handler,
-                             std::map<unsigned int, Point<spacedim> > &support_points)
+                             std::map<types::global_dof_index, Point<spacedim> > &support_points)
   {
     support_points.clear();
 
@@ -5664,7 +5663,7 @@ namespace DoFTools
             VectorTools::ExcNoComponentSelected());
 
     // a field to store the indices
-    std::vector<unsigned int> face_dofs;
+    std::vector<types::global_dof_index> face_dofs;
     face_dofs.reserve (max_dofs_per_face(dof));
 
     typename DH<dim,spacedim>::active_cell_iterator
@@ -5733,11 +5732,11 @@ namespace DoFTools
     const DH &dof_handler,
     const unsigned int level,
     const std::vector<bool> &selected_dofs,
-    unsigned int offset)
+    types::global_dof_index offset)
   {
     typename DH::level_cell_iterator cell;
     typename DH::level_cell_iterator endc = dof_handler.end(level);
-    std::vector<unsigned int> indices;
+    std::vector<types::global_dof_index> indices;
 
     unsigned int i=0;
     for (cell=dof_handler.begin(level); cell != endc; ++i, ++cell)
@@ -5748,7 +5747,7 @@ namespace DoFTools
         if (selected_dofs.size()!=0)
           AssertDimension(indices.size(), selected_dofs.size());
 
-        for (unsigned int j=0; j<indices.size(); ++j)
+        for (types::global_dof_index j=0; j<indices.size(); ++j)
           {
             if (selected_dofs.size() == 0)
               block_list.add(i,indices[j]-offset);
@@ -5774,7 +5773,7 @@ namespace DoFTools
     typename DH::level_cell_iterator cell;
     typename DH::level_cell_iterator endc = dof_handler.end(level);
 
-    std::vector<unsigned int> indices;
+    std::vector<types::global_dof_index> indices;
     std::vector<bool> exclude;
 
     for (cell=dof_handler.begin(level); cell != endc; ++cell)
@@ -5793,13 +5792,13 @@ namespace DoFTools
               if (cell->at_boundary(face) || cell->neighbor(face)->level() != cell->level())
                 for (unsigned int i=0; i<dpf; ++i)
                   exclude[fe.face_to_cell_index(i,face)] = true;
-            for (unsigned int j=0; j<indices.size(); ++j)
+            for (types::global_dof_index j=0; j<indices.size(); ++j)
               if (!exclude[j])
                 block_list.add(0, indices[j]);
           }
         else
           {
-            for (unsigned int j=0; j<indices.size(); ++j)
+            for (types::global_dof_index j=0; j<indices.size(); ++j)
               block_list.add(0, indices[j]);
           }
       }
@@ -5821,7 +5820,7 @@ namespace DoFTools
     typename DH::level_cell_iterator pcell = dof_handler.begin(level-1);
     typename DH::level_cell_iterator endc = dof_handler.end(level-1);
 
-    std::vector<unsigned int> indices;
+    std::vector<types::global_dof_index> indices;
     std::vector<bool> exclude;
 
     for (unsigned int block = 0; pcell != endc; ++pcell)
@@ -5943,7 +5942,7 @@ namespace DoFTools
     // into the sparsity pattern.
     block_list.reinit(vertex_dof_count.size(), dof_handler.n_dofs(level), vertex_dof_count);
 
-    std::vector<unsigned int> indices;
+    std::vector<types::global_dof_index> indices;
     std::vector<bool> exclude;
 
     for (cell=dof_handler.begin(level); cell != endc; ++cell)
index c935ac1dd8fae2507832530b45c3f499b9f0c7ad..17d1beaa6caae0580143f1fd7da74d51ae016837 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
@@ -76,32 +81,40 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
      const hp::DoFHandler<deal_II_dimension,deal_II_dimension> &dof_col,
      SP    &sparsity);
 
-    // #if deal_II_dimension > 1
     template void
     DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
     (const DoFHandler<deal_II_dimension>& dof,
-     const std::vector<unsigned int>  &,
+     const std::vector<types::global_dof_index>  &,
      SP    &);
 
     template void
     DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
     (const hp::DoFHandler<deal_II_dimension>& dof,
-     const std::vector<unsigned int>  &,
+     const std::vector<types::global_dof_index>  &,
      SP    &);
 
     template void
     DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
     (const DoFHandler<deal_II_dimension>& dof,
      const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
-     const std::vector<unsigned int>  &dof_to_boundary_mapping,
+     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
      SP    &sparsity);
 
     template void
     DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
     (const hp::DoFHandler<deal_II_dimension>& dof,
      const FunctionMap<deal_II_dimension>::type  &boundary_indicators,
-     const std::vector<unsigned int>  &dof_to_boundary_mapping,
+     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
+     SP    &sparsity);
+
+#if deal_II_dimension < 3
+    template void
+    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
+    (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
+     const FunctionMap<deal_II_dimension+1>::type  &boundary_indicators,
+     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
      SP    &sparsity);
+ #endif
 
     template void
     DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
@@ -115,11 +128,11 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
 
     template void
       DoFTools::make_cell_patches<DoFHandler<deal_II_dimension>,SP>
-      (SP&, const DoFHandler<deal_II_dimension>&, unsigned int, const std::vector<bool>&, unsigned int);
+      (SP&, const DoFHandler<deal_II_dimension>&, const unsigned int, const std::vector<bool>&, types::global_dof_index);
 
     template void
       DoFTools::make_cell_patches<MGDoFHandler<deal_II_dimension>,SP>
-      (SP&, const MGDoFHandler<deal_II_dimension>&, unsigned int, const std::vector<bool>&, unsigned int);
+      (SP&, const MGDoFHandler<deal_II_dimension>&, const unsigned int, const std::vector<bool>&, types::global_dof_index);
 
 #if deal_II_dimension > 1
 
@@ -203,27 +216,27 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
     template void
     DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
     (const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-     const std::vector<unsigned int>  &,
+     const std::vector<types::global_dof_index>  &,
      SP    &);
 
     //template void
     //DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
     //(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-    // const std::vector<unsigned int>  &,
+    // const std::vector<types::global_dof_index>  &,
     // SP    &);
 
     template void
     DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
     (const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
      const FunctionMap<deal_II_dimension+1>::type  &boundary_indicators,
-     const std::vector<unsigned int>  &dof_to_boundary_mapping,
+     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
      SP    &sparsity);
 
     //template void
     //DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
     //(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
     // const FunctionMap<deal_II_dimension+1>::type  &boundary_indicators,
-    // const std::vector<unsigned int>  &dof_to_boundary_mapping,
+    // const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
     // SP    &sparsity);
 
 #endif
@@ -280,28 +293,28 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
     template void
     DoFTools::make_boundary_sparsity_pattern<DoFHandler<1,3>,SP>
     (const DoFHandler<1,3>& dof,
-     const std::vector<unsigned int>  &,
+     const std::vector<types::global_dof_index>  &,
      SP    &);
 
-    //template void
-    //DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<1,3>,SP>
-    //(const hp::DoFHandler<1,3>& dof,
-    // const std::vector<unsigned int>  &,
-    // SP    &);
+    template void
+    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<1,3>,SP>
+    (const hp::DoFHandler<1,3>& dof,
+     const std::vector<types::global_dof_index>  &,
+     SP    &);
 
     template void
     DoFTools::make_boundary_sparsity_pattern<DoFHandler<1,3>,SP>
     (const DoFHandler<1,3>& dof,
      const FunctionMap<3>::type  &boundary_indicators,
-     const std::vector<unsigned int>  &dof_to_boundary_mapping,
+     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
      SP    &sparsity);
 
-    //template void
-    //DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<1,3>,SP>
-    //(const hp::DoFHandler<1,3>& dof,
-    // const FunctionMap<3>::type  &boundary_indicators,
-    // const std::vector<unsigned int>  &dof_to_boundary_mapping,
-    // SP    &sparsity);
+    template void
+    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<1,3>,SP>
+    (const hp::DoFHandler<1,3>& dof,
+     const FunctionMap<3>::type  &boundary_indicators,
+     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
+     SP    &sparsity);
 
 #endif
 
@@ -799,13 +812,13 @@ template
 void
 DoFTools::count_dofs_per_component<DoFHandler<deal_II_dimension> > (
   const DoFHandler<deal_II_dimension>&,
-  std::vector<unsigned int>&, bool, std::vector<unsigned int>);
+  std::vector<types::global_dof_index>&, bool, std::vector<unsigned int>);
 
 template
 void
 DoFTools::count_dofs_per_component<hp::DoFHandler<deal_II_dimension> > (
   const hp::DoFHandler<deal_II_dimension>&,
-  std::vector<unsigned int>&, bool, std::vector<unsigned int>);
+  std::vector<types::global_dof_index>&, bool, std::vector<unsigned int>);
 
 
 #if deal_II_dimension < 3
@@ -813,13 +826,13 @@ template
 void
 DoFTools::count_dofs_per_component<DoFHandler<deal_II_dimension, deal_II_dimension+1> > (
   const DoFHandler<deal_II_dimension, deal_II_dimension+1>&,
-  std::vector<unsigned int>&, bool, std::vector<unsigned int>);
+  std::vector<types::global_dof_index>&, bool, std::vector<unsigned int>);
 
 template
 void
 DoFTools::count_dofs_per_component<hp::DoFHandler<deal_II_dimension, deal_II_dimension+1> > (
   const hp::DoFHandler<deal_II_dimension, deal_II_dimension+1>&,
-  std::vector<unsigned int>&, bool, std::vector<unsigned int>);
+  std::vector<types::global_dof_index>&, bool, std::vector<unsigned int>);
 
 template
 void
@@ -845,13 +858,13 @@ template
 void
 DoFTools::count_dofs_per_component<DoFHandler<1,3> > (
   const DoFHandler<1,3>&,
-  std::vector<unsigned int>&, bool, std::vector<unsigned int>);
+  std::vector<types::global_dof_index>&, bool, std::vector<unsigned int>);
 
 template
 void
 DoFTools::count_dofs_per_component<hp::DoFHandler<1,3> > (
   const hp::DoFHandler<1,3>&,
-  std::vector<unsigned int>&, bool, std::vector<unsigned int>);
+  std::vector<types::global_dof_index>&, bool, std::vector<unsigned int>);
 
 template
 void
@@ -876,28 +889,28 @@ template
 void
 DoFTools::count_dofs_per_block<DoFHandler<deal_II_dimension> > (
   const DoFHandler<deal_II_dimension>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 template
 void
 DoFTools::count_dofs_per_block<hp::DoFHandler<deal_II_dimension> > (
   const hp::DoFHandler<deal_II_dimension>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 template
 void
 DoFTools::count_dofs_per_block<MGDoFHandler<deal_II_dimension> > (
   const MGDoFHandler<deal_II_dimension>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 template
 void
 DoFTools::count_dofs_per_component<deal_II_dimension> (
   const DoFHandler<deal_II_dimension>&,
-  std::vector<unsigned int>&, std::vector<unsigned int>);
+  std::vector<types::global_dof_index>&, std::vector<unsigned int>);
 
 template
 void
@@ -913,7 +926,7 @@ DoFTools::compute_intergrid_transfer_representation<deal_II_dimension>
 (const DoFHandler<deal_II_dimension> &, const unsigned int,
  const DoFHandler<deal_II_dimension> &, const unsigned int,
  const InterGridMap<DoFHandler<deal_II_dimension> > &,
- std::vector<std::map<unsigned int, float> > &);
+ std::vector<std::map<types::global_dof_index, float> > &);
 
 
 template
@@ -921,13 +934,13 @@ void
 DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension> >
 (const DoFHandler<deal_II_dimension> &,
  const std::set<types::boundary_id> &,
- std::vector<unsigned int> &);
+ std::vector<types::global_dof_index> &);
 
 template
 void
 DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension> >
 (const DoFHandler<deal_II_dimension> &,
- std::vector<unsigned int> &);
+ std::vector<types::global_dof_index> &);
 
 
 
@@ -936,13 +949,13 @@ void
 DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension> >
 (const hp::DoFHandler<deal_II_dimension> &,
  const std::set<types::boundary_id> &,
- std::vector<unsigned int> &);
+ std::vector<types::global_dof_index> &);
 
 template
 void
 DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension> >
 (const hp::DoFHandler<deal_II_dimension> &,
- std::vector<unsigned int> &);
+ std::vector<types::global_dof_index> &);
 
 
 
@@ -967,7 +980,7 @@ void
 DoFTools::map_dofs_to_support_points<deal_II_dimension>
 (const Mapping<deal_II_dimension,deal_II_dimension>&,
  const DoFHandler<deal_II_dimension>&,
- std::map<unsigned int, Point<deal_II_dimension> >&);
+ std::map<types::global_dof_index, Point<deal_II_dimension> >&);
 
 
 template
@@ -975,7 +988,7 @@ void
 DoFTools::map_dofs_to_support_points<deal_II_dimension>
 (const hp::MappingCollection<deal_II_dimension,deal_II_dimension>&,
  const hp::DoFHandler<deal_II_dimension>&,
- std::map<unsigned int, Point<deal_II_dimension> >&);
+ std::map<types::global_dof_index, Point<deal_II_dimension> >&);
 
 #if deal_II_dimension < 3
 
@@ -998,35 +1011,35 @@ void
 DoFTools::map_dofs_to_support_points<deal_II_dimension,deal_II_dimension+1>
 (const Mapping<deal_II_dimension,deal_II_dimension+1>&,
  const DoFHandler<deal_II_dimension, deal_II_dimension+1>&,
- std::map<unsigned int, Point<deal_II_dimension+1> >&);
+ std::map<types::global_dof_index, Point<deal_II_dimension+1> >&);
 
 template
 void
 DoFTools::map_dofs_to_support_points<deal_II_dimension,deal_II_dimension+1>
 (const hp::MappingCollection<deal_II_dimension,deal_II_dimension+1>&,
  const hp::DoFHandler<deal_II_dimension, deal_II_dimension+1>&,
- std::map<unsigned int, Point<deal_II_dimension+1> >&);
+ std::map<types::global_dof_index, Point<deal_II_dimension+1> >&);
 
 
 template
 void
 DoFTools::count_dofs_per_block<DoFHandler<deal_II_dimension,deal_II_dimension+1> > (
   const DoFHandler<deal_II_dimension,deal_II_dimension+1>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 template
 void
 DoFTools::count_dofs_per_block<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> > (
   const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 template
 void
 DoFTools::count_dofs_per_block<MGDoFHandler<deal_II_dimension,deal_II_dimension+1> > (
   const MGDoFHandler<deal_II_dimension,deal_II_dimension+1>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 #endif
@@ -1045,21 +1058,21 @@ template
 void
 DoFTools::count_dofs_per_block<DoFHandler<1,3> > (
   const DoFHandler<1,3>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 template
 void
 DoFTools::count_dofs_per_block<hp::DoFHandler<1,3> > (
   const hp::DoFHandler<1,3>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 template
 void
 DoFTools::count_dofs_per_block<MGDoFHandler<1,3> > (
   const MGDoFHandler<1,3>&,
-  std::vector<unsigned int>&,
+  std::vector<types::global_dof_index>&,
   const std::vector<unsigned int> &);
 
 #endif
@@ -1114,13 +1127,13 @@ void
 DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
 (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
  const std::set<types::boundary_id> &,
- std::vector<unsigned int> &);
+ std::vector<types::global_dof_index> &);
 
 template
 void
 DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
 (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- std::vector<unsigned int> &);
+ std::vector<types::global_dof_index> &);
 
 
 template
@@ -1134,13 +1147,13 @@ DoFTools::extract_hanging_node_dofs
  DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
  (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
   const std::set<types::boundary_id> &,
-  std::vector<unsigned int> &);
+  std::vector<types::global_dof_index> &);
 
  template
  void
  DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
  (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-  std::vector<unsigned int> &);
+  std::vector<types::global_dof_index> &);
 
 #endif
 
@@ -1151,13 +1164,13 @@ void
 DoFTools::map_dof_to_boundary_indices<DoFHandler<1,3> >
 (const DoFHandler<1,3> &,
  const std::set<types::boundary_id> &,
- std::vector<unsigned int> &);
+ std::vector<types::global_dof_index> &);
 
 template
 void
 DoFTools::map_dof_to_boundary_indices<DoFHandler<1,3> >
 (const DoFHandler<1,3> &,
- std::vector<unsigned int> &);
+ std::vector<types::global_dof_index> &);
 
 
 template
@@ -1166,18 +1179,18 @@ DoFTools::extract_hanging_node_dofs
 (const DoFHandler<1,3> &dof_handler,
  std::vector<bool>     &selected_dofs);
 
-// template
-// void
-// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<1,3> >
-// (const hp::DoFHandler<1,3> &,
-//  const std::set<unsigned char> &,
-//  std::vector<unsigned int> &);
-
-// template
-// void
-// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<1,3> >
-// (const hp::DoFHandler<1,3> &,
-//  std::vector<unsigned int> &);
+template
+void
+DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<1,3> >
+(const hp::DoFHandler<1,3> &,
+ const std::set<unsigned char> &,
+ std::vector<types::global_dof_index> &);
+
+template
+void
+DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<1,3> >
+(const hp::DoFHandler<1,3> &,
+ std::vector<types::global_dof_index> &);
 
 #endif
 
index d5c7acb12db31204940a6c41f595c4108852b5e2..69c2f5aebf3e54102a7849f0dc81f6b07d937d2e 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/dofs/number_cache.h>
index d5d3852aaba1199b9e8820376c409f5eda2ca182..5604f193392dacd016e7b2df5e3153a32e3716c5 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index 75ee185587ff1cdce8c95640bb20c29386aa73cb..4605f3746ba229c7648fa369148abd9cb20fd83e 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/block_mask.h>
 
index 100e43443ef01ee1bb8626511a813c15d767906a..f937bcca9914c4d2575f7a745d20a9a6346fdb1f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/component_mask.h>
 
index 1a9e9f9fa419a6c7d79e007a567664eb287d10fb..cdb97b5104b3bbd2dfa062be453fc04490006ee0 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/fe/mapping.h>
index f9ff03fcfd3ed7061049ca8bb206f5ce4ec6bfbd..f73ecc0b257616f2ae43204197a8bade6ccd6a9d 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index 3b756c51122be9e8d73e55535b03c4cd9efe8c8e..fd5262f3e1598290f42e5cd99e08ba279af6fb97 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/quadrature.h>
@@ -290,7 +294,7 @@ FE_ABF<dim>::initialize_support_points (const unsigned int deg)
 
 // This function is the same Raviart-Thomas interpolation performed by
 // interpolate. Still, we cannot use interpolate, since it was written
-// for smooth functions. Thefunctions interpolated here are not
+// for smooth functions. The functions interpolated here are not
 // smooth, maybe even not continuous. Therefore, we must double the
 // number of quadrature points in each direction in order to integrate
 // only smooth functions.
index 39c742630590f7fc7b08bed8510a0717d1d6fd93..4c3d98f38e60611c521297e999df24448f09cdb6 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 0eb002635b1963044bed4a7aed8af62efdaca968..5f53049c9066a9b2007cf9c6f0f8ea560d67b84c 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/qprojector.h>
index 314d27c5e9c4415448aa8f478da13ba07f7ffaa0..78bf3e9d7ffde93fbadc0d9f99037f65fbd25949 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index b61729db0fae7cb03579e53231edd4f1afcf1528..e0873d9ba3f6a6de3210041acf74a7796c600d76 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/geometry_info.h>
 #include <deal.II/fe/fe.h>
index 1ce4b1b45692bbd3fbcab6a5861915a6b373dfe1..a22345159fc6f2e0dadb9669f5d08f761832e087 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/fe_dg_vector.templates.h>
 #include <deal.II/base/polynomials_abf.h>
index 1bb7dcb6b081b835777673be28a103d3d75e421d..8c2cba02543f3c79ffe5056ae0a063245b758b15 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 3b42c6ce309f794973795dd29620dd7c6e45dc8a..bb3f9531af0af217afd9041d444116b15db15ea5 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/fe_dgp.h>
 #include <deal.II/fe/fe_tools.h>
index e28b03e1b8451bf4fb306b6eda3cc46ac28b925d..060ba1f7e4e25fdd963aa5b88848f03ed2c45837 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index 37a934fbbc4c31e4ebdd56002c52bfe8af7f467e..fca8e76c697d16826e8afaebb5cb5e5d592a88cb 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/fe_dgp_monomial.h>
 #include <deal.II/fe/fe_tools.h>
index 401fe4df15c57b58b8770b546e436ec952f17a7d..71da79061f30b4505bfe78049dff8030c2360893 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index fccbec69f84824647d492e6b565e1d50f6957510..abecac846258a2945c81f93f9864f44b7944ad11 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature.h>
 #include <deal.II/grid/tria.h>
index 7e6cfe9486f600f7017faf3c32e79be05b933b64..48069e7969da59ca35844dbce327a5e7f467222b 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 0431bfc0fe26c00ecc4ff624b07fc72aba526656..07139d90a89518cf53bba5ec442f31bb2dc61616 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature.h>
 #include <deal.II/base/quadrature_lib.h>
index ebef67e7483257731912981c538fd8f3c6cbad6a..f9c6ccb13d3208651cd0ced52ecd1476fffffd19 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index 85812d966c09ae12a753e66afe8b68124bfb35b6..b8637568fc543241cb4d50e318bcf71ce6d79d64 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/fe_face.h>
 #include <deal.II/fe/fe_poly_face.templates.h>
index 631a8f52f6f2d93c2af47eeadddcf2b665bc7a73..8d9947442819aebfb2247b10b6d006a4d496e97c 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 4410551a5d61e739f9fc14f35a22fc62e5961ed4..f14d8950769f948c8a7b587030671129fb27bee0 100644 (file)
@@ -1,3 +1,19 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/quadrature.h>
@@ -230,7 +246,7 @@ FE_Nedelec<2>::initialize_support_points (const unsigned int degree)
   // Initialize quadratures to obtain
   // quadrature points later on.
   const QGauss<dim - 1> reference_edge_quadrature (degree + 1);
-  const unsigned int&
+  const unsigned int &
   n_edge_points = reference_edge_quadrature.size ();
   const unsigned int n_boundary_points
     = GeometryInfo<dim>::lines_per_cell * n_edge_points;
@@ -511,7 +527,7 @@ FE_Nedelec<dim>::initialize_restriction ()
   const QGauss<1> edge_quadrature (2 * this->degree);
   const std::vector<Point<1> > &edge_quadrature_points
     = edge_quadrature.get_points ();
-  const unsigned int&
+  const unsigned int &
   n_edge_quadrature_points = edge_quadrature.size ();
   const unsigned int
   index = RefinementCase<dim>::isotropic_refinement - 1;
@@ -3290,7 +3306,7 @@ FE_Nedelec<dim>::interpolate (std::vector<double> &local_dofs,
       {
         const QGauss<1>
         reference_edge_quadrature (this->degree);
-        const unsigned int&
+        const unsigned int &
         n_edge_points = reference_edge_quadrature.size ();
 
         // Let us begin with the
@@ -4151,7 +4167,7 @@ FE_Nedelec<dim>::interpolate (std::vector<double> &local_dofs,
             // the interior shape
             // functions.
             const QGauss<dim> reference_quadrature (this->degree);
-            const unsigned int&
+            const unsigned int &
             n_interior_points = reference_quadrature.size ();
 
             // We create the
@@ -4556,7 +4572,7 @@ const
       // Let us begin with the
       // interpolation part.
       const QGauss<dim - 1> reference_edge_quadrature (this->degree);
-      const unsigned int&
+      const unsigned int &
       n_edge_points = reference_edge_quadrature.size ();
 
       for (unsigned int i = 0; i < 2; ++i)
@@ -4672,7 +4688,7 @@ const
           // vertical, interior
           // shape functions.
           const QGauss<dim> reference_quadrature (this->degree);
-          const unsigned int&
+          const unsigned int &
           n_interior_points = reference_quadrature.size ();
           const std::vector<Polynomials::Polynomial<double> > &
           legendre_polynomials
@@ -4827,7 +4843,7 @@ const
       // Let us begin with the
       // interpolation part.
       const QGauss<1> reference_edge_quadrature (this->degree);
-      const unsigned int&
+      const unsigned int &
       n_edge_points = reference_edge_quadrature.size ();
 
       for (unsigned int q_point = 0; q_point < n_edge_points; ++q_point)
index 72a5fe8d826370a54bc73d0572e4a53ccc090b64..62125b0440b232d929e9b391d6084b0fdb1bb899 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 71b32f25d719c96014a0dd7d4609cc7f15155dd6..a37f386811fc44756f98da158a2af08dba1b9dec 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/fe_nothing.h>
 
index b2eb93ec7681ba51ca135d27ed438e5f624c6b62..28d87008e922470942dd59d43def8cade5a5c24f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 2c1ba722eaaf4b2feda5eb52288f4ac787bf41d4..40e7eab991ce8bf2a7a2686dd5e8cc55be605ffa 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/qprojector.h>
 #include <deal.II/base/tensor_product_polynomials.h>
index 50ad8f5f85f934514a7fe52cf03eae0fdc63dd9a..5ac8c5c78c01e9c38868bc5c98e7f4acef66b0d2 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index 8d5562849c6710ac953e6b185fa01f5522aaf9cd..9f6460c363d50fa3cc67440aa019912fa7b86628 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/derivative_form.h>
 #include <deal.II/base/qprojector.h>
@@ -37,9 +41,9 @@ namespace
    * given cell.
    */
   void
-  get_face_sign_change (const Triangulation<1>::cell_iterator &,
-                        const unsigned int                     ,
-                        std::vector<double>                   &face_sign)
+  get_face_sign_change_rt (const Triangulation<1>::cell_iterator &,
+                           const unsigned int                     ,
+                           std::vector<double>                   &face_sign)
   {
     // nothing to do in 1d
     std::fill (face_sign.begin (), face_sign.end (), 1.0);
@@ -48,9 +52,9 @@ namespace
 
 
   void
-  get_face_sign_change (const Triangulation<2>::cell_iterator &cell,
-                        const unsigned int                     dofs_per_face,
-                        std::vector<double>                   &face_sign)
+  get_face_sign_change_rt (const Triangulation<2>::cell_iterator &cell,
+                           const unsigned int                     dofs_per_face,
+                           std::vector<double>                   &face_sign)
   {
     const unsigned int dim = 2;
     const unsigned int spacedim = 2;
@@ -83,13 +87,47 @@ namespace
 
 
   void
-  get_face_sign_change (const Triangulation<3>::cell_iterator &/*cell*/,
-                        const unsigned int                     /*dofs_per_face*/,
-                        std::vector<double>                   &face_sign)
+  get_face_sign_change_rt (const Triangulation<3>::cell_iterator &cell,
+                           const unsigned int                      dofs_per_face,
+                           std::vector<double>                   &face_sign)
+  {
+    std::fill (face_sign.begin (), face_sign.end (), 1.0);
+//TODO: think about what it would take here
+  }
+
+  void
+  get_face_sign_change_nedelec (const Triangulation<1>::cell_iterator &,
+                                const unsigned int                     ,
+                                std::vector<double>                   &face_sign)
+  {
+    // nothing to do in 1d
+    std::fill (face_sign.begin (), face_sign.end (), 1.0);
+  }
+
+
+
+  void
+  get_face_sign_change_nedelec (const Triangulation<2>::cell_iterator &cell,
+                                const unsigned int                     dofs_per_face,
+                                std::vector<double>                   &face_sign)
   {
     std::fill (face_sign.begin (), face_sign.end (), 1.0);
 //TODO: think about what it would take here
   }
+
+
+  void
+  get_face_sign_change_nedelec (const Triangulation<3>::cell_iterator &cell,
+                                const unsigned int                      dofs_per_face,
+                                std::vector<double>                   &face_sign)
+  {
+    const unsigned int dim = 3;
+    std::fill (face_sign.begin (), face_sign.end (), 1.0);
+//TODO: This is probably only going to work for those elements for which all dofs are face dofs
+    for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
+      if (!(cell->line_orientation (l)))
+        face_sign[l] = -1.0;
+  }
 }
 
 
@@ -383,13 +421,18 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
   // Compute eventual sign changes depending on the neighborhood
   // between two faces.
   std::vector<double> sign_change (this->dofs_per_cell, 1.0);
-  get_face_sign_change (cell, this->dofs_per_face, sign_change);
 
+  if (mapping_type == mapping_raviart_thomas)
+    get_face_sign_change_rt (cell, this->dofs_per_face, sign_change);
+
+  else if (mapping_type == mapping_nedelec)
+    get_face_sign_change_nedelec (cell, this->dofs_per_face, sign_change);
   // for Piola mapping, the similarity
   // concept cannot be used because of
   // possible sign changes from one cell to
   // the next.
-  if ( (mapping_type == mapping_piola) || (mapping_type == mapping_raviart_thomas) )
+  if ( (mapping_type == mapping_piola) || (mapping_type == mapping_raviart_thomas)
+       || (mapping_type == mapping_nedelec))
     if (cell_similarity == CellSimilarity::translation)
       cell_similarity = CellSimilarity::none;
 
@@ -444,7 +487,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
 
             for (unsigned int k = 0; k < n_q_points; ++k)
               for (unsigned int d = 0; d < dim; ++d)
-                data.shape_values(first+d,k) = shape_values[k][d];
+                data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d];
 
             break;
           }
@@ -530,8 +573,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
 
               for (unsigned int k = 0; k < n_q_points; ++k)
                 for (unsigned int d = 0; d < dim; ++d)
-                  data.shape_gradients[first + d][k] = shape_grads1[k][d];
-              // then copy over to target:
+                  data.shape_gradients[first + d][k] = sign_change[i] * shape_grads1[k][d];
 
               break;
             }
@@ -591,7 +633,12 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
   // Compute eventual sign changes depending
   // on the neighborhood between two faces.
   std::vector<double> sign_change (this->dofs_per_cell, 1.0);
-  get_face_sign_change (cell, this->dofs_per_face, sign_change);
+
+  if (mapping_type == mapping_raviart_thomas)
+    get_face_sign_change_rt (cell, this->dofs_per_face, sign_change);
+
+  else if (mapping_type == mapping_nedelec)
+    get_face_sign_change_nedelec (cell, this->dofs_per_face, sign_change);
 
   for (unsigned int i=0; i<this->dofs_per_cell; ++i)
     {
@@ -646,7 +693,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
 
               for (unsigned int k = 0; k < n_q_points; ++k)
                 for (unsigned int d = 0; d < dim; ++d)
-                  data.shape_values(first+d,k) = shape_values[k][d];
+                  data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d];
 
               break;
             }
@@ -732,8 +779,8 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
 
               for (unsigned int k = 0; k < n_q_points; ++k)
                 for (unsigned int d = 0; d < dim; ++d)
-                  data.shape_gradients[first + d][k] = shape_grads1[k][d];
-              // then copy over to target:
+                  data.shape_gradients[first + d][k] = sign_change[i] * shape_grads1[k][d];
+
               break;
             }
 
@@ -795,7 +842,12 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
   // Compute eventual sign changes depending
   // on the neighborhood between two faces.
   std::vector<double> sign_change (this->dofs_per_cell, 1.0);
-  get_face_sign_change (cell, this->dofs_per_face, sign_change);
+
+  if (mapping_type == mapping_raviart_thomas)
+    get_face_sign_change_rt (cell, this->dofs_per_face, sign_change);
+
+  else if (mapping_type == mapping_nedelec)
+    get_face_sign_change_nedelec (cell, this->dofs_per_face, sign_change);
 
   for (unsigned int i=0; i<this->dofs_per_cell; ++i)
     {
@@ -849,7 +901,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
 
               for (unsigned int k = 0; k < n_q_points; ++k)
                 for (unsigned int d = 0; d < dim; ++d)
-                  data.shape_values(first+d,k) = shape_values[k][d];
+                  data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d];
 
               break;
             }
index 945f4670d7e278de991eb853b7e40f39302763aa..8e44bd29034ab39df12d5edef39b9ecf2bc48b31 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 5e281b948df7327a82bea07d7cfab9e8907af73a..207187093a20ec6cf9c4a420de07ebe3d0eb2ed5 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/fe/fe_q.h>
index 3f1dc3589336562c765b2222c80aa8f772186b96..8e9d1c735601d41401f0da48f482c1e8323376a8 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index 43d46d3dc93da1a4e2ea1858bb82447e393af973..77aab44e1a89b79b4d393428da2e96086c4888c2 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature.h>
 #include <deal.II/base/qprojector.h>
@@ -1007,7 +1011,7 @@ FE_Q_Base<POLY,dim,spacedim>::initialize_constraints (const std::vector<Point<1>
 
 
 template <class POLY, int dim, int spacedim>
-const FullMatrix<double>&
+const FullMatrix<double> &
 FE_Q_Base<POLY,dim,spacedim>
 ::get_prolongation_matrix (const unsigned int child,
                            const RefinementCase<dim> &refinement_case) const
@@ -1062,7 +1066,7 @@ FE_Q_Base<POLY,dim,spacedim>
       // almost negligible also for high order elements
       const unsigned int dofs1d = this->degree+1;
       std::vector<Table<2,double> >
-        subcell_evaluations (dim, Table<2,double>(dofs1d, dofs1d));
+      subcell_evaluations (dim, Table<2,double>(dofs1d, dofs1d));
       const std::vector<unsigned int> &index_map_inverse =
         this->poly_space.get_numbering_inverse();
 
@@ -1173,8 +1177,8 @@ FE_Q_Base<POLY,dim,spacedim>
 #endif
 
       // swap matrices
-      std::swap(const_cast<FullMatrix<double> &>
-                (this->prolongation[refinement_case-1][child]), prolongate);
+      prolongate.swap(const_cast<FullMatrix<double> &>
+                      (this->prolongation[refinement_case-1][child]));
     }
 
   // finally return the matrix
@@ -1184,7 +1188,7 @@ FE_Q_Base<POLY,dim,spacedim>
 
 
 template <class POLY, int dim, int spacedim>
-const FullMatrix<double>&
+const FullMatrix<double> &
 FE_Q_Base<POLY,dim,spacedim>
 ::get_restriction_matrix (const unsigned int child,
                           const RefinementCase<dim> &refinement_case) const
@@ -1305,9 +1309,8 @@ FE_Q_Base<POLY,dim,spacedim>
         }
 
       // swap matrices
-      std::swap(const_cast<FullMatrix<double> &>
-                (this->restriction[refinement_case-1][child]), restriction);
-
+      restriction.swap(const_cast<FullMatrix<double> &>
+                       (this->restriction[refinement_case-1][child]));
     }
 
   return this->restriction[refinement_case-1][child];
index 8d6c49215b81570957ab6081786e7db1be15af53..8a5488c4799211588b4ea937eb19fe8999fee689 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2013 by the deal.II authors
+// Copyright (C) 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index 058ddf954d20358af3ef59c7c3546e192fc5b70c..8ecc7df8656cbf6afbd5f34b8d08d57c709dafe0 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id: fe_q.cc 28798 2013-03-07 17:00:02Z maier $
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012, 2013 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature.h>
 #include <deal.II/base/qprojector.h>
@@ -260,7 +264,7 @@ get_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
                                 x_source_fe.dofs_per_cell));
 
   this->FE_Q_Base<TensorProductPolynomialsConst<dim>,dim,spacedim>::
-    get_interpolation_matrix(x_source_fe, interpolation_matrix);
+  get_interpolation_matrix(x_source_fe, interpolation_matrix);
 }
 
 
index 4f73f2c255177f5b4f3fe5d2886d7d80d9eadd66..5cb57c5386fa83055dc75b09763f901737224818 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id: fe_q.inst.in 25229 2012-03-09 18:34:59Z pauletti $
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index ceef17fdac10a8aed9cf1310c7a23fadde49966e..7185ee76b0fdfe8fa2eae658a73d875ace02a477 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/fe/fe_q_hierarchical.h>
 #include <deal.II/fe/fe_nothing.h>
index 0350400b9f8ebca3ccf2104e42e83dbbea2b0b80..b1431f7f7c3eb8b5b8c8aae13c3c4f660cb2c7f8 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 925e4c7c4507062bbf96569d1994f8940055c170..6aba97cfac8f7764f9ddda90e0fc0ff92de23d7f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/fe/fe_q_iso_q1.h>
@@ -29,7 +33,7 @@ FE_Q_iso_Q1<dim,spacedim>::FE_Q_iso_Q1 (const unsigned int subdivisions)
   :
   FE_Q_Base<TensorProductPolynomials<dim,Polynomials::PiecewisePolynomial<double> >, dim, spacedim> (
     TensorProductPolynomials<dim,Polynomials::PiecewisePolynomial<double> >
-      (Polynomials::generate_complete_Lagrange_basis_on_subdivisions(subdivisions, 1)),
+    (Polynomials::generate_complete_Lagrange_basis_on_subdivisions(subdivisions, 1)),
     FiniteElementData<dim>(this->get_dpo_vector(subdivisions),
                            1, subdivisions,
                            FiniteElementData<dim>::H1),
index 785a122589b830a6bc7473abaa98bf852cd13308..47f935af2801bf0fd6ab788aa29b79b3146c436f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2013 by the deal.II authors
+// Copyright (C) 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index d8304a4125ec994de6194f6e0de290cffbebf940..bf82030640bcf3f18c2936c3298e7ddc0d10da52 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/quadrature.h>
index 46eca9e9b1887eaee24c446e60a0617c01b21d97..b61955369eac43b798f2b05704c94f077049e789 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index f8dfcd8bbb6fec88ec1799a32eece9e066145b27..c6d6d37cf73deabd0ae3b45326ab0fed7a2198da 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/qprojector.h>
index 951a219fe483df03f48dfc373fd1cefdb58052ea..cd5757d9f373326827d6564324ccc493a769aaf9 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 5d12365cc95c98bb80efbccd81ca65cf442971f3..2f45064642d9fd443280e4f991af1864fedddb1f 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/quadrature.h>
@@ -591,7 +593,7 @@ FESystem<dim,spacedim>::get_interpolation_matrix (
 
 
 template <int dim, int spacedim>
-const FullMatrix<double>&
+const FullMatrix<double> &
 FESystem<dim,spacedim>
 ::get_restriction_matrix (const unsigned int child,
                           const RefinementCase<dim> &refinement_case) const
@@ -618,7 +620,7 @@ FESystem<dim,spacedim>
 
       // shortcut for accessing local restrictions further down
       std::vector<const FullMatrix<double> *>
-        base_matrices(this->n_base_elements());
+      base_matrices(this->n_base_elements());
 
       for (unsigned int i=0; i<this->n_base_elements(); ++i)
         {
@@ -658,19 +660,19 @@ FESystem<dim,spacedim>
 
                 // so get the common base element and the indices therein:
                 const unsigned int
-                  base = this->system_to_base_table[i].first.first;
+                base = this->system_to_base_table[i].first.first;
 
                 const unsigned int
-                  base_index_i = this->system_to_base_table[i].second,
-                  base_index_j = this->system_to_base_table[j].second;
+                base_index_i = this->system_to_base_table[i].second,
+                base_index_j = this->system_to_base_table[j].second;
 
                 // if we are sure that DoFs i and j may couple, then copy
                 // entries of the matrices:
                 restriction(i,j) = (*base_matrices[base])(base_index_i,base_index_j);
               }
 
-          std::swap(restriction, const_cast<FullMatrix<double> &>
-                    (this->restriction[refinement_case-1][child]));
+          restriction.swap(const_cast<FullMatrix<double> &>
+                           (this->restriction[refinement_case-1][child]));
         }
     }
 
@@ -680,7 +682,7 @@ FESystem<dim,spacedim>
 
 
 template <int dim, int spacedim>
-const FullMatrix<double>&
+const FullMatrix<double> &
 FESystem<dim,spacedim>
 ::get_prolongation_matrix (const unsigned int child,
                            const RefinementCase<dim> &refinement_case) const
@@ -704,7 +706,7 @@ FESystem<dim,spacedim>
 
       bool do_prolongation = true;
       std::vector<const FullMatrix<double> *>
-        base_matrices(this->n_base_elements());
+      base_matrices(this->n_base_elements());
       for (unsigned int i=0; i<this->n_base_elements(); ++i)
         {
           base_matrices[i] =
@@ -727,15 +729,15 @@ FESystem<dim,spacedim>
                     this->system_to_base_table[j].first)
                   continue;
                 const unsigned int
-                  base = this->system_to_base_table[i].first.first;
+                base = this->system_to_base_table[i].first.first;
 
                 const unsigned int
-                  base_index_i = this->system_to_base_table[i].second,
-                  base_index_j = this->system_to_base_table[j].second;
+                base_index_i = this->system_to_base_table[i].second,
+                base_index_j = this->system_to_base_table[j].second;
                 prolongate(i,j) = (*base_matrices[base])(base_index_i,base_index_j);
               }
-          std::swap(prolongate, const_cast<FullMatrix<double> &>
-                    (this->prolongation[refinement_case-1][child]));
+          prolongate.swap(const_cast<FullMatrix<double> &>
+                          (this->prolongation[refinement_case-1][child]));
         }
     }
 
@@ -2460,17 +2462,17 @@ FESystem<dim,spacedim>::multiply_dof_numbers (
     unsigned int index = 0;
     for (unsigned int index=0; index<fes.size(); ++index)
       if (multiplicities[index]>0)
-       {
-         total_conformity = fes[index]->conforming_space;
-         break;
-       }
+        {
+          total_conformity = fes[index]->conforming_space;
+          break;
+        }
 
     for (; index<fes.size(); ++index)
       if (multiplicities[index]>0)
-       total_conformity =
-         typename FiniteElementData<dim>::Conformity(total_conformity
-                                                     &
-                                                     fes[index]->conforming_space);
+        total_conformity =
+          typename FiniteElementData<dim>::Conformity(total_conformity
+                                                      &
+                                                      fes[index]->conforming_space);
   }
 
   std::vector<unsigned int> dpo;
@@ -2480,10 +2482,10 @@ FESystem<dim,spacedim>::multiply_dof_numbers (
   if (dim>2) dpo.push_back(multiplied_dofs_per_hex);
 
   return FiniteElementData<dim> (dpo,
-                                multiplied_n_components,
-                                degree,
-                                total_conformity,
-                                summed_multiplicities);
+                                 multiplied_n_components,
+                                 degree,
+                                 total_conformity,
+                                 summed_multiplicities);
 }
 
 
index 5e28b445d88cc6f5aa2a18589bf4dea99332fcd5..75934ade4170cfa341825fbfdff24630f88ccda5 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
index ccff1cf311068687be1bc59447afb148450e1c30..fe6be9fd8c2b0bdd6c0d62ebb23f5f3d987faf2c 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/qprojector.h>
@@ -362,8 +366,8 @@ namespace FETools
   template<int dim, int spacedim>
   void compute_block_renumbering (
     const FiniteElement<dim,spacedim> &element,
-    std::vector<unsigned int> &renumbering,
-    std::vector<unsigned int> &block_data,
+    std::vector<types::global_dof_index> &renumbering,
+    std::vector<types::global_dof_index> &block_data,
     bool return_start_indices)
   {
     Assert(renumbering.size() == element.dofs_per_cell,
@@ -373,7 +377,7 @@ namespace FETools
            ExcDimensionMismatch(block_data.size(),
                                 element.n_blocks()));
 
-    unsigned int k=0;
+    types::global_dof_index k=0;
     unsigned int i=0;
     for (unsigned int b=0; b<element.n_base_elements(); ++b)
       for (unsigned int m=0; m<element.element_multiplicity(b); ++m)
@@ -385,7 +389,7 @@ namespace FETools
         }
     Assert (i == element.n_blocks(), ExcInternalError());
 
-    std::vector<unsigned int> start_indices(block_data.size());
+    std::vector<types::global_dof_index> start_indices(block_data.size());
     k = 0;
     for (unsigned int i=0; i<block_data.size(); ++i)
       if (return_start_indices)
@@ -399,7 +403,7 @@ namespace FETools
 //TODO:[GK] This does not work for a single RT
     for (unsigned int i=0; i<element.dofs_per_cell; ++i)
       {
-        std::pair<unsigned int, unsigned int>
+        std::pair<unsigned int, types::global_dof_index>
         indices = element.system_to_block_index(i);
         renumbering[i] = start_indices[indices.first]
                          +indices.second;
@@ -1341,7 +1345,7 @@ namespace FETools
     typename DH2<dim,spacedim>::active_cell_iterator cell2 = dof2.begin_active(),
                                                      endc2 = dof2.end();
 
-    std::vector<unsigned int> dofs;
+    std::vector<types::global_dof_index> dofs;
     dofs.reserve (DoFTools::max_dofs_per_cell (dof2));
 
     u2 = 0;
@@ -1435,7 +1439,7 @@ namespace FETools
     // for parallel vectors check,
     // if this component is owned by
     // this processor.
-    for (unsigned int i=0; i<dof2.n_dofs(); ++i)
+    for (types::global_dof_index i=0; i<dof2.n_dofs(); ++i)
       if (locally_owned_dofs.is_element(i))
         {
           Assert(touch_count(i)!=0, ExcInternalError());
@@ -1690,10 +1694,10 @@ namespace FETools
         DoFTools::extract_locally_relevant_dofs (dof2,
                                                  dof2_locally_relevant_dofs);
 
-        parallel::distributed::Vector<Number> 
-          u2 (dof2_locally_owned_dofs,
-              dof2_locally_relevant_dofs,
-              u1.get_mpi_communicator());
+        parallel::distributed::Vector<Number>
+        u2 (dof2_locally_owned_dofs,
+            dof2_locally_relevant_dofs,
+            u1.get_mpi_communicator());
 
         interpolate(dof1, u1, dof2, constraints2, u2);
         u2.update_ghost_values ();
@@ -1859,7 +1863,7 @@ namespace FETools
 
     Vector<double> u1_local(n1);
     Vector<double> u2_local(n2);
-    std::vector<unsigned int> dofs(n2);
+    std::vector<types::global_dof_index> dofs(n2);
 
     FullMatrix<double> matrix(n2,n1);
     get_projection_matrix(dof1.get_fe(), dof2.get_fe(), matrix);
index 22ee6025b016be0a5082706e7a2b830182acbf04..081a3274851ccf2dae74a559afde59c4c52338ca 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS; Vector : SERIAL_VECTORS)
@@ -39,7 +43,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
       template
        void compute_block_renumbering (
          const FiniteElement<deal_II_dimension,deal_II_space_dimension>& ,
-         std::vector<unsigned int>&, std::vector<unsigned int>&, bool);
+         std::vector<types::global_dof_index>&, std::vector<types::global_dof_index>&, bool);
 
       template
        void compute_projection_matrices<deal_II_dimension, double, deal_II_space_dimension>
index 44769ce659aaaa380ac7f3168deecc512a58c776..0602d5fd09a3a076ebc6cdb71c99a8aa0925bde4 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998-2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/quadrature.h>
@@ -40,7 +42,7 @@ namespace
   template <class VectorType>
   double
   get_vector_element (const VectorType &vector,
-                      const unsigned int cell_number)
+                      const types::global_dof_index cell_number)
   {
     return vector[cell_number];
   }
@@ -48,7 +50,7 @@ namespace
 
   double
   get_vector_element (const IndexSet &is,
-                      const unsigned int cell_number)
+                      const types::global_dof_index cell_number)
   {
     return (is.is_element(cell_number) ? 1 : 0);
   }
@@ -342,6 +344,104 @@ namespace FEValuesViews
   }
 
 
+  template <int dim, int spacedim>
+  Tensor<2, dim, spacedim>::
+  Tensor(const FEValuesBase<dim, spacedim> &fe_values,
+         const unsigned int first_tensor_component)
+    :
+    fe_values(fe_values),
+    first_tensor_component(first_tensor_component),
+    shape_function_data(fe_values.fe->dofs_per_cell)
+  {
+    Assert(first_tensor_component + dim*dim - 1
+           <
+           fe_values.fe->n_components(),
+           ExcIndexRange(first_tensor_component +
+                         dim*dim - 1,
+                         0,
+                         fe_values.fe->n_components()));
+//TODO: we'd like to use the fields with the same name as these
+// variables from FEValuesData, but they aren't initialized yet
+// at the time we get here, so re-create it all
+    const std::vector<unsigned int> shape_function_to_row_table
+      = make_shape_function_to_row_table (*fe_values.fe);
+
+    for (unsigned int d = 0; d < dim*dim; ++d)
+      {
+        const unsigned int component = first_tensor_component + d;
+
+        for (unsigned int i = 0; i < fe_values.fe->dofs_per_cell; ++i)
+          {
+            const bool is_primitive = (fe_values.fe->is_primitive() ||
+                                       fe_values.fe->is_primitive(i));
+
+            if (is_primitive == true)
+              shape_function_data[i].is_nonzero_shape_function_component[d]
+                = (component ==
+                   fe_values.fe->system_to_component_index(i).first);
+            else
+              shape_function_data[i].is_nonzero_shape_function_component[d]
+                = (fe_values.fe->get_nonzero_components(i)[component]
+                   == true);
+
+            if (shape_function_data[i].is_nonzero_shape_function_component[d]
+                == true)
+              shape_function_data[i].row_index[d]
+                = shape_function_to_row_table[i*fe_values.fe->n_components()+component];
+            else
+              shape_function_data[i].row_index[d]
+                = numbers::invalid_unsigned_int;
+          }
+      }
+
+    for (unsigned int i = 0; i < fe_values.fe->dofs_per_cell; ++i)
+      {
+        unsigned int n_nonzero_components = 0;
+        for (unsigned int d = 0; d < dim*dim; ++d)
+          if (shape_function_data[i].is_nonzero_shape_function_component[d]
+              == true)
+            ++n_nonzero_components;
+
+        if (n_nonzero_components == 0)
+          shape_function_data[i].single_nonzero_component = -2;
+        else if (n_nonzero_components > 1)
+          shape_function_data[i].single_nonzero_component = -1;
+        else
+          {
+            for (unsigned int d = 0; d < dim*dim; ++d)
+              if (shape_function_data[i].is_nonzero_shape_function_component[d]
+                  == true)
+                {
+                  shape_function_data[i].single_nonzero_component
+                    = shape_function_data[i].row_index[d];
+                  shape_function_data[i].single_nonzero_component_index
+                    = d;
+                  break;
+                }
+          }
+      }
+  }
+
+
+
+  template <int dim, int spacedim>
+  Tensor<2, dim, spacedim>::Tensor()
+    :
+    fe_values(*static_cast<dealii::FEValuesBase<dim, spacedim>*> (0)),
+    first_tensor_component(numbers::invalid_unsigned_int)
+  {}
+
+
+
+  template <int dim, int spacedim>
+  Tensor<2, dim, spacedim> &
+  Tensor<2, dim, spacedim>::operator=(const Tensor<2, dim, spacedim> &)
+  {
+    // we shouldn't be copying these objects
+    Assert(false, ExcInternalError());
+    return *this;
+  }
+
 
   namespace internal
   {
@@ -380,7 +480,7 @@ namespace FEValuesViews
             const double *shape_value_ptr =
               &shape_values(shape_function_data[shape_function].row_index, 0);
             for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-              values[q_point] += value * *shape_value_ptr++;
+              values[q_point] += value **shape_value_ptr++;
           }
     }
 
@@ -391,9 +491,9 @@ namespace FEValuesViews
     template <int order, int dim, int spacedim>
     void
     do_function_derivatives (const ::dealii::Vector<double> &dof_values,
-                             const std::vector<std::vector<Tensor<order,spacedim> > > &shape_derivatives,
+                             const std::vector<std::vector<dealii::Tensor<order,spacedim> > > &shape_derivatives,
                              const std::vector<typename Scalar<dim,spacedim>::ShapeFunctionData> &shape_function_data,
-                             std::vector<Tensor<order,spacedim> > &derivatives)
+                             std::vector<dealii::Tensor<order,spacedim> > &derivatives)
     {
       const unsigned int dofs_per_cell = dof_values.size();
       const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
@@ -401,7 +501,7 @@ namespace FEValuesViews
       AssertDimension (derivatives.size(), n_quadrature_points);
 
       std::fill (derivatives.begin(), derivatives.end(),
-                 Tensor<order,spacedim>());
+                 dealii::Tensor<order,spacedim>());
 
       for (unsigned int shape_function=0;
            shape_function<dofs_per_cell; ++shape_function)
@@ -411,10 +511,10 @@ namespace FEValuesViews
             if (value == 0.)
               continue;
 
-            const Tensor<order,spacedim> *shape_derivative_ptr =
+            const dealii::Tensor<order,spacedim> *shape_derivative_ptr =
               &shape_derivatives[shape_function_data[shape_function].row_index][0];
             for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-              derivatives[q_point] += value * *shape_derivative_ptr++;
+              derivatives[q_point] += value **shape_derivative_ptr++;
           }
     }
 
@@ -423,7 +523,7 @@ namespace FEValuesViews
     template <int dim, int spacedim>
     void
     do_function_laplacians (const ::dealii::Vector<double> &dof_values,
-                            const std::vector<std::vector<Tensor<2,spacedim> > > &shape_hessians,
+                            const std::vector<std::vector<dealii::Tensor<2,spacedim> > > &shape_hessians,
                             const std::vector<typename Scalar<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                             std::vector<double>           &laplacians)
     {
@@ -442,7 +542,7 @@ namespace FEValuesViews
             if (value == 0.)
               continue;
 
-            const Tensor<2,spacedim> *shape_hessian_ptr =
+            const dealii::Tensor<2,spacedim> *shape_hessian_ptr =
               &shape_hessians[shape_function_data[shape_function].row_index][0];
             for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
               laplacians[q_point] += value * trace(*shape_hessian_ptr++);
@@ -457,14 +557,14 @@ namespace FEValuesViews
     void do_function_values (const ::dealii::Vector<double> &dof_values,
                              const Table<2,double>          &shape_values,
                              const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
-                             std::vector<Tensor<1,spacedim> > &values)
+                             std::vector<dealii::Tensor<1,spacedim> > &values)
     {
       const unsigned int dofs_per_cell = dof_values.size();
       const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
                                                shape_values.n_cols() : values.size();
       AssertDimension (values.size(), n_quadrature_points);
 
-      std::fill (values.begin(), values.end(), Tensor<1,spacedim>());
+      std::fill (values.begin(), values.end(), dealii::Tensor<1,spacedim>());
 
       for (unsigned int shape_function=0;
            shape_function<dofs_per_cell; ++shape_function)
@@ -485,7 +585,7 @@ namespace FEValuesViews
                 shape_function_data[shape_function].single_nonzero_component_index;
               const double *shape_value_ptr = &shape_values(snc,0);
               for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-                values[q_point][comp] += value * *shape_value_ptr++;
+                values[q_point][comp] += value **shape_value_ptr++;
             }
           else
             for (unsigned int d=0; d<spacedim; ++d)
@@ -494,7 +594,7 @@ namespace FEValuesViews
                   const double *shape_value_ptr =
                     &shape_values(shape_function_data[shape_function].row_index[d],0);
                   for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-                    values[q_point][d] += value * *shape_value_ptr++;
+                    values[q_point][d] += value **shape_value_ptr++;
                 }
         }
     }
@@ -504,9 +604,9 @@ namespace FEValuesViews
     template <int order, int dim, int spacedim>
     void
     do_function_derivatives (const ::dealii::Vector<double> &dof_values,
-                             const std::vector<std::vector<Tensor<order,spacedim> > > &shape_derivatives,
+                             const std::vector<std::vector<dealii::Tensor<order,spacedim> > > &shape_derivatives,
                              const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
-                             std::vector<Tensor<order+1,spacedim> > &derivatives)
+                             std::vector<dealii::Tensor<order+1,spacedim> > &derivatives)
     {
       const unsigned int dofs_per_cell = dof_values.size();
       const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
@@ -514,7 +614,7 @@ namespace FEValuesViews
       AssertDimension (derivatives.size(), n_quadrature_points);
 
       std::fill (derivatives.begin(), derivatives.end(),
-                 Tensor<order+1,spacedim>());
+                 dealii::Tensor<order+1,spacedim>());
 
       for (unsigned int shape_function=0;
            shape_function<dofs_per_cell; ++shape_function)
@@ -533,20 +633,20 @@ namespace FEValuesViews
             {
               const unsigned int comp =
                 shape_function_data[shape_function].single_nonzero_component_index;
-              const Tensor<order,spacedim> *shape_derivative_ptr =
+              const dealii::Tensor<order,spacedim> *shape_derivative_ptr =
                 &shape_derivatives[snc][0];
               for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-                derivatives[q_point][comp] += value * *shape_derivative_ptr++;
+                derivatives[q_point][comp] += value **shape_derivative_ptr++;
             }
           else
             for (unsigned int d=0; d<spacedim; ++d)
               if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
                 {
-                  const Tensor<order,spacedim> *shape_derivative_ptr =
+                  const dealii::Tensor<order,spacedim> *shape_derivative_ptr =
                     &shape_derivatives[shape_function_data[shape_function].
                                        row_index[d]][0];
                   for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-                    derivatives[q_point][d] += value * *shape_derivative_ptr++;
+                    derivatives[q_point][d] += value **shape_derivative_ptr++;
                 }
         }
     }
@@ -556,7 +656,7 @@ namespace FEValuesViews
     template <int dim, int spacedim>
     void
     do_function_symmetric_gradients (const ::dealii::Vector<double> &dof_values,
-                                     const std::vector<std::vector<Tensor<1,spacedim> > > &shape_gradients,
+                                     const std::vector<std::vector<dealii::Tensor<1,spacedim> > > &shape_gradients,
                                      const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                                      std::vector<dealii::SymmetricTensor<2,spacedim> > &symmetric_gradients)
     {
@@ -585,7 +685,7 @@ namespace FEValuesViews
             {
               const unsigned int comp =
                 shape_function_data[shape_function].single_nonzero_component_index;
-              const Tensor<1,spacedim> *shape_gradient_ptr =
+              const dealii::Tensor<1,spacedim> *shape_gradient_ptr =
                 &shape_gradients[snc][0];
               for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
                 symmetric_gradients[q_point] += value *
@@ -594,7 +694,7 @@ namespace FEValuesViews
           else
             for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
               {
-                Tensor<2,spacedim> grad;
+                dealii::Tensor<2,spacedim> grad;
                 for (unsigned int d=0; d<spacedim; ++d)
                   if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
                     grad[d] = value *
@@ -609,7 +709,7 @@ namespace FEValuesViews
     template <int dim, int spacedim>
     void
     do_function_divergences (const ::dealii::Vector<double> &dof_values,
-                             const std::vector<std::vector<Tensor<1,spacedim> > > &shape_gradients,
+                             const std::vector<std::vector<dealii::Tensor<1,spacedim> > > &shape_gradients,
                              const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                              std::vector<double> &divergences)
     {
@@ -637,7 +737,7 @@ namespace FEValuesViews
             {
               const unsigned int comp =
                 shape_function_data[shape_function].single_nonzero_component_index;
-              const Tensor<1,spacedim> *shape_gradient_ptr = &shape_gradients[snc][0];
+              const dealii::Tensor<1,spacedim> *shape_gradient_ptr = &shape_gradients[snc][0];
               for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
                 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
             }
@@ -645,7 +745,7 @@ namespace FEValuesViews
             for (unsigned int d=0; d<spacedim; ++d)
               if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
                 {
-                  const Tensor<1,spacedim> *shape_gradient_ptr =
+                  const dealii::Tensor<1,spacedim> *shape_gradient_ptr =
                     &shape_gradients[shape_function_data[shape_function].
                                      row_index[d]][0];
                   for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
@@ -659,7 +759,7 @@ namespace FEValuesViews
     template <int dim, int spacedim>
     void
     do_function_curls (const ::dealii::Vector<double> &dof_values,
-                       const std::vector<std::vector<Tensor<1,spacedim> > > &shape_gradients,
+                       const std::vector<std::vector<dealii::Tensor<1,spacedim> > > &shape_gradients,
                        const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                        std::vector<typename dealii::internal::CurlType<spacedim>::type> &curls)
     {
@@ -696,7 +796,7 @@ namespace FEValuesViews
 
               if (snc != -1)
                 {
-                  const Tensor<1, spacedim> *shape_gradient_ptr =
+                  const dealii::Tensor<1, spacedim> *shape_gradient_ptr =
                     &shape_gradients[snc][0];
 
                   switch (shape_function_data[shape_function].single_nonzero_component_index)
@@ -720,7 +820,7 @@ namespace FEValuesViews
                 {
                   if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
                     {
-                      const Tensor<1,spacedim> *shape_gradient_ptr =
+                      const dealii::Tensor<1,spacedim> *shape_gradient_ptr =
                         &shape_gradients[shape_function_data[shape_function].row_index[0]][0];
 
                       for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
@@ -729,7 +829,7 @@ namespace FEValuesViews
 
                   if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
                     {
-                      const Tensor<1,spacedim> *shape_gradient_ptr =
+                      const dealii::Tensor<1,spacedim> *shape_gradient_ptr =
                         &shape_gradients[shape_function_data[shape_function].row_index[1]][0];
 
                       for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
@@ -758,7 +858,7 @@ namespace FEValuesViews
 
               if (snc != -1)
                 {
-                  const Tensor<1, spacedim> *shape_gradient_ptr = &shape_gradients[snc][0];
+                  const dealii::Tensor<1, spacedim> *shape_gradient_ptr = &shape_gradients[snc][0];
 
                   switch (shape_function_data[shape_function].single_nonzero_component_index)
                     {
@@ -800,7 +900,7 @@ namespace FEValuesViews
                 {
                   if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
                     {
-                      const Tensor<1,spacedim> *shape_gradient_ptr =
+                      const dealii::Tensor<1,spacedim> *shape_gradient_ptr =
                         &shape_gradients[shape_function_data[shape_function].row_index[0]][0];
 
                       for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
@@ -812,7 +912,7 @@ namespace FEValuesViews
 
                   if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
                     {
-                      const Tensor<1,spacedim> *shape_gradient_ptr =
+                      const dealii::Tensor<1,spacedim> *shape_gradient_ptr =
                         &shape_gradients[shape_function_data[shape_function].row_index[1]][0];
 
                       for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
@@ -824,7 +924,7 @@ namespace FEValuesViews
 
                   if (shape_function_data[shape_function].is_nonzero_shape_function_component[2])
                     {
-                      const Tensor<1,spacedim> *shape_gradient_ptr =
+                      const dealii::Tensor<1,spacedim> *shape_gradient_ptr =
                         &shape_gradients[shape_function_data[shape_function].row_index[2]][0];
 
                       for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
@@ -844,16 +944,17 @@ namespace FEValuesViews
     template <int dim, int spacedim>
     void
     do_function_laplacians (const ::dealii::Vector<double> &dof_values,
-                            const std::vector<std::vector<Tensor<2,spacedim> > > &shape_hessians,
+                            const std::vector<std::vector<dealii::Tensor<2,spacedim> > > &shape_hessians,
                             const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
-                            std::vector<Tensor<1,spacedim> > &laplacians)
+                            std::vector<dealii::Tensor<1,spacedim> > &laplacians)
     {
       const unsigned int dofs_per_cell = dof_values.size();
       const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
                                                shape_hessians[0].size() : laplacians.size();
       AssertDimension (laplacians.size(), n_quadrature_points);
 
-      std::fill (laplacians.begin(), laplacians.end(), Tensor<1,spacedim>());
+      std::fill (laplacians.begin(), laplacians.end(),
+                 dealii::Tensor<1,spacedim>());
 
       for (unsigned int shape_function=0;
            shape_function<dofs_per_cell; ++shape_function)
@@ -873,7 +974,7 @@ namespace FEValuesViews
               {
                 const unsigned int comp =
                   shape_function_data[shape_function].single_nonzero_component_index;
-                const Tensor<2,spacedim> *shape_hessian_ptr =
+                const dealii::Tensor<2,spacedim> *shape_hessian_ptr =
                   &shape_hessians[snc][0];
                 for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
                   laplacians[q_point][comp] += value * trace(*shape_hessian_ptr++);
@@ -882,7 +983,7 @@ namespace FEValuesViews
               for (unsigned int d=0; d<spacedim; ++d)
                 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
                   {
-                    const Tensor<2,spacedim> *shape_hessian_ptr =
+                    const dealii::Tensor<2,spacedim> *shape_hessian_ptr =
                       &shape_hessians[shape_function_data[shape_function].
                                       row_index[d]][0];
                     for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
@@ -930,7 +1031,7 @@ namespace FEValuesViews
                 (shape_function_data[shape_function].single_nonzero_component_index);
               const double *shape_value_ptr = &shape_values(snc,0);
               for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-                values[q_point][comp] += value * *shape_value_ptr++;
+                values[q_point][comp] += value **shape_value_ptr++;
             }
           else
             for (unsigned int d=0;
@@ -942,7 +1043,7 @@ namespace FEValuesViews
                   const double *shape_value_ptr =
                     &shape_values(shape_function_data[shape_function].row_index[d],0);
                   for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-                    values[q_point][comp] += value * *shape_value_ptr++;
+                    values[q_point][comp] += value **shape_value_ptr++;
                 }
         }
     }
@@ -952,16 +1053,17 @@ namespace FEValuesViews
     template <int dim, int spacedim>
     void
     do_function_divergences (const ::dealii::Vector<double> &dof_values,
-                             const std::vector<std::vector<Tensor<1,spacedim> > > &shape_gradients,
+                             const std::vector<std::vector<dealii::Tensor<1,spacedim> > > &shape_gradients,
                              const std::vector<typename SymmetricTensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
-                             std::vector<Tensor<1,spacedim> > &divergences)
+                             std::vector<dealii::Tensor<1,spacedim> > &divergences)
     {
       const unsigned int dofs_per_cell = dof_values.size();
       const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
                                                shape_gradients[0].size() : divergences.size();
       AssertDimension (divergences.size(), n_quadrature_points);
 
-      std::fill (divergences.begin(), divergences.end(), Tensor<1,spacedim>());
+      std::fill (divergences.begin(), divergences.end(),
+                 dealii::Tensor<1,spacedim>());
 
       for (unsigned int shape_function=0;
            shape_function<dofs_per_cell; ++shape_function)
@@ -981,7 +1083,7 @@ namespace FEValuesViews
               const unsigned int comp =
                 shape_function_data[shape_function].single_nonzero_component_index;
 
-              const Tensor < 1, spacedim> *shape_gradient_ptr =
+              const dealii::Tensor < 1, spacedim> *shape_gradient_ptr =
                 &shape_gradients[snc][0];
 
               const unsigned int ii = dealii::SymmetricTensor<2,spacedim>::
@@ -1017,7 +1119,7 @@ namespace FEValuesViews
                     const unsigned int comp =
                       shape_function_data[shape_function].single_nonzero_component_index;
 
-                    const Tensor < 1, spacedim> *shape_gradient_ptr =
+                    const dealii::Tensor < 1, spacedim> *shape_gradient_ptr =
                       &shape_gradients[shape_function_data[shape_function].
                                        row_index[d]][0];
                     for (unsigned int q_point = 0; q_point < n_quadrature_points;
@@ -1034,6 +1136,122 @@ namespace FEValuesViews
         }
     }
 
+    // ---------------------- non-symmetric tensor part ------------------------
+
+    template <int dim, int spacedim>
+    void
+    do_function_values (const ::dealii::Vector<double> &dof_values,
+                        const Table<2,double>          &shape_values,
+                        const std::vector<typename Tensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
+                        std::vector<dealii::Tensor<2,spacedim> > &values)
+    {
+      const unsigned int dofs_per_cell = dof_values.size();
+      const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
+                                               shape_values.n_cols() : values.size();
+      AssertDimension (values.size(), n_quadrature_points);
+
+      std::fill (values.begin(), values.end(),
+                 dealii::Tensor<2,spacedim>());
+
+      for (unsigned int shape_function=0;
+           shape_function<dofs_per_cell; ++shape_function)
+        {
+          const int snc = shape_function_data[shape_function].single_nonzero_component;
+
+          if (snc == -2)
+            // shape function is zero for the selected components
+            continue;
+
+          const double value = dof_values(shape_function);
+          if (value == 0.)
+            continue;
+
+          if (snc != -1)
+            {
+              const unsigned int comp =
+                shape_function_data[shape_function].single_nonzero_component_index;
+
+              const TableIndices<2> indices = dealii::Tensor<2,spacedim>::unrolled_to_component_indices(comp);
+
+              const double *shape_value_ptr = &shape_values(snc,0);
+              for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
+                values[q_point][indices] += value **shape_value_ptr++;
+            }
+          else
+            for (unsigned int d=0;
+                 d<dim*dim; ++d)
+              if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
+                {
+                  const TableIndices<2> indices = dealii::Tensor<2,spacedim>::unrolled_to_component_indices(d);
+
+                  const double *shape_value_ptr =
+                    &shape_values(shape_function_data[shape_function].row_index[d],0);
+                  for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
+                    values[q_point][indices] += value **shape_value_ptr++;
+                }
+        }
+    }
+
+
+
+    template <int dim, int spacedim>
+    void
+    do_function_divergences (const ::dealii::Vector<double> &dof_values,
+                             const std::vector<std::vector<dealii::Tensor<1,spacedim> > > &shape_gradients,
+                             const std::vector<typename Tensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
+                             std::vector<dealii::Tensor<1,spacedim> > &divergences)
+    {
+      const unsigned int dofs_per_cell = dof_values.size();
+      const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
+                                               shape_gradients[0].size() : divergences.size();
+      AssertDimension (divergences.size(), n_quadrature_points);
+
+      std::fill (divergences.begin(), divergences.end(),
+                 dealii::Tensor<1,spacedim>());
+
+      for (unsigned int shape_function=0;
+           shape_function<dofs_per_cell; ++shape_function)
+        {
+          const int snc = shape_function_data[shape_function].single_nonzero_component;
+
+          if (snc == -2)
+            // shape function is zero for the selected components
+            continue;
+
+          const double value = dof_values(shape_function);
+          if (value == 0.)
+            continue;
+
+          if (snc != -1)
+            {
+              const unsigned int comp =
+                shape_function_data[shape_function].single_nonzero_component_index;
+
+              const dealii::Tensor < 1, spacedim> *shape_gradient_ptr =
+                &shape_gradients[snc][0];
+
+              const TableIndices<2> indices = dealii::Tensor<2,spacedim>::unrolled_to_component_indices(comp);
+              const unsigned int ii = indices[0];
+              const unsigned int jj = indices[1];
+
+              for (unsigned int q_point = 0; q_point < n_quadrature_points;
+                   ++q_point, ++shape_gradient_ptr)
+                {
+                  divergences[q_point][jj] += value * (*shape_gradient_ptr)[ii];
+                }
+            }
+          else
+            {
+              for (unsigned int d = 0;
+                   d < dim*dim; ++d)
+                if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
+                  {
+                    Assert (false, ExcNotImplemented());
+                  }
+            }
+        }
+    }
+
   } // end of namespace internal
 
 
@@ -1352,6 +1570,53 @@ namespace FEValuesViews
     internal::do_function_divergences<dim,spacedim>
     (dof_values, fe_values.shape_gradients, shape_function_data, divergences);
   }
+
+  template <int dim, int spacedim>
+  template <class InputVector>
+  void
+  Tensor<2, dim, spacedim>::
+  get_function_values(const InputVector &fe_function,
+                      std::vector<value_type> &values) const
+  {
+    typedef FEValuesBase<dim, spacedim> FVB;
+    Assert(fe_values.update_flags & update_values,
+           typename FVB::ExcAccessToUninitializedField());
+    Assert(fe_values.present_cell.get() != 0,
+           ExcMessage("FEValues object is not reinit'ed to any cell"));
+    AssertDimension(fe_function.size(),
+                    fe_values.present_cell->n_dofs_for_dof_handler());
+
+    // get function values of dofs on this cell
+    dealii::Vector<double> dof_values(fe_values.dofs_per_cell);
+    fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+    internal::do_function_values<dim,spacedim>
+    (dof_values, fe_values.shape_values, shape_function_data, values);
+  }
+
+
+
+  template <int dim, int spacedim>
+  template <class InputVector>
+  void
+  Tensor<2, dim, spacedim>::
+  get_function_divergences(const InputVector &fe_function,
+                           std::vector<divergence_type> &divergences) const
+  {
+    typedef FEValuesBase<dim, spacedim> FVB;
+    Assert(fe_values.update_flags & update_gradients,
+           typename FVB::ExcAccessToUninitializedField());
+    Assert(fe_values.present_cell.get() != 0,
+           ExcMessage("FEValues object is not reinit'ed to any cell"));
+    AssertDimension(fe_function.size(),
+                    fe_values.present_cell->n_dofs_for_dof_handler());
+
+    // get function values of dofs
+    // on this cell
+    dealii::Vector<double> dof_values(fe_values.dofs_per_cell);
+    fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
+    internal::do_function_divergences<dim,spacedim>
+    (dof_values, fe_values.shape_gradients, shape_function_data, divergences);
+  }
 }
 
 
@@ -1431,6 +1696,28 @@ namespace internal
           dealii::FEValuesViews::SymmetricTensor<2, dim, spacedim > (fe_values,
                                                                      component);
         }
+
+
+      // compute number of symmetric
+      // tensors in the same way as above
+      const unsigned int n_second_order_tensors
+        = (fe.n_components() >= dim*dim ?
+           fe.n_components() - dim*dim + 1 :
+           0);
+      second_order_tensors.resize(n_second_order_tensors);
+      for (unsigned int component = 0; component < n_second_order_tensors; ++component)
+        {
+#ifndef DEAL_II_EXPLICIT_DESTRUCTOR_BUG
+          second_order_tensors[component]
+          .dealii::FEValuesViews::Tensor<2, dim, spacedim>::~Tensor();
+#else
+          typedef dealii::FEValuesViews::Tensor<2, dim, spacedim> TensorView;
+          second_order_tensors[component].TensorView::~TensorView();
+#endif
+          new (&second_order_tensors[component])
+          dealii::FEValuesViews::Tensor<2, dim, spacedim > (fe_values,
+                                                            component);
+        }
     }
   }
 }
@@ -1474,7 +1761,7 @@ public:
    * to.
    */
   virtual
-  unsigned int
+  types::global_dof_index
   n_dofs_for_dof_handler () const = 0;
 
 #include "fe_values.decl.1.inst"
@@ -1543,7 +1830,7 @@ public:
    * to.
    */
   virtual
-  unsigned int
+  types::global_dof_index
   n_dofs_for_dof_handler () const;
 
 #include "fe_values.decl.2.inst"
@@ -1646,7 +1933,7 @@ public:
    * error.
    */
   virtual
-  unsigned int
+  types::global_dof_index
   n_dofs_for_dof_handler () const;
 
 #include "fe_values.decl.2.inst"
@@ -1706,7 +1993,7 @@ operator typename Triangulation<dim,spacedim>::cell_iterator () const
 
 template <int dim, int spacedim>
 template <typename CI>
-unsigned int
+types::global_dof_index
 FEValuesBase<dim,spacedim>::CellIterator<CI>::n_dofs_for_dof_handler () const
 {
   return cell->get_dof_handler().n_dofs();
@@ -1726,7 +2013,7 @@ get_interpolated_dof_values (const IndexSet &in,
 {
   Assert (cell->has_children() == false, ExcNotImplemented());
 
-  std::vector<unsigned int> dof_indices (cell->get_fe().dofs_per_cell);
+  std::vector<types::global_dof_index> dof_indices (cell->get_fe().dofs_per_cell);
   cell->get_dof_indices (dof_indices);
 
   for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
@@ -1767,7 +2054,7 @@ operator typename Triangulation<dim,spacedim>::cell_iterator () const
 
 
 template <int dim, int spacedim>
-unsigned int
+types::global_dof_index
 FEValuesBase<dim,spacedim>::TriaCellIterator::n_dofs_for_dof_handler () const
 {
   Assert (false, ExcMessage (message_string));
@@ -1950,7 +2237,7 @@ namespace internal
 
         const double *shape_value_ptr = &shape_values(shape_func, 0);
         for (unsigned int point=0; point<n_quadrature_points; ++point)
-          values[point] += value * *shape_value_ptr++;
+          values[point] += value **shape_value_ptr++;
       }
   }
 
@@ -2013,11 +2300,11 @@ namespace internal
                 {
                   VectorType &values_comp = values[comp];
                   for (unsigned int point=0; point<n_quadrature_points; ++point)
-                    values_comp[point] += value * *shape_value_ptr++;
+                    values_comp[point] += value **shape_value_ptr++;
                 }
               else
                 for (unsigned int point=0; point<n_quadrature_points; ++point)
-                  values[point][comp] += value * *shape_value_ptr++;
+                  values[point][comp] += value **shape_value_ptr++;
             }
           else
             for (unsigned int c=0; c<n_components; ++c)
@@ -2036,11 +2323,11 @@ namespace internal
                     VectorType &values_comp = values[comp];
                     for (unsigned int point=0; point<n_quadrature_points;
                          ++point)
-                      values_comp[point] += value * *shape_value_ptr++;
+                      values_comp[point] += value **shape_value_ptr++;
                   }
                 else
                   for (unsigned int point=0; point<n_quadrature_points; ++point)
-                    values[point][comp] += value * *shape_value_ptr++;
+                    values[point][comp] += value **shape_value_ptr++;
               }
         }
   }
@@ -2077,7 +2364,7 @@ namespace internal
         const Tensor<order,spacedim> *shape_derivative_ptr
           = &shape_derivatives[shape_func][0];
         for (unsigned int point=0; point<n_quadrature_points; ++point)
-          derivatives[point] += value * *shape_derivative_ptr++;
+          derivatives[point] += value **shape_derivative_ptr++;
       }
   }
 
@@ -2139,10 +2426,10 @@ namespace internal
 
               if (quadrature_points_fastest)
                 for (unsigned int point=0; point<n_quadrature_points; ++point)
-                  derivatives[comp][point] += value * *shape_derivative_ptr++;
+                  derivatives[comp][point] += value **shape_derivative_ptr++;
               else
                 for (unsigned int point=0; point<n_quadrature_points; ++point)
-                  derivatives[point][comp] += value * *shape_derivative_ptr++;
+                  derivatives[point][comp] += value **shape_derivative_ptr++;
             }
           else
             for (unsigned int c=0; c<n_components; ++c)
@@ -2159,10 +2446,10 @@ namespace internal
 
                 if (quadrature_points_fastest)
                   for (unsigned int point=0; point<n_quadrature_points; ++point)
-                    derivatives[comp][point] += value * *shape_derivative_ptr++;
+                    derivatives[comp][point] += value **shape_derivative_ptr++;
                 else
                   for (unsigned int point=0; point<n_quadrature_points; ++point)
-                    derivatives[point][comp] += value * *shape_derivative_ptr++;
+                    derivatives[point][comp] += value **shape_derivative_ptr++;
               }
         }
   }
@@ -2318,7 +2605,7 @@ template <int dim, int spacedim>
 template <class InputVector, typename number>
 void FEValuesBase<dim,spacedim>::get_function_values (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<number> &values) const
 {
   Assert (this->update_flags & update_values, ExcAccessToUninitializedField());
@@ -2371,7 +2658,7 @@ template <int dim, int spacedim>
 template <class InputVector, typename number>
 void FEValuesBase<dim,spacedim>::get_function_values (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<Vector<number> > &values) const
 {
   // Size of indices must be a multiple of dofs_per_cell such that an integer
@@ -2407,7 +2694,7 @@ template <int dim, int spacedim>
 template <class InputVector>
 void FEValuesBase<dim,spacedim>::get_function_values (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   VectorSlice<std::vector<std::vector<double> > > values,
   bool quadrature_points_fastest) const
 {
@@ -2468,7 +2755,7 @@ template <int dim, int spacedim>
 template <class InputVector>
 void FEValuesBase<dim,spacedim>::get_function_gradients (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<Tensor<1,spacedim> > &gradients) const
 {
   Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField());
@@ -2522,7 +2809,7 @@ template <int dim, int spacedim>
 template <class InputVector>
 void FEValuesBase<dim,spacedim>::get_function_gradients (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   VectorSlice<std::vector<std::vector<Tensor<1,spacedim> > > > gradients,
   bool quadrature_points_fastest) const
 {
@@ -2581,7 +2868,7 @@ template <int dim, int spacedim>
 template <class InputVector>
 void FEValuesBase<dim,spacedim>::get_function_hessians (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<Tensor<2,spacedim> > &hessians) const
 {
   Assert (this->update_flags & update_second_derivatives,
@@ -2637,7 +2924,7 @@ template <int dim, int spacedim>
 template <class InputVector>
 void FEValuesBase<dim, spacedim>::get_function_hessians (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   VectorSlice<std::vector<std::vector<Tensor<2,spacedim> > > > hessians,
   bool quadrature_points_fastest) const
 {
@@ -2694,7 +2981,7 @@ template <int dim, int spacedim>
 template <class InputVector, typename number>
 void FEValuesBase<dim,spacedim>::get_function_laplacians (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<number> &laplacians) const
 {
   Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField());
@@ -2745,7 +3032,7 @@ template <int dim, int spacedim>
 template <class InputVector, typename number>
 void FEValuesBase<dim,spacedim>::get_function_laplacians (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<Vector<number> > &laplacians) const
 {
   // Size of indices must be a multiple of dofs_per_cell such that an integer
@@ -2781,7 +3068,7 @@ template <int dim, int spacedim>
 template <class InputVector, typename number>
 void FEValuesBase<dim,spacedim>::get_function_laplacians (
   const InputVector &fe_function,
-  const VectorSlice<const std::vector<unsigned int> > &indices,
+  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
   std::vector<std::vector<number> > &laplacians,
   bool quadrature_points_fastest) const
 {
index 3ce481ba0d6da4e3a3d8d8608bc510c490176638..e220a5e85bf6df1a00a46eabd0aa8f10f5312142 100644 (file)
@@ -1,15 +1,19 @@
-//-----------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 // Declarations of member functions of FEValuesBase::CellIteratorBase
index ea74d7d29e5132d8febc95044471a5b9cc0d9379..567c93f4352e7debd11bec9385f95faedb49bd5e 100644 (file)
@@ -1,15 +1,19 @@
-//-----------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 // Declarations of member functions of FEValuesBase::CellIteratorBase
index 2bc5e862531efaf826de2980a9cec29359a11044..3dfaaa1a9d03da043795ac3c1d8caf45ad1494d4 100644 (file)
@@ -1,15 +1,19 @@
-//-----------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS)
   {
index 5abe9d29fd3aca0fc3b520aae50b950088c4a9a9..95883209fd6c7ca205244e2b10c2e7f0d5979ab2 100644 (file)
@@ -1,15 +1,19 @@
-//-----------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS)
   {
index 111b81394a62cc4a6ba4e211c9da9e540ad503e5..e63ce3fced7f7cb2c2824daf29e2cb92c2980a70 100644 (file)
@@ -1,15 +1,19 @@
-//-----------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-----------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 // Instantiations of functions in FEValuesViews (explicitly write
 // dealii:: namespace in order to not confuse the compiler with
@@ -36,6 +40,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
       template class Scalar<deal_II_dimension, deal_II_space_dimension>;
       template class Vector<deal_II_dimension, deal_II_space_dimension>;
       template class SymmetricTensor<2, deal_II_dimension, deal_II_space_dimension>;
+      template class Tensor<2, deal_II_dimension, deal_II_space_dimension>;
       \}
 #endif
 #endif
@@ -70,11 +75,11 @@ for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimensi
     template
       void FEValuesViews::Scalar<deal_II_dimension, deal_II_space_dimension>
       ::get_function_gradients<dealii::VEC>
-      (const dealii::VEC&, std::vector<Tensor<1,deal_II_space_dimension> >&) const;
+      (const dealii::VEC&, std::vector<dealii::Tensor<1,deal_II_space_dimension> >&) const;
     template
       void FEValuesViews::Scalar<deal_II_dimension, deal_II_space_dimension>
       ::get_function_hessians<dealii::VEC>
-      (const dealii::VEC&, std::vector<Tensor<2,deal_II_space_dimension> >&) const;
+      (const dealii::VEC&, std::vector<dealii::Tensor<2,deal_II_space_dimension> >&) const;
     template
       void FEValuesViews::Scalar<deal_II_dimension, deal_II_space_dimension>
       ::get_function_laplacians<dealii::VEC>
@@ -83,11 +88,11 @@ for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimensi
     template
       void FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>
       ::get_function_values<dealii::VEC>
-      (const dealii::VEC&, std::vector<Tensor<1,deal_II_space_dimension> >&) const;
+      (const dealii::VEC&, std::vector<dealii::Tensor<1,deal_II_space_dimension> >&) const;
     template
       void FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>
       ::get_function_gradients<dealii::VEC>
-      (const dealii::VEC&, std::vector<Tensor<2,deal_II_space_dimension> >&) const;
+      (const dealii::VEC&, std::vector<dealii::Tensor<2,deal_II_space_dimension> >&) const;
     template
       void FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>
       ::get_function_symmetric_gradients<dealii::VEC>
@@ -103,11 +108,11 @@ for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimensi
     template
       void FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>
       ::get_function_hessians<dealii::VEC>
-      (const dealii::VEC&, std::vector<Tensor<3,deal_II_space_dimension> >&) const;
+      (const dealii::VEC&, std::vector<dealii::Tensor<3,deal_II_space_dimension> >&) const;
     template
       void FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>
       ::get_function_laplacians<dealii::VEC>
-      (const dealii::VEC&, std::vector<Tensor<1,deal_II_space_dimension> >&) const;
+      (const dealii::VEC&, std::vector<dealii::Tensor<1,deal_II_space_dimension> >&) const;
 
     template
       void FEValuesViews::SymmetricTensor<2, deal_II_dimension, deal_II_space_dimension>
@@ -116,7 +121,16 @@ for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimensi
     template
       void FEValuesViews::SymmetricTensor<2, deal_II_dimension, deal_II_space_dimension>
       ::get_function_divergences<dealii::VEC>
-      (const dealii::VEC&, std::vector<Tensor<1,deal_II_space_dimension> >&) const;
+      (const dealii::VEC&, std::vector<dealii::Tensor<1,deal_II_space_dimension> >&) const;
+
+    template
+      void FEValuesViews::Tensor<2, deal_II_dimension, deal_II_space_dimension>
+      ::get_function_values<dealii::VEC>
+      (const dealii::VEC&, std::vector<dealii::Tensor<2,deal_II_space_dimension> >&) const;
+    template
+      void FEValuesViews::Tensor<2, deal_II_dimension, deal_II_space_dimension>
+      ::get_function_divergences<dealii::VEC>
+      (const dealii::VEC&, std::vector<dealii::Tensor<1,deal_II_space_dimension> >&) const;
 #endif
 #endif
   }
@@ -136,10 +150,10 @@ for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimensi
       (const VEC&, std::vector<float>&) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_values<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<double>&) const;
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<double>&) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_values<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<float>&) const;
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<float>&) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_values<VEC>
@@ -150,53 +164,53 @@ for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimensi
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_values<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<double> > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_values<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<float> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_values<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        VectorSlice<std::vector<std::vector<double> > >, bool) const;
 //     template
 //       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_values<VEC>
-//       (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
+//       (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
 //        VectorSlice<std::vector<std::vector<float> > >, bool) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_gradients<VEC>
-      (const VEC&, std::vector<Tensor<1,deal_II_space_dimension> > &) const;
+      (const VEC&, std::vector<dealii::Tensor<1,deal_II_space_dimension> > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_gradients<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
-       std::vector<Tensor<1,deal_II_space_dimension> > &) const;
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       std::vector<dealii::Tensor<1,deal_II_space_dimension> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_gradients<VEC>
-      (const VEC&, std::vector<std::vector<Tensor<1,deal_II_space_dimension> > > &) const;
+      (const VEC&, std::vector<std::vector<dealii::Tensor<1,deal_II_space_dimension> > > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_gradients<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
-       VectorSlice<std::vector<std::vector<Tensor<1,deal_II_space_dimension> > > >, bool) const;
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       VectorSlice<std::vector<std::vector<dealii::Tensor<1,deal_II_space_dimension> > > >, bool) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_hessians<VEC>
-      (const VEC&, std::vector<Tensor<2,deal_II_space_dimension> > &) const;
+      (const VEC&, std::vector<dealii::Tensor<2,deal_II_space_dimension> > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_hessians<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
-       std::vector<Tensor<2,deal_II_space_dimension> > &) const;
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       std::vector<dealii::Tensor<2,deal_II_space_dimension> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_hessians<VEC>
-      (const VEC&, std::vector<std::vector<Tensor<2,deal_II_space_dimension> > > &, bool) const;
+      (const VEC&, std::vector<std::vector<dealii::Tensor<2,deal_II_space_dimension> > > &, bool) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_hessians<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
-       VectorSlice<std::vector<std::vector<Tensor<2,deal_II_space_dimension> > > >, bool) const;
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       VectorSlice<std::vector<std::vector<dealii::Tensor<2,deal_II_space_dimension> > > >, bool) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_laplacians<VEC>
@@ -206,10 +220,10 @@ for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimensi
       (const VEC&, std::vector<float>&) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_laplacians<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<double>&) const;
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<double>&) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_laplacians<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<float>&) const;
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<float>&) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_laplacians<VEC>
@@ -220,20 +234,20 @@ for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimensi
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_laplacians<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<double> > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_laplacians<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<float> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_laplacians<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<std::vector<double> > &, bool) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_space_dimension>::get_function_laplacians<VEC>
-      (const VEC&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const VEC&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<std::vector<float> > &, bool) const;
 
 #endif
@@ -251,20 +265,20 @@ for (deal_II_dimension : DIMENSIONS)
        (const dealii::IndexSet&, std::vector<double>&) const;
     template
        void FEValuesViews::Scalar<deal_II_dimension>::get_function_gradients<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension> >&) const;
     template
        void FEValuesViews::Scalar<deal_II_dimension>::get_function_hessians<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<2,deal_II_dimension> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<2,deal_II_dimension> >&) const;
     template
        void FEValuesViews::Scalar<deal_II_dimension>::get_function_laplacians<dealii::IndexSet>
        (const dealii::IndexSet&, std::vector<double>&) const;
 
     template
        void FEValuesViews::Vector<deal_II_dimension>::get_function_values<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension> >&) const;
     template
        void FEValuesViews::Vector<deal_II_dimension>::get_function_gradients<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<2,deal_II_dimension> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<2,deal_II_dimension> >&) const;
     template
        void FEValuesViews::Vector<deal_II_dimension>::get_function_symmetric_gradients<dealii::IndexSet>
        (const dealii::IndexSet&, std::vector<dealii::SymmetricTensor<2,deal_II_dimension> >&) const;
@@ -276,17 +290,24 @@ for (deal_II_dimension : DIMENSIONS)
        (const dealii::IndexSet&, std::vector<double>&) const;
     template
        void FEValuesViews::Vector<deal_II_dimension>::get_function_hessians<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<3,deal_II_dimension> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<3,deal_II_dimension> >&) const;
     template
        void FEValuesViews::Vector<deal_II_dimension>::get_function_laplacians<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension> >&) const;
 
     template
        void FEValuesViews::SymmetricTensor<2,deal_II_dimension,deal_II_dimension>::get_function_values<dealii::IndexSet>
        (const dealii::IndexSet&, std::vector<dealii::SymmetricTensor<2,deal_II_dimension> >&) const;
     template
        void FEValuesViews::SymmetricTensor<2,deal_II_dimension,deal_II_dimension>::get_function_divergences<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension> >&) const;
+
+       template
+       void FEValuesViews::Tensor<2,deal_II_dimension,deal_II_dimension>::get_function_values<dealii::IndexSet>
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<2,deal_II_dimension> >&) const;
+    template
+       void FEValuesViews::Tensor<2,deal_II_dimension,deal_II_dimension>::get_function_divergences<dealii::IndexSet>
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension> >&) const;
 
 
 #if deal_II_dimension != 3
@@ -297,11 +318,11 @@ for (deal_II_dimension : DIMENSIONS)
     template
        void FEValuesViews::Scalar<deal_II_dimension, deal_II_dimension+1>
        ::get_function_gradients<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension+1> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension+1> >&) const;
     template
        void FEValuesViews::Scalar<deal_II_dimension, deal_II_dimension+1>
        ::get_function_hessians<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<2,deal_II_dimension+1> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<2,deal_II_dimension+1> >&) const;
     template
        void FEValuesViews::Scalar<deal_II_dimension, deal_II_dimension+1>
        ::get_function_laplacians<dealii::IndexSet>
@@ -310,11 +331,11 @@ for (deal_II_dimension : DIMENSIONS)
     template
        void FEValuesViews::Vector<deal_II_dimension, deal_II_dimension+1>
        ::get_function_values<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension+1> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension+1> >&) const;
     template
        void FEValuesViews::Vector<deal_II_dimension, deal_II_dimension+1>
        ::get_function_gradients<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<2,deal_II_dimension+1> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<2,deal_II_dimension+1> >&) const;
     template
        void FEValuesViews::Vector<deal_II_dimension, deal_II_dimension+1>
        ::get_function_symmetric_gradients<dealii::IndexSet>
@@ -326,11 +347,11 @@ for (deal_II_dimension : DIMENSIONS)
     template
        void FEValuesViews::Vector<deal_II_dimension, deal_II_dimension+1>
        ::get_function_hessians<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<3,deal_II_dimension+1> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<3,deal_II_dimension+1> >&) const;
     template
        void FEValuesViews::Vector<deal_II_dimension, deal_II_dimension+1>
        ::get_function_laplacians<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension+1> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension+1> >&) const;
 
     template
        void FEValuesViews::SymmetricTensor<2, deal_II_dimension, deal_II_dimension+1>
@@ -339,7 +360,16 @@ for (deal_II_dimension : DIMENSIONS)
     template
        void FEValuesViews::SymmetricTensor<2, deal_II_dimension, deal_II_dimension+1>
         ::get_function_divergences<dealii::IndexSet>
-       (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension+1> >&) const;
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension+1> >&) const;
+
+    template
+       void FEValuesViews::Tensor<2, deal_II_dimension, deal_II_dimension+1>
+        ::get_function_values<dealii::IndexSet>
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<2,deal_II_dimension+1> >&) const;
+    template
+       void FEValuesViews::Tensor<2, deal_II_dimension, deal_II_dimension+1>
+        ::get_function_divergences<dealii::IndexSet>
+       (const dealii::IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension+1> >&) const;
 
 #endif
 #endif
@@ -360,10 +390,10 @@ for (deal_II_dimension : DIMENSIONS)
       (const IndexSet&, std::vector<float>&) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<double>&) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<double>&) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<float>&) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<float>&) const;
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_values<IndexSet>
@@ -374,53 +404,53 @@ for (deal_II_dimension : DIMENSIONS)
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<double> > &) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<float> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        VectorSlice<std::vector<std::vector<double> > >, bool) const;
 //     template
 //       void FEValuesBase<deal_II_dimension>::get_function_values<IndexSet>
-//       (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+//       (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
 //        VectorSlice<std::vector<std::vector<float> > >, bool) const;
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_gradients<IndexSet>
-      (const IndexSet&, std::vector<Tensor<1,deal_II_dimension> > &) const;
+      (const IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension> > &) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_gradients<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
-       std::vector<Tensor<1,deal_II_dimension> > &) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       std::vector<dealii::Tensor<1,deal_II_dimension> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_gradients<IndexSet>
-      (const IndexSet&, std::vector<std::vector<Tensor<1,deal_II_dimension> > > &) const;
+      (const IndexSet&, std::vector<std::vector<dealii::Tensor<1,deal_II_dimension> > > &) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_gradients<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
-       VectorSlice<std::vector<std::vector<Tensor<1,deal_II_dimension> > > >, bool) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       VectorSlice<std::vector<std::vector<dealii::Tensor<1,deal_II_dimension> > > >, bool) const;
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_hessians<IndexSet>
-      (const IndexSet&, std::vector<Tensor<2,deal_II_dimension> > &) const;
+      (const IndexSet&, std::vector<dealii::Tensor<2,deal_II_dimension> > &) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_hessians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
-       std::vector<Tensor<2,deal_II_dimension> > &) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       std::vector<dealii::Tensor<2,deal_II_dimension> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_hessians<IndexSet>
-      (const IndexSet&, std::vector<std::vector<Tensor<2,deal_II_dimension> > > &, bool) const;
+      (const IndexSet&, std::vector<std::vector<dealii::Tensor<2,deal_II_dimension> > > &, bool) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_hessians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
-       VectorSlice<std::vector<std::vector<Tensor<2,deal_II_dimension> > > >, bool) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       VectorSlice<std::vector<std::vector<dealii::Tensor<2,deal_II_dimension> > > >, bool) const;
 
     template
        void FEValuesBase<deal_II_dimension>::get_function_laplacians<IndexSet>
@@ -430,10 +460,10 @@ for (deal_II_dimension : DIMENSIONS)
       (const IndexSet&, std::vector<float>&) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<double>&) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<double>&) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<float>&) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<float>&) const;
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_laplacians<IndexSet>
@@ -444,20 +474,20 @@ for (deal_II_dimension : DIMENSIONS)
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<double> > &) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<float> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<std::vector<double> > &, bool) const;
     template
       void FEValuesBase<deal_II_dimension>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<std::vector<float> > &, bool) const;
 
 
@@ -471,10 +501,10 @@ for (deal_II_dimension : DIMENSIONS)
       (const IndexSet&, std::vector<float>&) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<double>&) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<double>&) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<float>&) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<float>&) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_values<IndexSet>
@@ -485,53 +515,53 @@ for (deal_II_dimension : DIMENSIONS)
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<double> > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<float> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_values<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        VectorSlice<std::vector<std::vector<double> > >, bool) const;
 //     template
 //       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_values<IndexSet>
-//       (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+//       (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
 //        VectorSlice<std::vector<std::vector<float> > >, bool) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_gradients<IndexSet>
-      (const IndexSet&, std::vector<Tensor<1,deal_II_dimension+1> > &) const;
+      (const IndexSet&, std::vector<dealii::Tensor<1,deal_II_dimension+1> > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_gradients<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
-       std::vector<Tensor<1,deal_II_dimension+1> > &) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       std::vector<dealii::Tensor<1,deal_II_dimension+1> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_gradients<IndexSet>
-      (const IndexSet&, std::vector<std::vector<Tensor<1,deal_II_dimension+1> > > &) const;
+      (const IndexSet&, std::vector<std::vector<dealii::Tensor<1,deal_II_dimension+1> > > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_gradients<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
-       VectorSlice<std::vector<std::vector<Tensor<1,deal_II_dimension+1> > > >, bool) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       VectorSlice<std::vector<std::vector<dealii::Tensor<1,deal_II_dimension+1> > > >, bool) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_hessians<IndexSet>
-      (const IndexSet&, std::vector<Tensor<2,deal_II_dimension+1> > &) const;
+      (const IndexSet&, std::vector<dealii::Tensor<2,deal_II_dimension+1> > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_hessians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
-       std::vector<Tensor<2,deal_II_dimension+1> > &) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       std::vector<dealii::Tensor<2,deal_II_dimension+1> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_hessians<IndexSet>
-      (const IndexSet&, std::vector<std::vector<Tensor<2,deal_II_dimension+1> > > &, bool) const;
+      (const IndexSet&, std::vector<std::vector<dealii::Tensor<2,deal_II_dimension+1> > > &, bool) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_hessians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
-       VectorSlice<std::vector<std::vector<Tensor<2,deal_II_dimension+1> > > >, bool) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
+       VectorSlice<std::vector<std::vector<dealii::Tensor<2,deal_II_dimension+1> > > >, bool) const;
 
     template
        void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_laplacians<IndexSet>
@@ -541,10 +571,10 @@ for (deal_II_dimension : DIMENSIONS)
       (const IndexSet&, std::vector<float>&) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<double>&) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<double>&) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&, std::vector<float>&) const;
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&, std::vector<float>&) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_laplacians<IndexSet>
@@ -555,20 +585,20 @@ for (deal_II_dimension : DIMENSIONS)
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<double> > &) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<Vector<float> > &) const;
 
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<std::vector<double> > &, bool) const;
     template
       void FEValuesBase<deal_II_dimension,deal_II_dimension+1>::get_function_laplacians<IndexSet>
-      (const IndexSet&, const VectorSlice<const std::vector<unsigned int> >&,
+      (const IndexSet&, const VectorSlice<const std::vector<types::global_dof_index> >&,
        std::vector<std::vector<float> > &, bool) const;
 
 #endif
index 69ae580b8a3653938c838a800ab53182e6f34151..6fb6a9372b9c20f77b90d8ba06c79aaf75b59f06 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id:  $
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2013 by the deal.II authors
+// Copyright (C) 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 // This file compiles the second half of the instantiations from fe_values.cc
 // to get the memory consumption below 1.5gb with gcc.
index aacd12029ad90dd6f57845a445ac0badf73de802..9475f679046b7267ec8a470c8f0ae6508231950d 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2005, 2006, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/grid/tria.h>
 #include <deal.II/fe/mapping.h>
index df9073dc3b5615079dcb85acffc78a91242b4210..f0dd595baca463a9db6d8ffe6022b8771a81e7ac 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 
index a481469f61f27f0bd73a6cf9ef2e99e7a72cc6c6..1873d9c737122c81a3bb2dbdef839006b6dbf461 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 27a107a0d9b3f94fab2f3bc3b0b6e02d3e1f203b..d9e830d5d0e75d3aa4015bee37f19f3de60f8767 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 48ec6cfaea29775f2c173f7c12e63d527d18a017..814b0385df895f9346b1a4dbaf3fb10760bd83d3 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/tensor.h>
 #include <deal.II/base/quadrature.h>
index ab9c3cf9514624185ffd9f02fa476eeefba8acd7..e6f1a0e6bea6f169b6aeb200c58e13d083877836 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 213905d2a72be35a1610f8ac6de70f6a7d4af798..663d77482e3418f5a37b1f4ba7c2d2b01bf26f5d 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/polynomial.h>
index c705674d50bc39e7e6aad64a20f597acab604521..f1ec88e76fc981e0c78e09d323d805166047d16b 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 
index e141e0a3a673923b21320bc9c46ce08ce636c8cc..530a199602515c3c29e8cea08d7f33bbedacfc66 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/derivative_form.h>
 #include <deal.II/base/quadrature.h>
@@ -961,7 +965,7 @@ namespace internal
                   case 1:
                     // in 1d, we don't have access to any of the data.aux
                     // fields (because it has only dim-1 components), but we
-                    // can still compute the boundary form simply by simply
+                    // can still compute the boundary form by simply
                     // looking at the number of the face
                     boundary_forms[i][0] = (face_no == 0 ?
                                             -1 : +1);
index a528ce957ad4a0c9e70c97517d16976000d7a45d..b4ee36efc4fc9fbb1eabd34f91e6143bd927a408 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
index a2a73a7776cf5ca710b98316227b6bc88f7ed797..f02797d6c5d061f004e69a52a7ef802478892cf6 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/fe/mapping_q1_eulerian.h>
 #include <deal.II/lac/vector.h>
index e479e3590385c41b26d56e998122f7a1be1fbe02..06d1ebc2906ab84c45aebd268682ce6ac49c54a0 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index a294849a02a44a6046c74ea0cae86002004d8342..4e005c2f8f2deca4614ea6ae997db9981e03b75c 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/quadrature_lib.h>
@@ -110,8 +112,8 @@ compute_mapping_support_points
   // first, basic assertion
   // with respect to vector size,
 
-  const unsigned int n_dofs      = euler_dof_handler->n_dofs();
-  const unsigned int vector_size = euler_vector->size();
+  const types::global_dof_index n_dofs  = euler_dof_handler->n_dofs();
+  const types::global_dof_index vector_size = euler_vector->size();
 
   AssertDimension(vector_size,n_dofs);
 
index 4bed2047f6e6f00a6f5a783591819195a11f380b..dd64c5497fdda71d773f7fa6d49d91992d2e8828 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
index bd92b3debb897b1619760346b339151503e26ced..5e13fa938c63e5535b2620728c1b23bbc27ff991 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index 12dadd04373c29c298b2c356cfc93b37be010fbe..e834ca633467cd8a19b156e2a6a46535d03e7bf9 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/thread_management.h>
@@ -182,7 +184,7 @@ void GridGenerator::hyper_cube (Triangulation<dim,spacedim> &tria,
 void
 GridGenerator::moebius (
   Triangulation<3>  &tria,
-  const unsigned int   n_cells,
+  const size_type      n_cells,
   const unsigned int   n_rotations,
   const double         R,
   const double         r)
@@ -197,7 +199,7 @@ GridGenerator::moebius (
   double beta_step=n_rotations*numbers::PI/2.0/n_cells;
   double alpha_step=2.0*numbers::PI/n_cells;
 
-  for (unsigned int i=0; i<n_cells; ++i)
+  for (size_type i=0; i<n_cells; ++i)
     for (unsigned int j=0; j<4; ++j)
       {
         vertices[4*i+j][0]=R*std::cos(i*alpha_step)+r*std::cos(i*beta_step+j*numbers::PI/2.0)*std::cos(i*alpha_step);
@@ -205,10 +207,10 @@ GridGenerator::moebius (
         vertices[4*i+j][2]=r*std::sin(i*beta_step+j*numbers::PI/2.0);
       }
 
-  unsigned int offset=0;
+  size_type offset=0;
 
   std::vector<CellData<dim> > cells (n_cells);
-  for (unsigned int i=0; i<n_cells; ++i)
+  for (size_type i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0; j<2; ++j)
         {
@@ -482,13 +484,13 @@ GridGenerator::parallelepiped (Triangulation<dim>  &tria,
 template<int dim>
 void
 GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
-                                          const unsigned int   n_subdivisions,
+                                          const size_type      n_subdivisions,
                                           const Point<dim>   (&corners) [dim],
                                           const bool           colorize)
 {
   // Equalise number of subdivisions in each dim-direction, heir
   // validity will be checked later
-  unsigned int (n_subdivisions_) [dim];
+  size_type (n_subdivisions_) [dim];
   for (unsigned int i=0; i<dim; ++i)
     n_subdivisions_[i] = n_subdivisions;
 
@@ -501,7 +503,7 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
 template<int dim>
 void
 GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
-                                          const unsigned int ( n_subdivisions) [dim],
+                                          const size_type    ( n_subdivisions) [dim],
                                           const Point<dim>   (&corners) [dim],
                                           const bool           colorize)
 {
@@ -525,20 +527,20 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
   switch (dim)
     {
     case 1:
-      for (unsigned int x=0; x<=n_subdivisions[0]; ++x)
+      for (size_type x=0; x<=n_subdivisions[0]; ++x)
         points.push_back (Point<dim> (x*delta[0]));
       break;
 
     case 2:
-      for (unsigned int y=0; y<=n_subdivisions[1]; ++y)
-        for (unsigned int x=0; x<=n_subdivisions[0]; ++x)
+      for (size_type y=0; y<=n_subdivisions[1]; ++y)
+        for (size_type x=0; x<=n_subdivisions[0]; ++x)
           points.push_back (Point<dim> (x*delta[0] + y*delta[1]));
       break;
 
     case 3:
-      for (unsigned int z=0; z<=n_subdivisions[2]; ++z)
-        for (unsigned int y=0; y<=n_subdivisions[1]; ++y)
-          for (unsigned int x=0; x<=n_subdivisions[0]; ++x)
+      for (size_type z=0; z<=n_subdivisions[2]; ++z)
+        for (size_type y=0; y<=n_subdivisions[1]; ++y)
+          for (size_type x=0; x<=n_subdivisions[0]; ++x)
             points.push_back (Point<dim> (x*delta[0] + y*delta[1] + z*delta[2]));
       break;
 
@@ -547,7 +549,7 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
     }
 
   // Prepare cell data
-  unsigned int n_cells = 1;
+  size_type n_cells = 1;
   for (unsigned int i=0; i<dim; ++i)
     n_cells *= n_subdivisions[i];
   std::vector<CellData<dim> > cells (n_cells);
@@ -556,7 +558,7 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
   switch (dim)
     {
     case 1:
-      for (unsigned int x=0; x<n_subdivisions[0]; ++x)
+      for (size_type x=0; x<n_subdivisions[0]; ++x)
         {
           cells[x].vertices[0] = x;
           cells[x].vertices[1] = x+1;
@@ -569,13 +571,13 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
     case 2:
     {
       // Shorthand
-      const unsigned int n_dy = n_subdivisions[1];
-      const unsigned int n_dx = n_subdivisions[0];
+      const size_type n_dy = n_subdivisions[1];
+      const size_type n_dx = n_subdivisions[0];
 
-      for (unsigned int y=0; y<n_dy; ++y)
-        for (unsigned int x=0; x<n_dx; ++x)
+      for (size_type y=0; y<n_dy; ++y)
+        for (size_type x=0; x<n_dx; ++x)
           {
-            const unsigned int c = y*n_dx         + x;
+            const size_type    c = y*n_dx         + x;
             cells[c].vertices[0] = y*(n_dx+1)     + x;
             cells[c].vertices[1] = y*(n_dx+1)     + x+1;
             cells[c].vertices[2] = (y+1)*(n_dx+1) + x;
@@ -590,15 +592,15 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
     case 3:
     {
       // Shorthand
-      const unsigned int n_dz = n_subdivisions[2];
-      const unsigned int n_dy = n_subdivisions[1];
-      const unsigned int n_dx = n_subdivisions[0];
+      const size_type n_dz = n_subdivisions[2];
+      const size_type n_dy = n_subdivisions[1];
+      const size_type n_dx = n_subdivisions[0];
 
-      for (unsigned int z=0; z<n_dz; ++z)
-        for (unsigned int y=0; y<n_dy; ++y)
-          for (unsigned int x=0; x<n_dx; ++x)
+      for (size_type z=0; z<n_dz; ++z)
+        for (size_type y=0; y<n_dy; ++y)
+          for (size_type x=0; x<n_dx; ++x)
             {
-              const unsigned int c = z*n_dy*n_dx             + y*n_dx         + x;
+              const size_type    c = z*n_dy*n_dx             + y*n_dx         + x;
 
               cells[c].vertices[0] = z*(n_dy+1)*(n_dx+1)     + y*(n_dx+1)     + x;
               cells[c].vertices[1] = z*(n_dy+1)*(n_dx+1)     + y*(n_dx+1)     + x+1;
@@ -932,7 +934,7 @@ GridGenerator::subdivided_hyper_rectangle(
         }
 
       double x = 0;
-      for (unsigned int j=0; j<step_sizes.at(i).size(); j++)
+      for (size_type j=0; j<step_sizes.at(i).size(); j++)
         x += step_sizes[i][j];
       Assert(std::fabs(x - (p2(i)-p1(i))) <= 1e-12*std::fabs(x),
              ExcInvalidRepetitions (i) );
@@ -947,7 +949,7 @@ GridGenerator::subdivided_hyper_rectangle(
     case 1:
     {
       double x=0;
-      for (unsigned int i=0; ; ++i)
+      for (size_type i=0; ; ++i)
         {
           points.push_back (Point<dim> (p1[0]+x));
 
@@ -967,10 +969,10 @@ GridGenerator::subdivided_hyper_rectangle(
     case 2:
     {
       double y=0;
-      for (unsigned int j=0; ; ++j)
+      for (size_type j=0; ; ++j)
         {
           double x=0;
-          for (unsigned int i=0; ; ++i)
+          for (size_type i=0; ; ++i)
             {
               points.push_back (Point<dim> (p1[0]+x,
                                             p1[1]+y));
@@ -991,13 +993,13 @@ GridGenerator::subdivided_hyper_rectangle(
     case 3:
     {
       double z=0;
-      for (unsigned int k=0; ; ++k)
+      for (size_type k=0; ; ++k)
         {
           double y=0;
-          for (unsigned int j=0; ; ++j)
+          for (size_type j=0; ; ++j)
             {
               double x=0;
-              for (unsigned int i=0; ; ++i)
+              for (size_type i=0; ; ++i)
                 {
                   points.push_back (Point<dim> (p1[0]+x,
                                                 p1[1]+y,
@@ -1034,7 +1036,7 @@ GridGenerator::subdivided_hyper_rectangle(
     case 1:
     {
       cells.resize (step_sizes[0].size());
-      for (unsigned int x=0; x<step_sizes[0].size(); ++x)
+      for (size_type x=0; x<step_sizes[0].size(); ++x)
         {
           cells[x].vertices[0] = x;
           cells[x].vertices[1] = x+1;
@@ -1046,10 +1048,10 @@ GridGenerator::subdivided_hyper_rectangle(
     case 2:
     {
       cells.resize (step_sizes[1].size()*step_sizes[0].size());
-      for (unsigned int y=0; y<step_sizes[1].size(); ++y)
-        for (unsigned int x=0; x<step_sizes[0].size(); ++x)
+      for (size_type y=0; y<step_sizes[1].size(); ++y)
+        for (size_type x=0; x<step_sizes[0].size(); ++x)
           {
-            const unsigned int c = x+y*step_sizes[0].size();
+            const size_type c = x+y*step_sizes[0].size();
             cells[c].vertices[0] = y*(step_sizes[0].size()+1)+x;
             cells[c].vertices[1] = y*(step_sizes[0].size()+1)+x+1;
             cells[c].vertices[2] = (y+1)*(step_sizes[0].size()+1)+x;
@@ -1061,15 +1063,15 @@ GridGenerator::subdivided_hyper_rectangle(
 
     case 3:
     {
-      const unsigned int n_x  = (step_sizes[0].size()+1);
-      const unsigned int n_xy = (step_sizes[0].size()+1)*(step_sizes[1].size()+1);
+      const size_type n_x  = (step_sizes[0].size()+1);
+      const size_type n_xy = (step_sizes[0].size()+1)*(step_sizes[1].size()+1);
 
       cells.resize (step_sizes[2].size()*step_sizes[1].size()*step_sizes[0].size());
-      for (unsigned int z=0; z<step_sizes[2].size(); ++z)
-        for (unsigned int y=0; y<step_sizes[1].size(); ++y)
-          for (unsigned int x=0; x<step_sizes[0].size(); ++x)
+      for (size_type z=0; z<step_sizes[2].size(); ++z)
+        for (size_type y=0; y<step_sizes[1].size(); ++y)
+          for (size_type x=0; x<step_sizes[0].size(); ++x)
             {
-              const unsigned int c = x+y*step_sizes[0].size() +
+              const size_type    c = x+y*step_sizes[0].size() +
                                      z*step_sizes[0].size()*step_sizes[1].size();
               cells[c].vertices[0] = z*n_xy + y*n_x + x;
               cells[c].vertices[1] = z*n_xy + y*n_x + x+1;
@@ -1130,13 +1132,13 @@ GridGenerator::subdivided_hyper_rectangle (
   Assert(spacing.size() == 1,
          ExcInvalidRepetitionsDimension(1));
 
-  const unsigned int n_cells = material_id.size(0);
+  const size_type n_cells = material_id.size(0);
 
   Assert(spacing[0].size() == n_cells,
          ExcInvalidRepetitionsDimension(1));
 
   double delta = std::numeric_limits<double>::max();
-  for (unsigned int i=0; i<n_cells; i++)
+  for (size_type i=0; i<n_cells; i++)
     {
       Assert (spacing[0][i] >= 0, ExcInvalidRepetitions(-1));
       delta = std::min (delta, spacing[0][i]);
@@ -1145,20 +1147,20 @@ GridGenerator::subdivided_hyper_rectangle (
   // generate the necessary points
   std::vector<Point<1> > points;
   double ax = p[0];
-  for (unsigned int x=0; x<=n_cells; ++x)
+  for (size_type x=0; x<=n_cells; ++x)
     {
       points.push_back (Point<1> (ax));
       if (x<n_cells)
         ax += spacing[0][x];
     }
   // create the cells
-  unsigned int n_val_cells = 0;
-  for (unsigned int i=0; i<n_cells; i++)
+  size_type n_val_cells = 0;
+  for (size_type i=0; i<n_cells; i++)
     if (material_id[i]!=numbers::invalid_material_id) n_val_cells++;
 
   std::vector<CellData<1> > cells(n_val_cells);
-  unsigned int id = 0;
-  for (unsigned int x=0; x<n_cells; ++x)
+  size_type id = 0;
+  for (size_type x=0; x<n_cells; ++x)
     if (material_id[x] != numbers::invalid_material_id)
       {
         cells[id].vertices[0] = x;
@@ -1191,14 +1193,14 @@ GridGenerator::subdivided_hyper_rectangle (
   Assert(spacing.size() == 2,
          ExcInvalidRepetitionsDimension(2));
 
-  std::vector<unsigned int> repetitions(2);
-  unsigned int n_cells = 1;
+  std::vector<size_type> repetitions(2);
+  size_type n_cells = 1;
   double delta = std::numeric_limits<double>::max();
   for (unsigned int i=0; i<2; i++)
     {
       repetitions[i] = spacing[i].size();
       n_cells *= repetitions[i];
-      for (unsigned int j=0; j<repetitions[i]; j++)
+      for (size_type j=0; j<repetitions[i]; j++)
         {
           Assert (spacing[i][j] >= 0, ExcInvalidRepetitions(-1));
           delta = std::min (delta, spacing[i][j]);
@@ -1210,10 +1212,10 @@ GridGenerator::subdivided_hyper_rectangle (
   // generate the necessary points
   std::vector<Point<2> > points;
   double ay = p[1];
-  for (unsigned int y=0; y<=repetitions[1]; ++y)
+  for (size_type y=0; y<=repetitions[1]; ++y)
     {
       double ax = p[0];
-      for (unsigned int x=0; x<=repetitions[0]; ++x)
+      for (size_type x=0; x<=repetitions[0]; ++x)
         {
           points.push_back (Point<2> (ax,ay));
           if (x<repetitions[0])
@@ -1224,16 +1226,16 @@ GridGenerator::subdivided_hyper_rectangle (
     }
 
   // create the cells
-  unsigned int n_val_cells = 0;
-  for (unsigned int i=0; i<material_id.size(0); i++)
-    for (unsigned int j=0; j<material_id.size(1); j++)
+  size_type n_val_cells = 0;
+  for (size_type i=0; i<material_id.size(0); i++)
+    for (size_type j=0; j<material_id.size(1); j++)
       if (material_id[i][j] != numbers::invalid_material_id)
         n_val_cells++;
 
   std::vector<CellData<2> > cells(n_val_cells);
-  unsigned int id = 0;
-  for (unsigned int y=0; y<repetitions[1]; ++y)
-    for (unsigned int x=0; x<repetitions[0]; ++x)
+  size_type id = 0;
+  for (size_type y=0; y<repetitions[1]; ++y)
+    for (size_type x=0; x<repetitions[0]; ++x)
       if (material_id[x][y]!=numbers::invalid_material_id)
         {
           cells[id].vertices[0] = y*(repetitions[0]+1)+x;
@@ -1291,14 +1293,14 @@ GridGenerator::subdivided_hyper_rectangle (
   Assert(spacing.size() == dim,
          ExcInvalidRepetitionsDimension(dim));
 
-  std::vector<unsigned int> repetitions(dim);
-  unsigned int n_cells = 1;
+  std::vector<size_type > repetitions(dim);
+  size_type n_cells = 1;
   double delta = std::numeric_limits<double>::max();
   for (unsigned int i=0; i<dim; i++)
     {
       repetitions[i] = spacing[i].size();
       n_cells *= repetitions[i];
-      for (unsigned int j=0; j<repetitions[i]; j++)
+      for (size_type j=0; j<repetitions[i]; j++)
         {
           Assert (spacing[i][j] >= 0, ExcInvalidRepetitions(-1));
           delta = std::min (delta, spacing[i][j]);
@@ -1310,13 +1312,13 @@ GridGenerator::subdivided_hyper_rectangle (
   // generate the necessary points
   std::vector<Point<dim> > points;
   double az = p[2];
-  for (unsigned int z=0; z<=repetitions[2]; ++z)
+  for (size_type z=0; z<=repetitions[2]; ++z)
     {
       double ay = p[1];
-      for (unsigned int y=0; y<=repetitions[1]; ++y)
+      for (size_type y=0; y<=repetitions[1]; ++y)
         {
           double ax = p[0];
-          for (unsigned int x=0; x<=repetitions[0]; ++x)
+          for (size_type x=0; x<=repetitions[0]; ++x)
             {
               points.push_back (Point<dim> (ax,ay,az));
               if (x<repetitions[0])
@@ -1330,20 +1332,20 @@ GridGenerator::subdivided_hyper_rectangle (
     }
 
   // create the cells
-  unsigned int n_val_cells = 0;
-  for (unsigned int i=0; i<material_id.size(0); i++)
-    for (unsigned int j=0; j<material_id.size(1); j++)
-      for (unsigned int k=0; k<material_id.size(2); k++)
+  size_type n_val_cells = 0;
+  for (size_type i=0; i<material_id.size(0); i++)
+    for (size_type j=0; j<material_id.size(1); j++)
+      for (size_type k=0; k<material_id.size(2); k++)
         if (material_id[i][j][k]!=numbers::invalid_material_id)
           n_val_cells++;
 
   std::vector<CellData<dim> > cells(n_val_cells);
-  unsigned int id = 0;
-  const unsigned int n_x  = (repetitions[0]+1);
-  const unsigned int n_xy = (repetitions[0]+1)*(repetitions[1]+1);
-  for (unsigned int z=0; z<repetitions[2]; ++z)
-    for (unsigned int y=0; y<repetitions[1]; ++y)
-      for (unsigned int x=0; x<repetitions[0]; ++x)
+  size_type id = 0;
+  const size_type n_x  = (repetitions[0]+1);
+  const size_type n_xy = (repetitions[0]+1)*(repetitions[1]+1);
+  for (size_type z=0; z<repetitions[2]; ++z)
+    for (size_type y=0; y<repetitions[1]; ++y)
+      for (size_type x=0; x<repetitions[0]; ++x)
         if (material_id[x][y][z]!=numbers::invalid_material_id)
           {
             cells[id].vertices[0] = z*n_xy + y*n_x + x;
@@ -1532,7 +1534,7 @@ void GridGenerator::hyper_shell (Triangulation<1> &,
                                  const Point<1> &,
                                  const double,
                                  const double,
-                                 const unsigned int,
+                                 const size_type ,
                                  const bool)
 {
   Assert (false, ExcNotImplemented());
@@ -1554,8 +1556,8 @@ void GridGenerator::cylinder_shell (Triangulation<1> &,
                                     const double,
                                     const double,
                                     const double,
-                                    const unsigned int,
-                                    const unsigned int)
+                                    const size_type ,
+                                    const size_type )
 {
   Assert (false, ExcNotImplemented());
 }
@@ -1577,7 +1579,7 @@ GridGenerator::half_hyper_shell (Triangulation<1> &,
                                  const Point<1> &,
                                  const double,
                                  const double,
-                                 const unsigned int,
+                                 const size_type ,
                                  const bool)
 {
   Assert (false, ExcNotImplemented());
@@ -1588,7 +1590,7 @@ void GridGenerator::quarter_hyper_shell (Triangulation<1> &,
                                          const Point<1> &,
                                          const double,
                                          const double,
-                                         const unsigned int,
+                                         const size_type ,
                                          const bool)
 {
   Assert (false, ExcNotImplemented());
@@ -1834,11 +1836,11 @@ GridGenerator::colorize_hyper_shell (
 
 
 template <>
-void GridGenerator::hyper_shell (Triangulation<2>   &tria,
-                                 const Point<2>     &center,
-                                 const double        inner_radius,
-                                 const double        outer_radius,
-                                 const unsigned int  n_cells,
+void GridGenerator::hyper_shell (Triangulation<2> &tria,
+                                 const Point<2>   &center,
+                                 const double      inner_radius,
+                                 const double      outer_radius,
+                                 const size_type   n_cells,
                                  const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -1855,11 +1857,11 @@ void GridGenerator::hyper_shell (Triangulation<2>   &tria,
   // radial extent (which is the
   // difference between the two
   // radii)
-  const unsigned int N = (n_cells == 0 ?
-                          static_cast<unsigned int>
-                          (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
-                                     (outer_radius - inner_radius))) :
-                          n_cells);
+  const size_type N = (n_cells == 0 ?
+                       static_cast<size_type>
+                       (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
+                                  (outer_radius - inner_radius))) :
+                       n_cells);
 
   // set up N vertices on the
   // outer and N vertices on
@@ -1868,7 +1870,7 @@ void GridGenerator::hyper_shell (Triangulation<2>   &tria,
   // outer one, and all are
   // numbered counter-clockwise
   std::vector<Point<2> > vertices(2*N);
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
       vertices[i] = Point<2>( std::cos(2*pi * i/N),
                               std::sin(2*pi * i/N)) * outer_radius;
@@ -1880,7 +1882,7 @@ void GridGenerator::hyper_shell (Triangulation<2>   &tria,
 
   std::vector<CellData<2> > cells (N, CellData<2>());
 
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
       cells[i].vertices[0] = i;
       cells[i].vertices[1] = (i+1)%N;
@@ -1938,8 +1940,8 @@ void GridGenerator::cylinder_shell (Triangulation<2> &,
                                     const double,
                                     const double,
                                     const double,
-                                    const unsigned int,
-                                    const unsigned int)
+                                    const size_type,
+                                    const size_type)
 {
   Assert (false, ExcNotImplemented());
 }
@@ -2009,11 +2011,11 @@ GridGenerator::half_hyper_ball (Triangulation<2> &tria,
 // Implementation for 2D only
 template <>
 void
-GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
-                                 const Point<2>     &center,
-                                 const double        inner_radius,
-                                 const double        outer_radius,
-                                 const unsigned int  n_cells,
+GridGenerator::half_hyper_shell (Triangulation<2> &tria,
+                                 const Point<2>   &center,
+                                 const double      inner_radius,
+                                 const double      outer_radius,
+                                 const size_type   n_cells,
                                  const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -2029,11 +2031,11 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
   // radial extent (which is the
   // difference between the two
   // radii)
-  const unsigned int N = (n_cells == 0 ?
-                          static_cast<unsigned int>
-                          (std::ceil((pi* (outer_radius + inner_radius)/2) /
-                                     (outer_radius - inner_radius))) :
-                          n_cells);
+  const size_type N = (n_cells == 0 ?
+                       static_cast<size_type>
+                       (std::ceil((pi* (outer_radius + inner_radius)/2) /
+                                  (outer_radius - inner_radius))) :
+                       n_cells);
 
   // set up N+1 vertices on the
   // outer and N+1 vertices on
@@ -2042,7 +2044,7 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
   // outer one, and all are
   // numbered counter-clockwise
   std::vector<Point<2> > vertices(2*(N+1));
-  for (unsigned int i=0; i<=N; ++i)
+  for (size_type i=0; i<=N; ++i)
     {
       // enforce that the x-coordinates
       // of the first and last point of
@@ -2063,7 +2065,7 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
 
   std::vector<CellData<2> > cells (N, CellData<2>());
 
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
       cells[i].vertices[0] = i;
       cells[i].vertices[1] = (i+1)%(N+1);
@@ -2090,11 +2092,11 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
 
 
 template <>
-void GridGenerator::quarter_hyper_shell (Triangulation<2>   &tria,
-                                         const Point<2>     &center,
-                                         const double        inner_radius,
-                                         const double        outer_radius,
-                                         const unsigned int  n_cells,
+void GridGenerator::quarter_hyper_shell (Triangulation<2> &tria,
+                                         const Point<2>   &center,
+                                         const double      inner_radius,
+                                         const double      outer_radius,
+                                         const size_type   n_cells,
                                          const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -2110,11 +2112,11 @@ void GridGenerator::quarter_hyper_shell (Triangulation<2>   &tria,
   // radial extent (which is the
   // difference between the two
   // radii)
-  const unsigned int N = (n_cells == 0 ?
-                          static_cast<unsigned int>
-                          (std::ceil((pi* (outer_radius + inner_radius)/4) /
-                                     (outer_radius - inner_radius))) :
-                          n_cells);
+  const size_type N = (n_cells == 0 ?
+                       static_cast<size_type>
+                       (std::ceil((pi* (outer_radius + inner_radius)/4) /
+                                  (outer_radius - inner_radius))) :
+                       n_cells);
 
   // set up N+1 vertices on the
   // outer and N+1 vertices on
@@ -2123,7 +2125,7 @@ void GridGenerator::quarter_hyper_shell (Triangulation<2>   &tria,
   // outer one, and all are
   // numbered counter-clockwise
   std::vector<Point<2> > vertices(2*(N+1));
-  for (unsigned int i=0; i<=N; ++i)
+  for (size_type i=0; i<=N; ++i)
     {
       // enforce that the x-coordinates
       // of the last point is exactly
@@ -2143,7 +2145,7 @@ void GridGenerator::quarter_hyper_shell (Triangulation<2>   &tria,
 
   std::vector<CellData<2> > cells (N, CellData<2>());
 
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
       cells[i].vertices[0] = i;
       cells[i].vertices[1] = (i+1)%(N+1);
@@ -2302,12 +2304,12 @@ void GridGenerator::truncated_cone (Triangulation<3> &triangulation,
                                     const double half_length)
 {
   // Determine number of cells and vertices
-  const unsigned int
-  n_cells = static_cast<unsigned int>(std::floor (half_length /
-                                                  std::max (radius_0,
-                                                            radius_1) +
-                                                  0.5));
-  const unsigned int n_vertices = 4 * (n_cells + 1);
+  const size_type
+  n_cells = static_cast<size_type>(std::floor (half_length /
+                                               std::max (radius_0,
+                                                         radius_1) +
+                                               0.5));
+  const size_type n_vertices = 4 * (n_cells + 1);
   std::vector<Point<3> > vertices_tmp(n_vertices);
 
   vertices_tmp[0] = Point<3> (-half_length, 0, -radius_0);
@@ -2317,7 +2319,7 @@ void GridGenerator::truncated_cone (Triangulation<3> &triangulation,
 
   const double dx = 2 * half_length / n_cells;
 
-  for (unsigned int i = 0; i < n_cells; ++i)
+  for (size_type i = 0; i < n_cells; ++i)
     {
       vertices_tmp[4 * (i + 1)]
         = vertices_tmp[4 * i] +
@@ -2337,13 +2339,13 @@ void GridGenerator::truncated_cone (Triangulation<3> &triangulation,
                                          vertices_tmp.end());
   Table<2,unsigned int> cell_vertices(n_cells,GeometryInfo<3>::vertices_per_cell);
 
-  for (unsigned int i = 0; i < n_cells; ++i)
+  for (size_type i = 0; i < n_cells; ++i)
     for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
       cell_vertices[i][j] = 4 * i + j;
 
   std::vector<CellData<3> > cells (n_cells, CellData<3> ());
 
-  for (unsigned int i = 0; i < n_cells; ++i)
+  for (size_type i = 0; i < n_cells; ++i)
     {
       for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
         cells[i].vertices[j] = cell_vertices[i][j];
@@ -2589,7 +2591,7 @@ GridGenerator::cylinder (Triangulation<3> &tria,
   // respectively. note that we also
   // have to deal with those lines
   // that are purely in the interior
-  // of the ends. we determine wether
+  // of the ends. we determine whether
   // an edge is purely in the
   // interior if one of its vertices
   // is at coordinates '+-a' as set
@@ -2712,17 +2714,18 @@ GridGenerator::half_hyper_ball (Triangulation<3> &tria,
             {
               cell->face(i)->set_boundary_indicator(1);
               for (unsigned int j=0; j<GeometryInfo<3>::lines_per_face; ++j)
-               {
-                 const Point<3> vertices[2]
-                   = { cell->face(i)->line(j)->vertex(0),
-                       cell->face(i)->line(j)->vertex(1) };
-                 if ((std::fabs(vertices[0].distance(center)-radius) >
-                      1e-5*radius)
-                     ||
-                     (std::fabs(vertices[1].distance(center)-radius) >
-                      1e-5*radius))
-                   cell->face(i)->line(j)->set_boundary_indicator(1);
-               }
+                {
+                  const Point<3> vertices[2]
+                    = { cell->face(i)->line(j)->vertex(0),
+                        cell->face(i)->line(j)->vertex(1)
+                      };
+                  if ((std::fabs(vertices[0].distance(center)-radius) >
+                       1e-5*radius)
+                      ||
+                      (std::fabs(vertices[1].distance(center)-radius) >
+                       1e-5*radius))
+                    cell->face(i)->line(j)->set_boundary_indicator(1);
+                }
             }
         }
       ++cell;
@@ -2810,7 +2813,7 @@ GridGenerator::hyper_shell (Triangulation<3> &tria,
                             const Point<3> &p,
                             const double inner_radius,
                             const double outer_radius,
-                            const unsigned int n,
+                            const size_type n,
                             const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -3039,7 +3042,7 @@ GridGenerator::half_hyper_shell (Triangulation<3> &tria,
                                  const Point<3> &center,
                                  const double inner_radius,
                                  const double outer_radius,
-                                 const unsigned int n,
+                                 const size_type n,
                                  const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -3185,7 +3188,7 @@ void GridGenerator::quarter_hyper_shell (Triangulation<3> &tria,
                                          const Point<3> &center,
                                          const double inner_radius,
                                          const double outer_radius,
-                                         const unsigned int n,
+                                         const size_type n,
                                          const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -3245,12 +3248,12 @@ void GridGenerator::quarter_hyper_shell (Triangulation<3> &tria,
 
 // Implementation for 3D only
 template <>
-void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
-                                    const double        length,
-                                    const double        inner_radius,
-                                    const double        outer_radius,
-                                    const unsigned int  n_radial_cells,
-                                    const unsigned int  n_axial_cells)
+void GridGenerator::cylinder_shell (Triangulation<3> &tria,
+                                    const double      length,
+                                    const double      inner_radius,
+                                    const double      outer_radius,
+                                    const size_type   n_radial_cells,
+                                    const size_type   n_axial_cells)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
           ExcInvalidRadii ());
@@ -3266,16 +3269,16 @@ void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
   // radial extent (which is the
   // difference between the two
   // radii)
-  const unsigned int N_r = (n_radial_cells == 0 ?
-                            static_cast<unsigned int>
-                            (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
-                                       (outer_radius - inner_radius))) :
-                            n_radial_cells);
-  const unsigned int N_z = (n_axial_cells == 0 ?
-                            static_cast<unsigned int>
-                            (std::ceil (length /
-                                        (2*pi*(outer_radius + inner_radius)/2/N_r))) :
-                            n_axial_cells);
+  const size_type N_r = (n_radial_cells == 0 ?
+                         static_cast<size_type>
+                         (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
+                                    (outer_radius - inner_radius))) :
+                         n_radial_cells);
+  const size_type N_z = (n_axial_cells == 0 ?
+                         static_cast<size_type>
+                         (std::ceil (length /
+                                     (2*pi*(outer_radius + inner_radius)/2/N_r))) :
+                         n_axial_cells);
 
   // set up N vertices on the
   // outer and N vertices on
@@ -3284,7 +3287,7 @@ void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
   // outer one, and all are
   // numbered counter-clockwise
   std::vector<Point<2> > vertices_2d(2*N_r);
-  for (unsigned int i=0; i<N_r; ++i)
+  for (size_type i=0; i<N_r; ++i)
     {
       vertices_2d[i] = Point<2>( std::cos(2*pi * i/N_r),
                                  std::sin(2*pi * i/N_r)) * outer_radius;
@@ -3293,8 +3296,8 @@ void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
 
   std::vector<Point<3> > vertices_3d;
   vertices_3d.reserve (2*N_r*(N_z+1));
-  for (unsigned int j=0; j<=N_z; ++j)
-    for (unsigned int i=0; i<2*N_r; ++i)
+  for (size_type j=0; j<=N_z; ++j)
+    for (size_type i=0; i<2*N_r; ++i)
       {
         const Point<3> v (vertices_2d[i][0],
                           vertices_2d[i][1],
@@ -3304,8 +3307,8 @@ void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
 
   std::vector<CellData<3> > cells (N_r*N_z, CellData<3>());
 
-  for (unsigned int j=0; j<N_z; ++j)
-    for (unsigned int i=0; i<N_r; ++i)
+  for (size_type j=0; j<N_z; ++j)
+    for (size_type i=0; i<N_r; ++i)
       {
         cells[i+j*N_r].vertices[0] = i + (j+1)*2*N_r;
         cells[i+j*N_r].vertices[1] = (i+1)%N_r + (j+1)*2*N_r;
@@ -3381,7 +3384,7 @@ merge_triangulations (const Triangulation<dim, spacedim> &triangulation_1,
 void
 GridGenerator::
 extrude_triangulation(const Triangulation<2, 2> &input,
-                      const unsigned int n_slices,
+                      const size_type n_slices,
                       const double height,
                       Triangulation<3,3> &result)
 {
@@ -3395,9 +3398,9 @@ extrude_triangulation(const Triangulation<2, 2> &input,
   std::vector<CellData<3> > cells;
   cells.reserve((n_slices-1)*input.n_active_cells());
 
-  for (unsigned int slice=0; slice<n_slices; ++slice)
+  for (size_type slice=0; slice<n_slices; ++slice)
     {
-      for (unsigned int i=0; i<input.n_vertices(); ++i)
+      for (size_type i=0; i<input.n_vertices(); ++i)
 
         {
           const Point<2> &v = input.get_vertices()[i];
@@ -3410,7 +3413,7 @@ extrude_triangulation(const Triangulation<2, 2> &input,
   for (Triangulation<2,2>::cell_iterator
        cell = input.begin(); cell != input.end(); ++cell)
     {
-      for (unsigned int slice=0; slice<n_slices-1; ++slice)
+      for (size_type slice=0; slice<n_slices-1; ++slice)
         {
           CellData<3> this_cell;
           for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
@@ -3438,7 +3441,7 @@ extrude_triangulation(const Triangulation<2, 2> &input,
           {
             quad.boundary_id = cell->face(f)->boundary_indicator();
             bid = std::max(bid, quad.boundary_id);
-            for (unsigned int slice=0; slice<n_slices-1; ++slice)
+            for (size_type slice=0; slice<n_slices-1; ++slice)
               {
                 quad.vertices[0] = cell->face(f)->vertex_index(0)+slice*input.n_vertices();
                 quad.vertices[1] = cell->face(f)->vertex_index(1)+slice*input.n_vertices();
@@ -3482,10 +3485,10 @@ extrude_triangulation(const Triangulation<2, 2> &input,
 // this is not necessary here as this is an internal only function.
 inline
 void GridGenerator::laplace_solve (const SparseMatrix<double> &S,
-                                   const std::map<unsigned int,double> &m,
+                                   const std::map<size_type,double> &m,
                                    Vector<double> &u)
 {
-  const unsigned int n_dofs=S.n();
+  const size_type n_dofs=S.n();
   FilteredMatrix<Vector<double> > SF (S);
   PreconditionJacobi<SparseMatrix<double> > prec;
   prec.initialize(S, 1.2);
@@ -3506,7 +3509,7 @@ void GridGenerator::laplace_solve (const SparseMatrix<double> &S,
 // Implementation for 1D only
 template <>
 void GridGenerator::laplace_transformation (Triangulation<1> &,
-                                            const std::map<unsigned int,Point<1> > &)
+                                            const std::map<size_type,Point<1> > &)
 {
   Assert(false, ExcNotImplemented());
 }
@@ -3515,7 +3518,7 @@ void GridGenerator::laplace_transformation (Triangulation<1> &,
 // Implementation for dimensions except 1
 template <int dim>
 void GridGenerator::laplace_transformation (Triangulation<dim> &tria,
-                                            const std::map<unsigned int,Point<dim> > &new_points)
+                                            const std::map<size_type,Point<dim> > &new_points)
 {
   // first provide everything that is
   // needed for solving a Laplace
@@ -3543,9 +3546,9 @@ void GridGenerator::laplace_transformation (Triangulation<dim> &tria,
 
   // set up the boundary values for
   // the laplace problem
-  std::vector<std::map<unsigned int,double> > m(dim);
-  typename std::map<unsigned int,Point<dim> >::const_iterator map_iter;
-  typename std::map<unsigned int,Point<dim> >::const_iterator map_end=new_points.end();
+  std::vector<std::map<size_type,double> > m(dim);
+  typename std::map<size_type,Point<dim> >::const_iterator map_iter;
+  typename std::map<size_type,Point<dim> >::const_iterator map_end=new_points.end();
 
   // fill these maps using the data
   // given by new_points
@@ -3562,12 +3565,12 @@ void GridGenerator::laplace_transformation (Triangulation<dim> &tria,
               for (unsigned int vertex_no=0;
                    vertex_no<GeometryInfo<dim>::vertices_per_face; ++vertex_no)
                 {
-                  const unsigned int vertex_index=face->vertex_index(vertex_no);
+                  const size_type vertex_index=face->vertex_index(vertex_no);
                   map_iter=new_points.find(vertex_index);
 
                   if (map_iter!=map_end)
                     for (unsigned int i=0; i<dim; ++i)
-                      m[i].insert(std::pair<unsigned int,double> (
+                      m[i].insert(std::pair<size_type,double> (
                                     face->vertex_dof_index(vertex_no, 0), map_iter->second(i)));
                 }
           }
@@ -3590,11 +3593,11 @@ void GridGenerator::laplace_transformation (Triangulation<dim> &tria,
   // points of the triangulation
   // according to the computed values
   for (cell=dof_handler.begin_active(); cell!=endc; ++cell)
-    for (unsigned int vertex_no=0;
+    for (size_type vertex_no=0;
          vertex_no<GeometryInfo<dim>::vertices_per_cell; ++vertex_no)
       {
         Point<dim> &v=cell->vertex(vertex_no);
-        const unsigned int dof_index=cell->vertex_dof_index(vertex_no, 0);
+        const size_type dof_index=cell->vertex_dof_index(vertex_no, 0);
         for (unsigned int i=0; i<dim; ++i)
           v(i)=us[i](dof_index);
       }
@@ -3607,7 +3610,7 @@ void GridGenerator::hyper_cube_with_cylindrical_hole (Triangulation<1> &,
                                                       const double,
                                                       const double,
                                                       const double,
-                                                      const unsigned int,
+                                                      const size_type,
                                                       bool)
 {
   Assert(false, ExcNotImplemented());
@@ -3621,7 +3624,7 @@ GridGenerator::hyper_cube_with_cylindrical_hole (Triangulation<2> &triangulation
                                                  const double inner_radius,
                                                  const double outer_radius,
                                                  const double, // width,
-                                                 const unsigned int, // width_repetition,
+                                                 const size_type, // width_repetition,
                                                  bool colorize)
 {
   const int dim = 2;
@@ -3645,7 +3648,7 @@ GridGenerator::hyper_cube_with_cylindrical_hole (Triangulation<2> &triangulation
           {
             for (unsigned int v=0; v < GeometryInfo<dim>::vertices_per_face; ++v)
               {
-                unsigned int vv = cell->face(f)->vertex_index(v);
+                size_type vv = cell->face(f)->vertex_index(v);
                 if (treated_vertices[vv] == false)
                   {
                     treated_vertices[vv] = true;
@@ -3708,7 +3711,7 @@ void GridGenerator::hyper_cube_with_cylindrical_hole(Triangulation<3> &triangula
                                                      const double inner_radius,
                                                      const double outer_radius,
                                                      const double L,
-                                                     const unsigned int Nz,
+                                                     const size_type Nz,
                                                      bool colorize)
 {
   const int dim = 3;
@@ -3735,11 +3738,11 @@ void GridGenerator::hyper_cube_with_cylindrical_hole(Triangulation<3> &triangula
           {
             for (unsigned int v=0; v < GeometryInfo<dim>::vertices_per_face; ++v)
               {
-                unsigned int vv = cell->face(f)->vertex_index(v);
+                size_type vv = cell->face(f)->vertex_index(v);
                 if (treated_vertices[vv] == false)
                   {
                     treated_vertices[vv] = true;
-                    for (unsigned int i=0; i<=Nz; ++i)
+                    for (size_type i=0; i<=Nz; ++i)
                       {
                         double d = ((double) i)*L/((double) Nz);
                         switch (vv-i*16)
index 5444c06e09c26fd569e239f55a6c874bcc21f370..fadcea0bc79024596630f0fb46e782b97f07c0ff 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
@@ -73,14 +77,14 @@ for (deal_II_dimension : DIMENSIONS)
     template void
       GridGenerator::subdivided_parallelepiped<deal_II_dimension> (
        Triangulation<deal_II_dimension>&,
-       const unsigned int,
+       const size_type,
        const Point<deal_II_dimension> (&) [deal_II_dimension], 
        const bool);  
 
     template void
       GridGenerator::subdivided_parallelepiped<deal_II_dimension> (
        Triangulation<deal_II_dimension>&,
-       const unsigned int [deal_II_dimension], 
+       const size_type [deal_II_dimension], 
        const Point<deal_II_dimension> (&) [deal_II_dimension], 
        const bool);  
   
@@ -88,7 +92,7 @@ for (deal_II_dimension : DIMENSIONS)
   template void
     GridGenerator::
     laplace_transformation<deal_II_dimension> (Triangulation<deal_II_dimension> &,
-                                              const std::map<unsigned int,Point<deal_II_dimension> > &);
+                                              const std::map<types::global_dof_index,Point<deal_II_dimension> > &);
 #endif
   
   
index e49aea76f8691b866787367d8624a1d708a43f95..158de1331a830ee0aca77bb4f3597f939abb65fc 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/path_search.h>
 #include <deal.II/base/utilities.h>
index 613147debbcfcdd70883a6e0b92c12aad18483a0..ff205bac0c15388b723e08f10acd1e33a9646eab 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
   {
index 837063c9ef030eaa383d40ec704b3fd449691990..839f3ff04b58f2b5fea893e7addef4c3233a243e 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/grid/grid_out.h>
 #include <deal.II/base/parameter_handler.h>
@@ -1363,7 +1365,7 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
   unsigned int n_levels = 0;
   unsigned int n_subdomains = 0;
   unsigned int n_level_subdomains = 0;
-  
+
   unsigned int n = 0;
 
   unsigned int min_level, max_level;
@@ -1437,7 +1439,7 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
 
   // auxiliary array for the level subdomains being used
   int level_subdomains[256];
-  for(int level_subdomain_index = 0; level_subdomain_index < 256; level_subdomain_index++)
+  for (int level_subdomain_index = 0; level_subdomain_index < 256; level_subdomain_index++)
     level_subdomains[level_subdomain_index] = 0;
 
   // We use an active cell iterator to determine the
@@ -1458,9 +1460,10 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
       if ((unsigned int)cell->level() < min_level) min_level = cell->level();
       if ((unsigned int)cell->level() > max_level) max_level = cell->level();
 
-      materials[(unsigned int)cell->material_id()] = 1;      
+      materials[(unsigned int)cell->material_id()] = 1;
       levels[(unsigned int)cell->level()] = 1;
-      subdomains[cell->subdomain_id()+2] = 1;
+      if (cell->active())
+        subdomains[cell->subdomain_id()+2] = 1;
       level_subdomains[cell->level_subdomain_id()+2] = 1;
     }
 
@@ -1486,14 +1489,14 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
     }
 
   // count the level subdomains being used
-  for(int level_subdomain_index = 0; level_subdomain_index < 256; level_subdomain_index++)
-  {
-    if(level_subdomains[level_subdomain_index]) n_level_subdomains++;
-  }
+  for (int level_subdomain_index = 0; level_subdomain_index < 256; level_subdomain_index++)
+    {
+      if (level_subdomains[level_subdomain_index]) n_level_subdomains++;
+    }
 
   switch (svg_flags.coloring)
     {
-      case GridOutFlags::Svg::material_id:
+    case GridOutFlags::Svg::material_id:
       n = n_materials;
       break;
     case GridOutFlags::Svg::level_number:
@@ -1502,7 +1505,8 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
     case GridOutFlags::Svg::subdomain_id:
       n = n_subdomains;
       break;
-    case GridOutFlags::Svg::level_subdomain_id: n = n_level_subdomains;
+    case GridOutFlags::Svg::level_subdomain_id:
+      n = n_level_subdomains;
       break;
     default:
       break;
@@ -1656,7 +1660,7 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
   x_dimension_perspective = x_max_perspective - x_min_perspective;
   y_dimension_perspective = y_max_perspective - y_min_perspective;
 
-  cell_label_font_size = static_cast<unsigned int>(.5 + (height/100.) * 2.75) * 9. * (min_level_min_vertex_distance / std::min(x_dimension, y_dimension));
+  cell_label_font_size = static_cast<unsigned int>((int)(.5 + (height/100.) * 2.75) * 9. * (min_level_min_vertex_distance / std::min(x_dimension, y_dimension)));
 
 
 // create the svg file with an internal style sheet
@@ -1767,9 +1771,9 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
             case GridOutFlags::Svg::subdomain_id:
               while (!subdomains[labeling_index]) labeling_index++;
               break;
-           case GridOutFlags::Svg::level_subdomain_id:
-             while(!level_subdomains[labeling_index]) labeling_index++;
-             break;
+            case GridOutFlags::Svg::level_subdomain_id:
+              while (!level_subdomains[labeling_index]) labeling_index++;
+              break;
             default:
               break;
             }
@@ -1846,11 +1850,14 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
                   out << (unsigned int)cell->level();
                   break;
                 case GridOutFlags::Svg::subdomain_id:
-                  out << cell->subdomain_id() + 2;
+                  if (cell->active())
+                    out << cell->subdomain_id() + 2;
+                  else
+                    out << 'X';
+                  break;
+                case GridOutFlags::Svg::level_subdomain_id:
+                  out << cell->level_subdomain_id() + 2;
                   break;
-               case GridOutFlags::Svg::level_subdomain_id:
-                 out << cell->level_subdomain_id() + 2;
-                 break;
                 default:
                   break;
                 }
@@ -1958,19 +1965,25 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
 
               if (svg_flags.label_subdomain_id)
                 {
-                  if (svg_flags.label_level_number || svg_flags.label_cell_index || svg_flags.label_material_id) out << ',';
-                  out << static_cast<int>(cell->subdomain_id());
+                  if (svg_flags.label_level_number
+                      || svg_flags.label_cell_index
+                      || svg_flags.label_material_id)
+                    out << ',';
+                  if (cell->active())
+                    out << static_cast<int>(cell->subdomain_id());
+                  else
+                    out << 'X';
                 }
 
-             if(svg_flags.label_level_subdomain_id)
-               {
-                 if(svg_flags.label_level_number
-                    || svg_flags.label_cell_index
-                    || svg_flags.label_material_id
-                    || svg_flags.label_subdomain_id)
-                   out << ',';
-                 out << static_cast<int>(cell->level_subdomain_id());
-               }
+              if (svg_flags.label_level_subdomain_id)
+                {
+                  if (svg_flags.label_level_number
+                      || svg_flags.label_cell_index
+                      || svg_flags.label_material_id
+                      || svg_flags.label_subdomain_id)
+                    out << ',';
+                  out << static_cast<int>(cell->level_subdomain_id());
+                }
 
               out << "</text>" << '\n';
             }
@@ -2091,21 +2104,21 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
               << "\">"
               << "subdomain_id";
 
-         if(svg_flags.label_level_subdomain_id)
-           out << ',';
+          if (svg_flags.label_level_subdomain_id)
+            out << ',';
 
           out << "</text>" << '\n';
         }
 
-      if(svg_flags.label_level_subdomain_id)
-       {
-         out << "  <text x= \"" << width + additional_width + static_cast<unsigned int>(.5 + (height/100.) * 2.)
-             << "\" y=\""       << static_cast<unsigned int>(.5 + (height/100.) * margin_in_percent + (++line_offset) * 1.5 * font_size )
-             << "\" style=\"text-anchor:start; font-style:oblique; font-size:" << font_size
-             << "\">"
-             << "level_subdomain_id"
-             << "</text>" << '\n';
-       }
+      if (svg_flags.label_level_subdomain_id)
+        {
+          out << "  <text x= \"" << width + additional_width + static_cast<unsigned int>(.5 + (height/100.) * 2.)
+              << "\" y=\""       << static_cast<unsigned int>(.5 + (height/100.) * margin_in_percent + (++line_offset) * 1.5 * font_size )
+              << "\" style=\"text-anchor:start; font-style:oblique; font-size:" << font_size
+              << "\">"
+              << "level_subdomain_id"
+              << "</text>" << '\n';
+        }
     }
 
   // show azimuth angle and polar angle as text below the explanation of the cell labeling
@@ -2138,8 +2151,9 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
         case 3:
           out << "subdomain_id";
           break;
-       case 4: out << "level_subdomain_id";
-         break;
+        case 4:
+          out << "level_subdomain_id";
+          break;
         default:
           break;
         }
@@ -2164,8 +2178,9 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const
             case GridOutFlags::Svg::subdomain_id:
               while (!subdomains[labeling_index]) labeling_index++;
               break;
-           case GridOutFlags::Svg::level_subdomain_id: while(!level_subdomains[labeling_index]) labeling_index++;
-             break;
+            case GridOutFlags::Svg::level_subdomain_id:
+              while (!level_subdomains[labeling_index]) labeling_index++;
+              break;
             default:
               break;
             }
@@ -2285,11 +2300,11 @@ void GridOut::write_mathgl (const Triangulation<dim> &tria,
     {
     case 2:
       out << "\nlist f 0 1 2 3"
-         << "\n";
+          << "\n";
       break;
     case 3:
       out << "\nlist f 0 2 4 6 | 1 3 5 7 | 0 4 1 5 | 2 6 3 7 | 0 1 2 3 | 4 5 6 7"
-         << "\n";
+          << "\n";
       break;
     default:
       Assert (false, ExcNotImplemented ());
index 1a470c9a47eef563dbe091da4cf8ae0825d1bf77..1da4845a0be6bc2f172437aa7b99627a8bba29b5 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index e0a3acdaebdc7cb365db1150223ec4baa652d42c..1de5c7b1acba704de80b05b2a5f9220773311a61 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/template_constraints.h>
 #include <deal.II/lac/vector.h>
index 366c0f8324feb07234dff38b66c6829b022e73aa..9116a20fb34f1abbd0809355dadc25349488ec56 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 
index dd8aeee74d210faf8e9e5780023ebdc0c5c5e58a..b5d385272a99f63ac9b36a5d5b8873f352fd8a4f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//   grid_reordering.cc,v 1.27 2002/05/28 07:43:22 wolf Exp
-//   Version:
+// ---------------------------------------------------------------------
+// $Id$
 //
-//   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//   This file is subject to QPL and may not be  distributed
-//   without copyright and license information. Please refer
-//   to the file deal.II/doc/license.html for the  text  and
-//   further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_reordering_internal.h>
index 7ee013a043059a58407e652452b78bc4ab23020a..ed2325f2b1b3d731c11535acad745685ed489c48 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/std_cxx1x/array.h>
 #include <deal.II/base/quadrature_lib.h>
@@ -605,7 +607,7 @@ namespace GridTools
 
   template <int dim>
   void
-  laplace_transform (const std::map<unsigned int,Point<dim> > &new_points,
+  laplace_transform (const std::map<types::global_dof_index,Point<dim> > &new_points,
                      Triangulation<dim> &triangulation)
   {
     //TODO: Move implementation of this function into the current
@@ -1245,7 +1247,6 @@ next_cell:
 
     // finally loop over all cells and set the
     // subdomain ids
-    std::vector<unsigned int> dof_indices(1);
     unsigned int index = 0;
     for (typename Triangulation<dim,spacedim>::active_cell_iterator
          cell = triangulation.begin_active();
index 22aed5c106e65cc87d9a19fe32e6f3abcc998397..9087a8e74f8f2b41c6f7d5c586eae45086707dc7 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
@@ -157,7 +161,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
 #if deal_II_dimension == deal_II_space_dimension  
     template
     void
-    laplace_transform (const std::map<unsigned int,Point<deal_II_dimension> > &new_points,
+    laplace_transform (const std::map<types::global_dof_index,Point<deal_II_dimension> > &new_points,
                        Triangulation<deal_II_dimension> &triangulation);
 
     template
index 0ca057880688c549009d21306ae27f7e74e47531..47575ab7d394e1ef3399d3d9cd1f9b11cbb6ab4d 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/smartpointer.h>
index cd766fd4f47cc90141ffb09d23394b8466650090..392ba342ddade1bf55ef47b5c61275ddaeca222f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS)
index 7e6a7d5e1d09c628628ca8eca4c617f24c755d3d..376b4222403b74b8c8b3ebe5ffbf19f08edbac67 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/grid/persistent_tria.h>
index 99ff9be217cd3ad8391b628e0028880abd2e00e6..a29e247a5edd9d50a1dfece41d7cce5c549ae8d9 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/table.h>
@@ -157,7 +161,7 @@ namespace
 
 
 
-  // return, wheter a given @p cell will be
+  // return, whether a given @p cell will be
   // coarsened, which is the case if all
   // children are active and have their coarsen
   // flag set. In case only part of the coarsen
@@ -2071,7 +2075,7 @@ namespace internal
         // first, we only collect the data
         // now
 
-        // the bool array stores, wether the lines
+        // the bool array stores, whether the lines
         // are in the standard orientation or not
 
         // note that QuadComparator is a
@@ -2596,7 +2600,7 @@ namespace internal
 
             else
               {
-                // look wether it exists in
+                // look whether it exists in
                 // reverse direction
                 std::swap (line_vertices.first, line_vertices.second);
                 if (needed_lines.find(line_vertices) != needed_lines.end())
@@ -2656,7 +2660,7 @@ namespace internal
                 if (needed_lines.find(line_vertices) != needed_lines.end())
                   line[i] = needed_lines[line_vertices];
                 else
-                  // look wether it exists
+                  // look whether it exists
                   // in reverse direction
                   {
                     std::swap (line_vertices.first, line_vertices.second);
@@ -4259,6 +4263,7 @@ namespace internal
                                             new_lines[5]->index()));
           }
 
+        types::subdomain_id subdomainid = cell->subdomain_id();
 
         for (unsigned int i=0; i<n_children; ++i)
           {
@@ -4271,7 +4276,7 @@ namespace internal
             // properties
             subcells[i]->set_material_id (cell->material_id());
            subcells[i]->set_manifold_id (cell->manifold_id());
-            subcells[i]->set_subdomain_id (cell->subdomain_id());
+            subcells[i]->set_subdomain_id (subdomainid);
 
             if (i%2==0)
               subcells[i]->set_parent (cell->index ());
@@ -4467,6 +4472,8 @@ namespace internal
                   second_child->set_used_flag ();
                   second_child->clear_user_data ();
 
+                  types::subdomain_id subdomainid = cell->subdomain_id();
+
                   // insert first child
                   cell->set_children (0, first_child->index());
                   first_child->clear_children ();
@@ -4475,7 +4482,7 @@ namespace internal
                                                      next_unused_vertex));
                   first_child->set_material_id (cell->material_id());
                  first_child->set_manifold_id (cell->manifold_id());
-                  first_child->set_subdomain_id (cell->subdomain_id());
+                  first_child->set_subdomain_id (subdomainid);
                   first_child->set_direction_flag (cell->direction_flag());
                  
                   first_child->set_parent (cell->index ());
@@ -4543,7 +4550,7 @@ namespace internal
                   second_child->set_neighbor (0, first_child);
                   second_child->set_material_id (cell->material_id());
                  second_child->set_manifold_id (cell->manifold_id());
-                  second_child->set_subdomain_id (cell->subdomain_id());
+                  second_child->set_subdomain_id (subdomainid);
                   second_child->set_direction_flag (cell->direction_flag());
 
                   if (cell->neighbor(1).state() != IteratorState::valid)
@@ -6489,6 +6496,8 @@ namespace internal
                         new_quads[i]->set_line_orientation(j,true);
                     }
 
+                  types::subdomain_id subdomainid = hex->subdomain_id();
+
                   // find some space for the newly to
                   // be created hexes and initialize
                   // them.
@@ -6513,7 +6522,7 @@ namespace internal
                       // properties
                       new_hexes[i]->set_material_id (hex->material_id());
                      new_hexes[i]->set_manifold_id (hex->manifold_id());
-                      new_hexes[i]->set_subdomain_id (hex->subdomain_id());
+                      new_hexes[i]->set_subdomain_id (subdomainid);
 
                       if (i%2)
                         new_hexes[i]->set_parent (hex->index ());
@@ -9398,7 +9407,7 @@ namespace internal
 
       /**
        * Helper function for
-       * @p fix_coarsen_flags. Return wether
+       * @p fix_coarsen_flags. Return whether
        * coarsening of this cell is allowed.
        * Coarsening can be forbidden if the
        * neighboring cells are or will be
@@ -9455,7 +9464,7 @@ namespace internal
                   // to the common neighbor cell,
                   // not to its children. what we
                   // really want to know in the
-                  // following is, wether the
+                  // following is, whether the
                   // neighbor cell is refined twice
                   // with reference to our cell.
                   // that only has to be asked, if
@@ -9862,7 +9871,7 @@ create_triangulation (const std::vector<Point<spacedim> >    &v,
       Its entries are indexes by the local indeces of the common face.
       For example if two elements share a face, and this face is
       face 0 for element 0 and face 1 for element 1, then
-      table(0,1) will tell wether the orientation are the same (true) or
+      table(0,1) will tell whether the orientation are the same (true) or
       opposite (false).
 
       Even though there may be a combinatorial/graph theory argument to get
@@ -11113,18 +11122,11 @@ template <int dim, int spacedim>
 typename Triangulation<dim,spacedim>::cell_iterator
 Triangulation<dim,spacedim>::last () const
 {
-  return last (levels.size()-1);
-}
-
+  const unsigned int level = levels.size()-1;
 
-
-template <int dim, int spacedim>
-typename Triangulation<dim,spacedim>::cell_iterator
-Triangulation<dim,spacedim>::last (const unsigned int level) const
-{
-  Assert (level<levels.size(), ExcInvalidLevel(level));
-  Assert (levels[level]->cells.cells.size() != 0,
-          ExcEmptyLevel (level));
+  Assert (level<n_global_levels() || level<levels.size(), ExcInvalidLevel(level));
+  if (levels[level]->cells.cells.size() ==0)
+    return end(level);
 
   // find the last raw iterator on
   // this level
@@ -11150,30 +11152,15 @@ Triangulation<dim,spacedim>::last_active () const
   // get the last used cell
   cell_iterator cell = last();
 
-  // then move to the last active one
-  if (cell->active()==true)
-    return cell;
-  while ((--cell).state() == IteratorState::valid)
-    if (cell->active()==true)
-      return cell;
-  return cell;
-}
-
-
-
-template <int dim, int spacedim>
-typename Triangulation<dim,spacedim>::active_cell_iterator
-Triangulation<dim,spacedim>::last_active (const unsigned int level) const
-{
-  // get the last used cell on this level
-  cell_iterator cell = last(level);
-
-  // then move to the last active one
-  if (cell->active()==true)
-    return cell;
-  while ((--cell).state() == IteratorState::valid)
-    if (cell->active()==true)
-      return cell;
+  if (cell != end())
+    {
+      // then move to the last active one
+      if (cell->active()==true)
+        return cell;
+      while ((--cell).state() == IteratorState::valid)
+        if (cell->active()==true)
+          return cell;
+    }
   return cell;
 }
 
@@ -11194,9 +11181,11 @@ template <int dim, int spacedim>
 typename Triangulation<dim, spacedim>::raw_cell_iterator
 Triangulation<dim, spacedim>::end_raw (const unsigned int level) const
 {
-  return (level == levels.size()-1 ?
-          end() :
-          begin_raw (level+1));
+  Assert (level<n_global_levels(), ExcInvalidLevel(level));
+  if (level < levels.size()-1)
+    return begin_raw (level+1);
+  else
+    return end();
 }
 
 
@@ -11204,9 +11193,10 @@ template <int dim, int spacedim>
 typename Triangulation<dim, spacedim>::cell_iterator
 Triangulation<dim, spacedim>::end (const unsigned int level) const
 {
-  return (level == levels.size()-1 ?
-          cell_iterator(end()) :
-          begin (level+1));
+  if (level < levels.size()-1)
+    return begin (level+1);
+  Assert (level<n_global_levels() || level<levels.size(), ExcInvalidLevel(level));
+  return end();
 }
 
 
@@ -11298,10 +11288,10 @@ Triangulation<dim, spacedim>::begin_raw_line (const unsigned int level) const
   switch (dim)
     {
     case 1:
-      Assert (level<levels.size(), ExcInvalidLevel(level));
+      Assert (level<n_global_levels() || level<levels.size(), ExcInvalidLevel(level));
 
-      if (levels[level]->cells.cells.size() == 0)
-        return end_line ();
+      if (level >= levels.size() || levels[level]->cells.cells.size() == 0)
+        return end_line();
 
       return raw_line_iterator (const_cast<Triangulation<dim,spacedim>*>(this),
                                 level,
@@ -11373,9 +11363,9 @@ Triangulation<dim,spacedim>::begin_raw_quad (const unsigned int level) const
       return raw_hex_iterator();
     case 2:
     {
-      Assert (level<levels.size(), ExcInvalidLevel(level));
+      Assert (level<n_global_levels() || level<levels.size(), ExcInvalidLevel(level));
 
-      if (levels[level]->cells.cells.size() == 0)
+      if (level >= levels.size() || levels[level]->cells.cells.size() == 0)
         return end_quad();
 
       return raw_quad_iterator (const_cast<Triangulation<dim,spacedim>*>(this),
@@ -11458,9 +11448,9 @@ Triangulation<dim,spacedim>::begin_raw_hex (const unsigned int level) const
       return raw_hex_iterator();
     case 3:
     {
-      Assert (level<levels.size(), ExcInvalidLevel(level));
+      Assert (level<n_global_levels() || level<levels.size(), ExcInvalidLevel(level));
 
-      if (levels[level]->cells.cells.size() == 0)
+      if (level >= levels.size() || levels[level]->cells.cells.size() == 0)
         return end_hex();
 
       return raw_hex_iterator (const_cast<Triangulation<dim,spacedim>*>(this),
@@ -12339,11 +12329,12 @@ void Triangulation<dim, spacedim>::execute_coarsening ()
   // deleted (if the latter are on a
   // higher level for example)
   //
-  // if there is only one level,
-  // there can not be anything to do
+  // since we delete the *children* of cells, we can ignore cells
+  // on the highest level, i.e., level must be less than or equal
+  // to n_levels()-2.
   if (levels.size() >= 2)
-    for (cell = last(levels.size()-2); cell!=endc; --cell)
-      if (cell->user_flag_set())
+    for (cell = last(); cell!=endc; --cell)
+      if (cell->level()<=static_cast<int>(levels.size()-2) && cell->user_flag_set())
         // use a separate function,
         // since this is dimension
         // specific
@@ -13726,7 +13717,7 @@ bool Triangulation<dim,spacedim>::prepare_coarsening_and_refinement ()
       //    next global loop. when this
       //    function terminates, the
       //    requirement will be
-      //    fullfilled. However, it might be
+      //    fulfilled. However, it might be
       //    faster to insert an inner loop
       //    here.
       bool changed = true;
index 1be216faebe69fbd23e48a7ead7b1cad973e4469..66e61c2864ffcd7b54043927fcf70ab2a689782a 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index f91265003266e540009f5d5b068df6a431074c80..0a94641d9c532f156f1d344cedc5e4e64ba43022 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_levels.h>
@@ -1355,6 +1357,7 @@ template <int dim, int spacedim>
 types::subdomain_id CellAccessor<dim, spacedim>::subdomain_id () const
 {
   Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
+  Assert (this->active(), ExcMessage("subdomains only work on active cells!"));
   return this->tria->levels[this->present_level]->subdomain_ids[this->present_index];
 }
 
@@ -1365,6 +1368,7 @@ void
 CellAccessor<dim, spacedim>::set_subdomain_id (const types::subdomain_id new_subdomain_id) const
 {
   Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
+  Assert (this->active(), ExcMessage("subdomains only work on active cells!"));
   this->tria->levels[this->present_level]->subdomain_ids[this->present_index]
     = new_subdomain_id;
 }
@@ -1435,11 +1439,11 @@ void
 CellAccessor<dim, spacedim>::
 recursively_set_subdomain_id (const types::subdomain_id new_subdomain_id) const
 {
-  set_subdomain_id (new_subdomain_id);
-
   if (this->has_children())
     for (unsigned int c=0; c<this->n_children(); ++c)
       this->child(c)->recursively_set_subdomain_id (new_subdomain_id);
+  else
+    set_subdomain_id (new_subdomain_id);
 }
 
 
index 1aed96c4f72adbf572c10e9c93e046bd3ecba459..fbf7755c7670d9797cad470ae3c5c5e630f37702 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 247b780afced1cd986c46a289fb700576f0790f9..f956c1d16c3a4886733683590c5c18461597a794 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/tensor.h>
 #include <deal.II/grid/tria_boundary.h>
index 7d3392dd1d345441d41d30ff5f7e042d37eeb804..3e44346c13e9bda9e1e96641368be0cf383d21fe 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
index d756a32a833b40ec8e7fff3e927fc78213e4375a..df1f4e991126968a1602937a0df630f9d5b536c4 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/grid/tria_boundary_lib.h>
 #include <deal.II/grid/tria.h>
@@ -841,10 +843,10 @@ get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) c
   if ((line_center(0) == this->center(0))
       &&
       ((std::fabs(vertices[0].distance(this->center)-this->radius) >
-       1e-5*this->radius)
+        1e-5*this->radius)
        ||
        (std::fabs(vertices[1].distance(this->center)-this->radius) >
-       1e-5*this->radius)))
+        1e-5*this->radius)))
     return line_center;
   else
     return HyperBallBoundary<dim>::get_new_point_on_line (line);
index e175f58d3350089336ec5f0a1a8104a58a40d303..24af1048b7c768516b8d434d18c43fb0f999b3c2 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
   {
index 3c613a9927aafc0bc6b3b03250063dda46499c50..b9b57a2551c545d69672cedf20470d6766c70bb1 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/grid/tria_faces.h>
index c438a8578ea938fe10e9ce1a0b697dbbe18ea010..3fc8b1022ad3907555c4df86d0a79e929698fa6f 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/grid/tria_levels.h>
index b8e092d5c55692021adf4437573022519e7310e3..800d61de65b1c855775baf643642c0daf9975796 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/grid/tria_objects.h>
index 777e0ba6cb09e42e37fcd7058441690109b740b5..4f8448ed55fae8b4f171cc1b7d637e9b695f1ff6 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
   {
index cc6d71281628363d031dbc03578f29dfd9388c17..140accecb596b18ba5af5a45eca389ddffe05878 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index 54f743349ca2d2ae32779ba4bbbc33efd9a1b47a..280ab65a9a50285ec1a0ad5dea94c74585d6c57a 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/hp/dof_faces.h>
index 4dbeb003b9dd481906a52832387406fd57ba6886..0b4b865540e5cc5c2fccc76ea9250f35c066e5a3 100644 (file)
@@ -1,16 +1,18 @@
-//----------------------------  hp_dof_handler.cc  ------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  hp_dof_handler.cc  ------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/geometry_info.h>
@@ -263,7 +265,7 @@ namespace internal
           // already fill the
           // vertex_dofs_offsets field
           dof_handler.vertex_dofs_offsets.resize (dof_handler.tria->n_vertices(),
-                                                  numbers::invalid_unsigned_int);
+                                                  numbers::invalid_dof_index);
 
           unsigned int vertex_slots_needed = 0;
           for (unsigned int v=0; v<dof_handler.tria->n_vertices(); ++v)
@@ -286,7 +288,7 @@ namespace internal
           for (unsigned int v=0; v<dof_handler.tria->n_vertices(); ++v)
             if (dof_handler.tria->vertex_used(v) == true)
               {
-                unsigned int pointer = dof_handler.vertex_dofs_offsets[v];
+                types::global_dof_index pointer = dof_handler.vertex_dofs_offsets[v];
                 for (unsigned int fe=0; fe<dof_handler.finite_elements->size(); ++fe)
                   if (vertex_fe_association[fe][v] == true)
                     {
@@ -301,7 +303,7 @@ namespace internal
                     }
                 // finally place the end
                 // marker
-                dof_handler.vertex_dofs[pointer] = numbers::invalid_unsigned_int;
+                dof_handler.vertex_dofs[pointer] = numbers::invalid_dof_index;
               }
         }
 
@@ -323,9 +325,9 @@ namespace internal
          */
         template <int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_dofs_on_cell (const typename dealii::hp::DoFHandler<1,spacedim>::active_cell_iterator &cell,
-                                 unsigned int          next_free_dof)
+                                 types::global_dof_index                                                 next_free_dof)
         {
           const unsigned int dim = 1;
 
@@ -368,9 +370,9 @@ namespace internal
 
         template <int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_dofs_on_cell (const typename dealii::hp::DoFHandler<2,spacedim>::active_cell_iterator &cell,
-                                 unsigned int          next_free_dof)
+                                 types::global_dof_index                                                 next_free_dof)
         {
           const unsigned int dim = 2;
 
@@ -431,9 +433,9 @@ namespace internal
 
         template <int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_dofs_on_cell (const typename dealii::hp::DoFHandler<3,spacedim>::active_cell_iterator &cell,
-                                 unsigned int          next_free_dof)
+                                 types::global_dof_index                                                 next_free_dof)
         {
           const unsigned int dim = 3;
 
@@ -575,10 +577,11 @@ namespace internal
           for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
             {
               dof_handler.levels[level]->dof_object.dof_offsets
-                = std::vector<unsigned int> (dof_handler.tria->n_raw_lines(level),
-                                             DoFHandler<dim,spacedim>::invalid_dof_index);
+                = std::vector<types::global_dof_index> (
+                    dof_handler.tria->n_raw_lines(level),
+                    DoFHandler<dim,spacedim>::invalid_dof_index);
 
-              unsigned int next_free_dof = 0;
+              types::global_dof_index next_free_dof = 0;
               for (typename DoFHandler<dim,spacedim>::active_cell_iterator
                    cell=dof_handler.begin_active(level);
                    cell!=dof_handler.end_active(level); ++cell)
@@ -589,8 +592,8 @@ namespace internal
                   }
 
               dof_handler.levels[level]->dof_object.dofs
-                = std::vector<unsigned int> (next_free_dof,
-                                             DoFHandler<dim,spacedim>::invalid_dof_index);
+                = std::vector<types::global_dof_index> (next_free_dof,
+                                                        DoFHandler<dim,spacedim>::invalid_dof_index);
             }
 
           // safety check: make sure that
@@ -603,7 +606,7 @@ namespace internal
 #ifdef DEBUG
           for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
             {
-              unsigned int counter = 0;
+              types::global_dof_index counter = 0;
               for (typename DoFHandler<dim,spacedim>::cell_iterator
                    cell=dof_handler.begin_active(level);
                    cell!=dof_handler.end_active(level); ++cell)
@@ -691,10 +694,11 @@ namespace internal
           for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
             {
               dof_handler.levels[level]->dof_object.dof_offsets
-                = std::vector<unsigned int> (dof_handler.tria->n_raw_quads(level),
-                                             DoFHandler<dim,spacedim>::invalid_dof_index);
+                = std::vector<types::global_dof_index> (
+                    dof_handler.tria->n_raw_quads(level),
+                    DoFHandler<dim,spacedim>::invalid_dof_index);
 
-              unsigned int next_free_dof = 0;
+              types::global_dof_index next_free_dof = 0;
               for (typename DoFHandler<dim,spacedim>::active_cell_iterator
                    cell=dof_handler.begin_active(level);
                    cell!=dof_handler.end_active(level); ++cell)
@@ -705,8 +709,8 @@ namespace internal
                   }
 
               dof_handler.levels[level]->dof_object.dofs
-                = std::vector<unsigned int> (next_free_dof,
-                                             DoFHandler<dim,spacedim>::invalid_dof_index);
+                = std::vector<types::global_dof_index> (next_free_dof,
+                                                        DoFHandler<dim,spacedim>::invalid_dof_index);
             }
 
           // safety check: make sure that
@@ -719,7 +723,7 @@ namespace internal
 #ifdef DEBUG
           for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
             {
-              unsigned int counter = 0;
+              types::global_dof_index counter = 0;
               for (typename DoFHandler<dim,spacedim>::cell_iterator
                    cell=dof_handler.begin_active(level);
                    cell!=dof_handler.end_active(level); ++cell)
@@ -842,11 +846,11 @@ namespace internal
             // active ones will have a
             // non-invalid value later on
             dof_handler.faces->lines.dof_offsets
-              = std::vector<unsigned int> (dof_handler.tria->n_raw_lines(),
-                                           DoFHandler<dim,spacedim>::invalid_dof_index);
+              = std::vector<types::global_dof_index> (dof_handler.tria->n_raw_lines(),
+                                                      DoFHandler<dim,spacedim>::invalid_dof_index);
             dof_handler.faces->lines.dofs
-              = std::vector<unsigned int> (n_line_slots,
-                                           DoFHandler<dim,spacedim>::invalid_dof_index);
+              = std::vector<types::global_dof_index> (n_line_slots,
+                                                      DoFHandler<dim,spacedim>::invalid_dof_index);
 
             // with the memory now
             // allocated, loop over the
@@ -1055,10 +1059,10 @@ namespace internal
           for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
             {
               dof_handler.levels[level]->dof_object.dof_offsets
-                = std::vector<unsigned int> (dof_handler.tria->n_raw_hexs(level),
-                                             DoFHandler<dim,spacedim>::invalid_dof_index);
+                = std::vector<types::global_dof_index> (dof_handler.tria->n_raw_hexs(level),
+                                                        DoFHandler<dim,spacedim>::invalid_dof_index);
 
-              unsigned int next_free_dof = 0;
+              types::global_dof_index next_free_dof = 0;
               for (typename DoFHandler<dim,spacedim>::active_cell_iterator
                    cell=dof_handler.begin_active(level);
                    cell!=dof_handler.end_active(level); ++cell)
@@ -1069,8 +1073,8 @@ namespace internal
                   }
 
               dof_handler.levels[level]->dof_object.dofs
-                = std::vector<unsigned int> (next_free_dof,
-                                             DoFHandler<dim,spacedim>::invalid_dof_index);
+                = std::vector<types::global_dof_index> (next_free_dof,
+                                                        DoFHandler<dim,spacedim>::invalid_dof_index);
             }
 
           // safety check: make sure that
@@ -1083,7 +1087,7 @@ namespace internal
 #ifdef DEBUG
           for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
             {
-              unsigned int counter = 0;
+              types::global_dof_index counter = 0;
               for (typename DoFHandler<dim,spacedim>::cell_iterator
                    cell=dof_handler.begin_active(level);
                    cell!=dof_handler.end_active(level); ++cell)
@@ -1210,11 +1214,11 @@ namespace internal
             if (true)
               {
                 dof_handler.faces->quads.dof_offsets
-                  = std::vector<unsigned int> (dof_handler.tria->n_raw_quads(),
-                                               DoFHandler<dim,spacedim>::invalid_dof_index);
+                  = std::vector<types::global_dof_index> (dof_handler.tria->n_raw_quads(),
+                                                          DoFHandler<dim,spacedim>::invalid_dof_index);
                 dof_handler.faces->quads.dofs
-                  = std::vector<unsigned int> (n_quad_slots,
-                                               DoFHandler<dim,spacedim>::invalid_dof_index);
+                  = std::vector<types::global_dof_index> (n_quad_slots,
+                                                          DoFHandler<dim,spacedim>::invalid_dof_index);
               }
 
             // with the memory now
@@ -1419,7 +1423,7 @@ namespace internal
               // line_dofs_offsets field
               dof_handler.faces->lines.dof_offsets
               .resize (dof_handler.tria->n_raw_lines(),
-                       numbers::invalid_unsigned_int);
+                       numbers::invalid_dof_index);
 
               unsigned int line_slots_needed = 0;
               for (unsigned int line=0; line<dof_handler.tria->n_raw_lines(); ++line)
@@ -1457,7 +1461,7 @@ namespace internal
                         }
                     // finally place the end
                     // marker
-                    dof_handler.faces->lines.dofs[pointer] = numbers::invalid_unsigned_int;
+                    dof_handler.faces->lines.dofs[pointer] = numbers::invalid_dof_index;
                   }
             }
 
@@ -1477,8 +1481,10 @@ namespace internal
         unsigned int
         max_couplings_between_dofs (const DoFHandler<1,spacedim> &dof_handler)
         {
-          return std::min(3*dof_handler.finite_elements->max_dofs_per_vertex() +
-                          2*dof_handler.finite_elements->max_dofs_per_line(), dof_handler.n_dofs());
+          return std::min(static_cast<types::global_dof_index> (3*
+                                                                dof_handler.finite_elements->max_dofs_per_vertex() +
+                                                                2*dof_handler.finite_elements->max_dofs_per_line()),
+                          dof_handler.n_dofs());
         }
 
 
@@ -1509,7 +1515,7 @@ namespace internal
           // nodes)
           // count lines -> 28 (don't forget to count
           // mother and children separately!)
-          unsigned int max_couplings;
+          types::global_dof_index max_couplings;
           switch (dof_handler.tria->max_adjacent_cells())
             {
             case 4:
@@ -1562,7 +1568,7 @@ namespace internal
           // can anyone give better estimate here?
           const unsigned int max_adjacent_cells = dof_handler.tria->max_adjacent_cells();
 
-          unsigned int max_couplings;
+          types::global_dof_index max_couplings;
           if (max_adjacent_cells <= 8)
             max_couplings=7*7*7*dof_handler.finite_elements->max_dofs_per_vertex() +
                           7*6*7*3*dof_handler.finite_elements->max_dofs_per_line() +
@@ -1588,7 +1594,7 @@ namespace hp
   const unsigned int DoFHandler<dim,spacedim>::dimension;
 
   template<int dim, int spacedim>
-  const unsigned int DoFHandler<dim,spacedim>::invalid_dof_index;
+  const types::global_dof_index DoFHandler<dim,spacedim>::invalid_dof_index;
 
   template<int dim, int spacedim>
   const unsigned int DoFHandler<dim,spacedim>::default_fe_index;
@@ -1703,12 +1709,12 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<1>::n_boundary_dofs () const
+  types::global_dof_index DoFHandler<1>::n_boundary_dofs () const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
 
     DoFHandler<1,1>::cell_iterator cell;
-    unsigned int n = 0;
+    types::global_dof_index n = 0;
 
     // search left-most cell
     cell = this->begin_active();
@@ -1728,7 +1734,7 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
+  types::global_dof_index DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
 
@@ -1741,7 +1747,7 @@ namespace hp
               ExcInvalidBoundaryIndicator());
 
     DoFHandler<1,1>::active_cell_iterator cell;
-    unsigned int n = 0;
+    types::global_dof_index n = 0;
 
     // search left-most cell
     if (boundary_indicators.find (0) != boundary_indicators.end())
@@ -1767,7 +1773,7 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
+  types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
 
@@ -1780,7 +1786,7 @@ namespace hp
               ExcInvalidBoundaryIndicator());
 
     DoFHandler<1,1>::active_cell_iterator cell;
-    unsigned int n = 0;
+    types::global_dof_index n = 0;
 
     // search left-most cell
     if (boundary_indicators.find (0) != boundary_indicators.end())
@@ -1805,21 +1811,21 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<1,2>::n_boundary_dofs () const
+  types::global_dof_index DoFHandler<1,2>::n_boundary_dofs () const
   {
     Assert(false,ExcNotImplemented());
     return 0;
   }
 
   template <>
-  unsigned int DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &) const
+  types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &) const
   {
     Assert(false,ExcNotImplemented());
     return 0;
   }
 
   template <>
-  unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id> &) const
+  types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id> &) const
   {
     Assert(false,ExcNotImplemented());
     return 0;
@@ -1828,21 +1834,21 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<1,3>::n_boundary_dofs () const
+  types::global_dof_index DoFHandler<1,3>::n_boundary_dofs () const
   {
     Assert(false,ExcNotImplemented());
     return 0;
   }
 
   template <>
-  unsigned int DoFHandler<1,3>::n_boundary_dofs (const FunctionMap &) const
+  types::global_dof_index DoFHandler<1,3>::n_boundary_dofs (const FunctionMap &) const
   {
     Assert(false,ExcNotImplemented());
     return 0;
   }
 
   template <>
-  unsigned int DoFHandler<1,3>::n_boundary_dofs (const std::set<types::boundary_id> &) const
+  types::global_dof_index DoFHandler<1,3>::n_boundary_dofs (const std::set<types::boundary_id> &) const
   {
     Assert(false,ExcNotImplemented());
     return 0;
@@ -1850,12 +1856,12 @@ namespace hp
 
 
   template<int dim, int spacedim>
-  unsigned int DoFHandler<dim,spacedim>::n_boundary_dofs () const
+  types::global_dof_index DoFHandler<dim,spacedim>::n_boundary_dofs () const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
 
-    std::set<int> boundary_dofs;
-    std::vector<unsigned int> dofs_on_face;
+    std::set<types::global_dof_index> boundary_dofs;
+    std::vector<types::global_dof_index> dofs_on_face;
     dofs_on_face.reserve (this->get_fe ().max_dofs_per_face());
 
     // loop over all faces to check
@@ -1888,7 +1894,7 @@ namespace hp
 
 
   template<int dim, int spacedim>
-  unsigned int
+  types::global_dof_index
   DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
@@ -1898,8 +1904,8 @@ namespace hp
     // same as above, but with
     // additional checks for set of
     // boundary indicators
-    std::set<int> boundary_dofs;
-    std::vector<unsigned int> dofs_on_face;
+    std::set<types::global_dof_index> boundary_dofs;
+    std::vector<types::global_dof_index> dofs_on_face;
     dofs_on_face.reserve (this->get_fe ().max_dofs_per_face());
 
     typename DoFHandler<dim,spacedim>::active_cell_iterator cell = this->begin_active (),
@@ -1924,7 +1930,7 @@ namespace hp
 
 
   template<int dim, int spacedim>
-  unsigned int
+  types::global_dof_index
   DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
@@ -1934,8 +1940,8 @@ namespace hp
     // same as above, but with
     // additional checks for set of
     // boundary indicators
-    std::set<int> boundary_dofs;
-    std::vector<unsigned int> dofs_on_face;
+    std::set<types::global_dof_index> boundary_dofs;
+    std::vector<types::global_dof_index> dofs_on_face;
     dofs_on_face.reserve (this->get_fe ().max_dofs_per_face());
 
     typename DoFHandler<dim,spacedim>::active_cell_iterator cell = this->begin_active (),
@@ -1949,7 +1955,8 @@ namespace hp
             const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
             dofs_on_face.resize (dofs_per_face);
 
-            cell->face(f)->get_dof_indices (dofs_on_face);
+            cell->face(f)->get_dof_indices (dofs_on_face,
+                                           cell->active_fe_index());
             for (unsigned int i=0; i<dofs_per_face; ++i)
               boundary_dofs.insert(dofs_on_face[i]);
           };
@@ -1959,7 +1966,7 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<2,3>::n_boundary_dofs () const
+  types::global_dof_index DoFHandler<2,3>::n_boundary_dofs () const
   {
     Assert(false,ExcNotImplemented());
     return 0;
@@ -1968,7 +1975,7 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<2,3>::n_boundary_dofs (const FunctionMap &) const
+  types::global_dof_index DoFHandler<2,3>::n_boundary_dofs (const FunctionMap &) const
   {
     Assert(false,ExcNotImplemented());
     return 0;
@@ -1977,7 +1984,7 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<2,3>::n_boundary_dofs (const std::set<types::boundary_id> &) const
+  types::global_dof_index DoFHandler<2,3>::n_boundary_dofs (const std::set<types::boundary_id> &) const
   {
     Assert(false,ExcNotImplemented());
     return 0;
@@ -2010,7 +2017,7 @@ namespace hp
   template<int dim, int spacedim>
   void
   DoFHandler<dim,spacedim>::
-  compute_vertex_dof_identities (std::vector<unsigned int> &new_dof_indices) const
+  compute_vertex_dof_identities (std::vector<types::global_dof_index> &new_dof_indices) const
   {
     // Note: we may wish to have
     // something here similar to what
@@ -2092,13 +2099,13 @@ namespace hp
                   = *vertex_dof_identities[first_fe_index][other_fe_index];
                 for (unsigned int i=0; i<identities.size(); ++i)
                   {
-                    const unsigned int lower_dof_index
+                    const types::global_dof_index lower_dof_index
                       = dealii::internal::DoFAccessor::Implementation::
                         get_vertex_dof_index (*this,
                                               vertex_index,
                                               first_fe_index,
                                               identities[i].first);
-                    const unsigned int higher_dof_index
+                    const types::global_dof_index higher_dof_index
                       = dealii::internal::DoFAccessor::Implementation::
                         get_vertex_dof_index (*this,
                                               vertex_index,
@@ -2106,7 +2113,7 @@ namespace hp
                                               identities[i].second);
 
                     Assert ((new_dof_indices[higher_dof_index] ==
-                             numbers::invalid_unsigned_int)
+                             numbers::invalid_dof_index)
                             ||
                             (new_dof_indices[higher_dof_index] ==
                              lower_dof_index),
@@ -2123,7 +2130,7 @@ namespace hp
   template <>
   void
   DoFHandler<1,1>::
-  compute_line_dof_identities (std::vector<unsigned int> &) const
+  compute_line_dof_identities (std::vector<types::global_dof_index> &) const
   {}
 
 
@@ -2131,20 +2138,20 @@ namespace hp
   template <>
   void
   DoFHandler<1,2>::
-  compute_line_dof_identities (std::vector<unsigned int> &) const
+  compute_line_dof_identities (std::vector<types::global_dof_index> &) const
   {}
 
   template <>
   void
   DoFHandler<1,3>::
-  compute_line_dof_identities (std::vector<unsigned int> &) const
+  compute_line_dof_identities (std::vector<types::global_dof_index> &) const
   {}
 
 
   template<int dim, int spacedim>
   void
   DoFHandler<dim,spacedim>::
-  compute_line_dof_identities (std::vector<unsigned int> &new_dof_indices) const
+  compute_line_dof_identities (std::vector<types::global_dof_index> &new_dof_indices) const
   {
     // we will mark lines that we
     // have already treated, so first
@@ -2262,9 +2269,9 @@ namespace hp
 
                               for (unsigned int j=0; j<(*finite_elements)[fe_index_1].dofs_per_line; ++j)
                                 {
-                                  const unsigned int master_dof_index
+                                  const types::global_dof_index master_dof_index
                                     = line->dof_index (j, fe_index_1);
-                                  const unsigned int slave_dof_index
+                                  const types::global_dof_index slave_dof_index
                                     = line->dof_index (j, fe_index_2);
 
                                   // if master dof
@@ -2277,10 +2284,10 @@ namespace hp
                                   // slave to
                                   // master
                                   if (new_dof_indices[master_dof_index] !=
-                                      numbers::invalid_unsigned_int)
+                                      numbers::invalid_dof_index)
                                     {
                                       Assert (new_dof_indices[new_dof_indices[master_dof_index]] ==
-                                              numbers::invalid_unsigned_int,
+                                              numbers::invalid_dof_index,
                                               ExcInternalError());
 
                                       new_dof_indices[slave_dof_index]
@@ -2289,7 +2296,7 @@ namespace hp
                                   else
                                     {
                                       Assert ((new_dof_indices[master_dof_index] ==
-                                               numbers::invalid_unsigned_int)
+                                               numbers::invalid_dof_index)
                                               ||
                                               (new_dof_indices[slave_dof_index] ==
                                                master_dof_index),
@@ -2349,13 +2356,13 @@ namespace hp
                         = *line_dof_identities[most_dominating_fe_index][other_fe_index];
                       for (unsigned int i=0; i<identities.size(); ++i)
                         {
-                          const unsigned int master_dof_index
+                          const types::global_dof_index master_dof_index
                             = line->dof_index (identities[i].first, most_dominating_fe_index);
-                          const unsigned int slave_dof_index
+                          const types::global_dof_index slave_dof_index
                             = line->dof_index (identities[i].second, other_fe_index);
 
                           Assert ((new_dof_indices[master_dof_index] ==
-                                   numbers::invalid_unsigned_int)
+                                   numbers::invalid_dof_index)
                                   ||
                                   (new_dof_indices[slave_dof_index] ==
                                    master_dof_index),
@@ -2377,25 +2384,25 @@ namespace hp
   template <>
   void
   DoFHandler<1>::
-  compute_quad_dof_identities (std::vector<unsigned int> &) const
+  compute_quad_dof_identities (std::vector<types::global_dof_index> &) const
   {}
 
   template <>
   void
   DoFHandler<1,2>::
-  compute_quad_dof_identities (std::vector<unsigned int> &) const
+  compute_quad_dof_identities (std::vector<types::global_dof_index> &) const
   {}
 
   template <>
   void
   DoFHandler<1,3>::
-  compute_quad_dof_identities (std::vector<unsigned int> &) const
+  compute_quad_dof_identities (std::vector<types::global_dof_index> &) const
   {}
 
   template <>
   void
   DoFHandler<2>::
-  compute_quad_dof_identities (std::vector<unsigned int> &) const
+  compute_quad_dof_identities (std::vector<types::global_dof_index> &) const
   {}
 
 
@@ -2403,7 +2410,7 @@ namespace hp
   template <>
   void
   DoFHandler<2,3>::
-  compute_quad_dof_identities (std::vector<unsigned int> &) const
+  compute_quad_dof_identities (std::vector<types::global_dof_index> &) const
   {}
 
 
@@ -2411,7 +2418,7 @@ namespace hp
   template<int dim, int spacedim>
   void
   DoFHandler<dim,spacedim>::
-  compute_quad_dof_identities (std::vector<unsigned int> &new_dof_indices) const
+  compute_quad_dof_identities (std::vector<types::global_dof_index> &new_dof_indices) const
   {
     // we will mark quads that we
     // have already treated, so first
@@ -2487,13 +2494,13 @@ namespace hp
                     = *quad_dof_identities[most_dominating_fe_index][other_fe_index];
                   for (unsigned int i=0; i<identities.size(); ++i)
                     {
-                      const unsigned int master_dof_index
+                      const types::global_dof_index master_dof_index
                         = quad->dof_index (identities[i].first, most_dominating_fe_index);
-                      const unsigned int slave_dof_index
+                      const types::global_dof_index slave_dof_index
                         = quad->dof_index (identities[i].second, other_fe_index);
 
                       Assert ((new_dof_indices[master_dof_index] ==
-                               numbers::invalid_unsigned_int)
+                               numbers::invalid_dof_index)
                               ||
                               (new_dof_indices[slave_dof_index] ==
                                master_dof_index),
@@ -2594,7 +2601,7 @@ namespace hp
     // Step 1: distribute DoFs on all
     // active entities
     {
-      unsigned int next_free_dof = 0;
+      types::global_dof_index next_free_dof = 0;
       active_cell_iterator cell = begin_active(),
                            endc = end();
 
@@ -2616,8 +2623,8 @@ namespace hp
     // faces and other
     // lower-dimensional objects
     // where elements come together
-    std::vector<unsigned int>
-    constrained_indices (number_cache.n_global_dofs, numbers::invalid_unsigned_int);
+    std::vector<types::global_dof_index>
+    constrained_indices (number_cache.n_global_dofs, numbers::invalid_dof_index);
     compute_vertex_dof_identities (constrained_indices);
     compute_line_dof_identities (constrained_indices);
     compute_quad_dof_identities (constrained_indices);
@@ -2625,11 +2632,11 @@ namespace hp
     // loop over all dofs and assign
     // new numbers to those which are
     // not constrained
-    std::vector<unsigned int>
-    new_dof_indices (number_cache.n_global_dofs, numbers::invalid_unsigned_int);
-    unsigned int next_free_dof = 0;
-    for (unsigned int i=0; i<number_cache.n_global_dofs; ++i)
-      if (constrained_indices[i] == numbers::invalid_unsigned_int)
+    std::vector<types::global_dof_index>
+    new_dof_indices (number_cache.n_global_dofs, numbers::invalid_dof_index);
+    types::global_dof_index next_free_dof = 0;
+    for (types::global_dof_index i=0; i<number_cache.n_global_dofs; ++i)
+      if (constrained_indices[i] == numbers::invalid_dof_index)
         {
           new_dof_indices[i] = next_free_dof;
           ++next_free_dof;
@@ -2638,19 +2645,19 @@ namespace hp
     // then loop over all those that
     // are constrained and record the
     // new dof number for those:
-    for (unsigned int i=0; i<number_cache.n_global_dofs; ++i)
-      if (constrained_indices[i] != numbers::invalid_unsigned_int)
+    for (types::global_dof_index i=0; i<number_cache.n_global_dofs; ++i)
+      if (constrained_indices[i] != numbers::invalid_dof_index)
         {
           Assert (new_dof_indices[constrained_indices[i]] !=
-                  numbers::invalid_unsigned_int,
+                  numbers::invalid_dof_index,
                   ExcInternalError());
 
           new_dof_indices[i] = new_dof_indices[constrained_indices[i]];
         }
 
-    for (unsigned int i=0; i<number_cache.n_global_dofs; ++i)
+    for (types::global_dof_index i=0; i<number_cache.n_global_dofs; ++i)
       {
-        Assert (new_dof_indices[i] != numbers::invalid_unsigned_int,
+        Assert (new_dof_indices[i] != numbers::invalid_dof_index,
                 ExcInternalError());
         Assert (new_dof_indices[i] < next_free_dof,
                 ExcInternalError());
@@ -2670,10 +2677,11 @@ namespace hp
       = IndexSet (number_cache.n_global_dofs);
     number_cache.locally_owned_dofs.add_range (0,
                                                number_cache.n_global_dofs);
-
+    Assert (number_cache.n_global_dofs < std::numeric_limits<unsigned int>::max (),
+            ExcMessage ("Global number of degrees of freedom is too large."));
     number_cache.n_locally_owned_dofs_per_processor
-      = std::vector<unsigned int> (1,
-                                   number_cache.n_global_dofs);
+      = std::vector<types::global_dof_index> (1,
+                                              (types::global_dof_index) number_cache.n_global_dofs);
 
     number_cache.locally_owned_dofs_per_processor
       = std::vector<IndexSet> (1,
@@ -2698,7 +2706,7 @@ namespace hp
 
 
   template<int dim, int spacedim>
-  void DoFHandler<dim,spacedim>::renumber_dofs (const std::vector<unsigned int> &new_numbers)
+  void DoFHandler<dim,spacedim>::renumber_dofs (const std::vector<types::global_dof_index> &new_numbers)
   {
     Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
 #ifdef DEBUG
@@ -2706,10 +2714,10 @@ namespace hp
     // consecutively numbered
     if (true)
       {
-        std::vector<unsigned int> tmp(new_numbers);
+        std::vector<types::global_dof_index> tmp(new_numbers);
         std::sort (tmp.begin(), tmp.end());
-        std::vector<unsigned int>::const_iterator p = tmp.begin();
-        unsigned int                         i = 0;
+        std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
+        types::global_dof_index                              i = 0;
         for (; p!=tmp.end(); ++p, ++i)
           Assert (*p == i, ExcNewNumbersNotConsecutive(i));
       }
@@ -2723,7 +2731,7 @@ namespace hp
   template<int dim, int spacedim>
   void
   DoFHandler<dim,spacedim>::
-  renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+  renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                           dealii::internal::int2type<0>)
   {
     Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
@@ -2743,7 +2751,7 @@ namespace hp
 
             for (unsigned int d=0; d<(*finite_elements)[fe_index].dofs_per_vertex; ++d)
               {
-                const unsigned int vertex_dof_index
+                const types::global_dof_index vertex_dof_index
                   = dealii::internal::DoFAccessor::Implementation::
                     get_vertex_dof_index(*this,
                                          vertex_index,
@@ -2765,7 +2773,7 @@ namespace hp
   template<int dim, int spacedim>
   void
   DoFHandler<dim,spacedim>::
-  renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+  renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                           dealii::internal::int2type<1>)
   {
     Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
@@ -2815,7 +2823,7 @@ namespace hp
   template<>
   void
   DoFHandler<2,2>::
-  renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+  renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                           dealii::internal::int2type<2>)
   {
     const unsigned int dim = 2;
@@ -2867,7 +2875,7 @@ namespace hp
   template<>
   void
   DoFHandler<2,3>::
-  renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+  renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                           dealii::internal::int2type<2>)
   {
     const unsigned int dim = 2;
@@ -2918,7 +2926,7 @@ namespace hp
   template<>
   void
   DoFHandler<3,3>::
-  renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+  renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                           dealii::internal::int2type<2>)
   {
     const unsigned int dim = 3;
@@ -2969,7 +2977,7 @@ namespace hp
   template<>
   void
   DoFHandler<3,3>::
-  renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+  renumber_dofs_internal (const std::vector<types::global_dof_index> &new_numbers,
                           dealii::internal::int2type<3>)
   {
     const unsigned int dim = 3;
@@ -3312,14 +3320,14 @@ namespace hp
 
   template <int dim, int spacedim>
   template <int structdim>
-  unsigned int
+  types::global_dof_index
   DoFHandler<dim,spacedim>::get_dof_index (const unsigned int,
                                            const unsigned int,
                                            const unsigned int,
                                            const unsigned int) const
   {
     Assert (false, ExcNotImplemented());
-    return numbers::invalid_unsigned_int;
+    return numbers::invalid_dof_index;
   }
 
 
@@ -3330,7 +3338,7 @@ namespace hp
                                            const unsigned int,
                                            const unsigned int,
                                            const unsigned int,
-                                           const unsigned int) const
+                                           const types::global_dof_index) const
   {
     Assert (false, ExcNotImplemented());
   }
@@ -3346,12 +3354,12 @@ namespace hp
     faces = NULL;
 
     {
-      std::vector<unsigned int> tmp;
+      std::vector<types::global_dof_index> tmp;
       std::swap (vertex_dofs, tmp);
     }
 
     {
-      std::vector<unsigned int> tmp;
+      std::vector<types::global_dof_index> tmp;
       std::swap (vertex_dofs_offsets, tmp);
     }
   }
index cb3e1759630ffc01b0211435ee196def025d5598..b83830a8b54072d08463146d500f41c037769c28 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
@@ -21,21 +25,21 @@ for (deal_II_dimension : DIMENSIONS)
     template class DoFHandler<deal_II_dimension, deal_II_dimension+1>;
     
     template
-    unsigned int
+    types::global_dof_index
     DoFHandler<deal_II_dimension, deal_II_dimension+1>::get_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
     
     template
     void
-    DoFHandler<deal_II_dimension, deal_II_dimension+1>::set_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
+    DoFHandler<deal_II_dimension, deal_II_dimension+1>::set_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const types::global_dof_index) const;
     
     #if deal_II_dimension >= 2
     template
-    unsigned int
+    types::global_dof_index
     DoFHandler<deal_II_dimension, deal_II_dimension+1>::get_dof_index<2> (const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
     
     template
     void
-    DoFHandler<deal_II_dimension, deal_II_dimension+1>::set_dof_index<2> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
+    DoFHandler<deal_II_dimension, deal_II_dimension+1>::set_dof_index<2> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const types::global_dof_index) const;
     #endif
 #endif
 
@@ -43,43 +47,43 @@ for (deal_II_dimension : DIMENSIONS)
    template class DoFHandler<1, 3>;
 
 template
-unsigned int
+types::global_dof_index
 DoFHandler<1,3>::get_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
 
 template
 void
-DoFHandler<1,3>::set_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, unsigned int) const;
+DoFHandler<1,3>::set_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const types::global_dof_index) const;
 #endif
 
 template
-unsigned int
+types::global_dof_index
 DoFHandler<deal_II_dimension>::get_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
 
 #if deal_II_dimension >= 2
 template
-unsigned int
+types::global_dof_index
 DoFHandler<deal_II_dimension>::get_dof_index<2> (const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
 
 #if deal_II_dimension >= 3
 template
-unsigned int
+types::global_dof_index
 DoFHandler<deal_II_dimension>::get_dof_index<3> (const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
 #endif
 #endif
 
 template
 void
-DoFHandler<deal_II_dimension>::set_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
+DoFHandler<deal_II_dimension>::set_dof_index<1> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const types::global_dof_index) const;
 
 #if deal_II_dimension >= 2
 template
 void
-DoFHandler<deal_II_dimension>::set_dof_index<2> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
+DoFHandler<deal_II_dimension>::set_dof_index<2> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const types::global_dof_index) const;
 
 #if deal_II_dimension >= 3
 template
 void
-DoFHandler<deal_II_dimension>::set_dof_index<3> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int) const;
+DoFHandler<deal_II_dimension>::set_dof_index<3> (const unsigned int, const unsigned int, const unsigned int, const unsigned int, const types::global_dof_index) const;
 #endif
 #endif
   \}
index f37fbcdef47fe02e786ed1489d5c64143ea3f68c..6ee1b772fd3abff72fb0d22a8d58d3f5af71388a 100644 (file)
@@ -1,16 +1,18 @@
-//----------------------------  hp_dof_levels.cc  ---------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  hp_dof_levels.cc  ------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/hp/dof_levels.h>
index 38c3a0347b7e9e651b6865c3ac0cc3a2694fca93..361e15da2a0a32bba484635f849e7aad22043800 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/hp/dof_objects.h>
index 55ece91b9ac5182682cd0a6f6d7b9a852941b232..834140145b8f92d49e4a78a60b3bd43868d689ba 100644 (file)
@@ -1,15 +1,19 @@
-//----------------------------  fe_collection.cc  ---------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  fe_collection.cc  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/hp/fe_collection.h>
index d8dabcc8bd35bd506e78b6043d21a85e00f504ed..7b95936715e91a625f1acbd6dd44a1696a3d4233 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index 3e43ff6ce608b1c3503ecb1128934a7e7f083ca1..782c3595d1362cbe758d92b1bb3ebf6c9573690f 100644 (file)
@@ -1,16 +1,18 @@
-//----------------------------  hp_fe_values.cc  ---------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  hp_fe_values.cc  ---------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/hp/fe_values.h>
 #include <deal.II/fe/mapping_q1.h>
index 59e2c968118134bc6d25eb0599046f4058b0afa5..ceb33fa70143754d93b2d0f460162c9c4a7c3be6 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index 8c0426dd8e15d24456181596d491869a7b404dab..0d9fdcfa83a507aa92cce9b06545f7091aac435c 100644 (file)
@@ -1,15 +1,19 @@
-//-----------------------  mapping_collection.cc  ---------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//-----------------------  mapping_collection.cc  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/hp/mapping_collection.h>
index 43d2362466e2decd2d1ab41f7c5cd91259b2ea49..35caaf7c17fb787c70e9269c7a199321524de2e3 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index 1f2ef00f97b938da21ad7f8017cb7278a4fc4631..45ba6b7b61d933524490eea49dde3fd146d9011c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
 ## Copyright (C) 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index e4a11e76c9659dbacb2fae8c7355401e8085dcc3..bc2e40555c1a7a751e3a3e096af16027c1528798 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index e62f320d3538c07fdbca792223dd30c046abfd87..15d50f6f41132fc0eb4c0da6f23215c8151f0950 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2008, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/block_matrix_array.h>
 #include <deal.II/lac/vector.h>
@@ -320,7 +325,7 @@ template <typename number>
 void
 BlockTrianglePrecondition<number>::do_row (
   BlockVector<number> &dst,
-  unsigned int row_num) const
+  size_type row_num) const
 {
   GrowingVectorMemory<Vector<number> > mem;
   typename std::vector<typename BlockMatrixArray<number>::Entry>::const_iterator
@@ -339,12 +344,12 @@ BlockTrianglePrecondition<number>::do_row (
   // they are not ordered by rows.
   for (; m != end ; ++m)
     {
-      const unsigned int i=m->row;
+      const size_type i=m->row;
       // Ignore everything not in
       // this row
       if (i != row_num)
         continue;
-      const unsigned int j=m->col;
+      const size_type j=m->col;
       // Only use the lower (upper)
       // triangle for forward
       // (backward) substitution
@@ -379,7 +384,7 @@ BlockTrianglePrecondition<number>::do_row (
   else
     {
       aux = 0.;
-      for (unsigned int i=0; i<diagonals.size(); ++i)
+      for (size_type i=0; i<diagonals.size(); ++i)
         {
           m = diagonals[i];
           // First, divide by the current
index 6b12598d82a7264b82b8d6c1e47191529dbae5ab..cd6591c7aed4d8a705534751702aa13975545de4 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/block_sparse_matrix.templates.h>
 
index e0e5b97008c56770fc060020c23afbb794f312c9..4d9463d81c50d050de26a62308a671dd4cae8950 100644 (file)
@@ -1,3 +1,19 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 for (S : REAL_SCALARS)
   {
     template class BlockSparseMatrix<S>;
index ed2fa68683156483a61cbf93db785bd7b76680b2..b32384beee74a26d59f2d36fa8b061a7f244d105 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/block_sparse_matrix_ez.h>
 #include <deal.II/lac/block_sparse_matrix_ez.templates.h>
index b09aeb3df9797193831cafca53d9c94977f098d2..695ae57da6c659fd2a678ba52f93987b5cbcfb7f 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/vector_slice.h>
 #include <deal.II/base/memory_consumption.h>
@@ -29,8 +33,8 @@ BlockSparsityPatternBase<SparsityPatternBase>::BlockSparsityPatternBase ()
 
 template <class SparsityPatternBase>
 BlockSparsityPatternBase<SparsityPatternBase>::
-BlockSparsityPatternBase (const unsigned int n_block_rows,
-                          const unsigned int n_block_columns)
+BlockSparsityPatternBase (const size_type n_block_rows,
+                          const size_type n_block_columns)
   :
   rows (0),
   columns (0)
@@ -67,14 +71,14 @@ BlockSparsityPatternBase<SparsityPatternBase>::~BlockSparsityPatternBase ()
 template <class SparsityPatternBase>
 void
 BlockSparsityPatternBase<SparsityPatternBase>::
-reinit (const unsigned int n_block_rows,
-        const unsigned int n_block_columns)
+reinit (const size_type n_block_rows,
+        const size_type n_block_columns)
 {
   // delete previous content and
   // clean the sub_objects array
   // completely
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<columns; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<columns; ++j)
       {
         SparsityPatternBase *sp = sub_objects[i][j];
         sub_objects[i][j] = 0;
@@ -88,8 +92,8 @@ reinit (const unsigned int n_block_rows,
   sub_objects.reinit (rows, columns);
 
   // allocate new objects
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<columns; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<columns; ++j)
       {
         SparsityPatternBase *p = new SparsityPatternBase;
         sub_objects[i][j] = p;
@@ -105,8 +109,8 @@ operator = (const BlockSparsityPatternBase<SparsityPatternBase> &bsp)
   Assert (rows == bsp.rows, ExcDimensionMismatch(rows, bsp.rows));
   Assert (columns == bsp.columns, ExcDimensionMismatch(columns, bsp.columns));
   // copy objects
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<columns; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<columns; ++j)
       *sub_objects[i][j] = *bsp.sub_objects[i][j];
   // update index objects
   collect_sizes ();
@@ -120,18 +124,18 @@ template <class SparsityPatternBase>
 void
 BlockSparsityPatternBase<SparsityPatternBase>::collect_sizes ()
 {
-  std::vector<unsigned int> row_sizes (rows);
-  std::vector<unsigned int> col_sizes (columns);
+  std::vector<size_type > row_sizes (rows);
+  std::vector<size_type > col_sizes (columns);
 
   // first find out the row sizes
   // from the first block column
-  for (unsigned int r=0; r<rows; ++r)
+  for (size_type r=0; r<rows; ++r)
     row_sizes[r] = sub_objects[r][0]->n_rows();
   // then check that the following
   // block columns have the same
   // sizes
-  for (unsigned int c=1; c<columns; ++c)
-    for (unsigned int r=0; r<rows; ++r)
+  for (size_type c=1; c<columns; ++c)
+    for (size_type r=0; r<rows; ++r)
       Assert (row_sizes[r] == sub_objects[r][c]->n_rows(),
               ExcIncompatibleRowNumbers (r,0,r,c));
 
@@ -141,10 +145,10 @@ BlockSparsityPatternBase<SparsityPatternBase>::collect_sizes ()
 
 
   // then do the same with the columns
-  for (unsigned int c=0; c<columns; ++c)
+  for (size_type c=0; c<columns; ++c)
     col_sizes[c] = sub_objects[0][c]->n_cols();
-  for (unsigned int r=1; r<rows; ++r)
-    for (unsigned int c=0; c<columns; ++c)
+  for (size_type r=1; r<rows; ++r)
+    for (size_type c=0; c<columns; ++c)
       Assert (col_sizes[c] == sub_objects[r][c]->n_cols(),
               ExcIncompatibleRowNumbers (0,c,r,c));
 
@@ -159,8 +163,8 @@ template <class SparsityPatternBase>
 void
 BlockSparsityPatternBase<SparsityPatternBase>::compress ()
 {
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<columns; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<columns; ++j)
       sub_objects[i][j]->compress ();
 }
 
@@ -170,8 +174,8 @@ template <class SparsityPatternBase>
 bool
 BlockSparsityPatternBase<SparsityPatternBase>::empty () const
 {
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<columns; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<columns; ++j)
       if (sub_objects[i][j]->empty () == false)
         return false;
   return true;
@@ -180,14 +184,14 @@ BlockSparsityPatternBase<SparsityPatternBase>::empty () const
 
 
 template <class SparsityPatternBase>
-unsigned int
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
 BlockSparsityPatternBase<SparsityPatternBase>::max_entries_per_row () const
 {
-  unsigned int max_entries = 0;
-  for (unsigned int block_row=0; block_row<rows; ++block_row)
+  size_type max_entries = 0;
+  for (size_type block_row=0; block_row<rows; ++block_row)
     {
-      unsigned int this_row = 0;
-      for (unsigned int c=0; c<columns; ++c)
+      size_type this_row = 0;
+      for (size_type c=0; c<columns; ++c)
         this_row += sub_objects[block_row][c]->max_entries_per_row ();
 
       if (this_row > max_entries)
@@ -199,13 +203,13 @@ BlockSparsityPatternBase<SparsityPatternBase>::max_entries_per_row () const
 
 
 template <class SparsityPatternBase>
-unsigned int
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
 BlockSparsityPatternBase<SparsityPatternBase>::n_rows () const
 {
   // only count in first column, since
   // all rows should be equivalent
-  unsigned int count = 0;
-  for (unsigned int r=0; r<rows; ++r)
+  size_type count = 0;
+  for (size_type r=0; r<rows; ++r)
     count += sub_objects[r][0]->n_rows();
   return count;
 }
@@ -213,13 +217,13 @@ BlockSparsityPatternBase<SparsityPatternBase>::n_rows () const
 
 
 template <class SparsityPatternBase>
-unsigned int
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
 BlockSparsityPatternBase<SparsityPatternBase>::n_cols () const
 {
   // only count in first row, since
   // all rows should be equivalent
-  unsigned int count = 0;
-  for (unsigned int c=0; c<columns; ++c)
+  size_type count = 0;
+  for (size_type c=0; c<columns; ++c)
     count += sub_objects[0][c]->n_cols();
   return count;
 }
@@ -227,12 +231,12 @@ BlockSparsityPatternBase<SparsityPatternBase>::n_cols () const
 
 
 template <class SparsityPatternBase>
-unsigned int
+typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
 BlockSparsityPatternBase<SparsityPatternBase>::n_nonzero_elements () const
 {
-  unsigned int count = 0;
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<columns; ++j)
+  size_type count = 0;
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<columns; ++j)
       count += sub_objects[i][j]->n_nonzero_elements ();
   return count;
 }
@@ -243,17 +247,17 @@ template <class SparsityPatternBase>
 void
 BlockSparsityPatternBase<SparsityPatternBase>::print(std::ostream &out) const
 {
-  unsigned int k=0;
-  for (unsigned int ib=0; ib<n_block_rows(); ++ib)
+  size_type k=0;
+  for (size_type ib=0; ib<n_block_rows(); ++ib)
     {
-      for (unsigned int i=0; i<block(ib,0).n_rows(); ++i)
+      for (size_type i=0; i<block(ib,0).n_rows(); ++i)
         {
           out << '[' << i+k;
-          unsigned int l=0;
-          for (unsigned int jb=0; jb<n_block_cols(); ++jb)
+          size_type l=0;
+          for (size_type jb=0; jb<n_block_cols(); ++jb)
             {
               const SparsityPatternBase &b = block(ib,jb);
-              for (unsigned int j=0; j<b.n_cols(); ++j)
+              for (size_type j=0; j<b.n_cols(); ++j)
                 if (b.exists(i,j))
                   out << ',' << l+j;
               l += b.n_cols();
@@ -269,18 +273,18 @@ template <>
 void
 BlockSparsityPatternBase<CompressedSimpleSparsityPattern>::print(std::ostream &out) const
 {
-  unsigned int k=0;
-  for (unsigned int ib=0; ib<n_block_rows(); ++ib)
+  size_type k=0;
+  for (size_type ib=0; ib<n_block_rows(); ++ib)
     {
-      for (unsigned int i=0; i<block(ib,0).n_rows(); ++i)
+      for (size_type i=0; i<block(ib,0).n_rows(); ++i)
         {
           out << '[' << i+k;
-          unsigned int l=0;
-          for (unsigned int jb=0; jb<n_block_cols(); ++jb)
+          size_type l=0;
+          for (size_type jb=0; jb<n_block_cols(); ++jb)
             {
               const CompressedSimpleSparsityPattern &b = block(ib,jb);
               if (b.row_index_set().size()==0 || b.row_index_set().is_element(i))
-                for (unsigned int j=0; j<b.n_cols(); ++j)
+                for (size_type j=0; j<b.n_cols(); ++j)
                   if (b.exists(i,j))
                     out << ',' << l+j;
               l += b.n_cols();
@@ -296,16 +300,16 @@ template <class SparsityPatternBase>
 void
 BlockSparsityPatternBase<SparsityPatternBase>::print_gnuplot(std::ostream &out) const
 {
-  unsigned int k=0;
-  for (unsigned int ib=0; ib<n_block_rows(); ++ib)
+  size_type k=0;
+  for (size_type ib=0; ib<n_block_rows(); ++ib)
     {
-      for (unsigned int i=0; i<block(ib,0).n_rows(); ++i)
+      for (size_type i=0; i<block(ib,0).n_rows(); ++i)
         {
-          unsigned int l=0;
-          for (unsigned int jb=0; jb<n_block_cols(); ++jb)
+          size_type l=0;
+          for (size_type jb=0; jb<n_block_cols(); ++jb)
             {
               const SparsityPatternBase &b = block(ib,jb);
-              for (unsigned int j=0; j<b.n_cols(); ++j)
+              for (size_type j=0; j<b.n_cols(); ++j)
                 if (b.exists(i,j))
                   out << l+j << " " << -static_cast<signed int>(i+k) << std::endl;
               l += b.n_cols();
@@ -347,8 +351,8 @@ BlockSparsityPattern::BlockSparsityPattern ()
 
 
 
-BlockSparsityPattern::BlockSparsityPattern (const unsigned int n_rows,
-                                            const unsigned int n_columns)
+BlockSparsityPattern::BlockSparsityPattern (const size_type n_rows,
+                                            const size_type n_columns)
   :
   BlockSparsityPatternBase<SparsityPattern>(n_rows,
                                             n_columns)
@@ -364,11 +368,11 @@ BlockSparsityPattern::reinit(
   AssertDimension (row_lengths.size(), cols.size());
 
   this->reinit(rows.size(), cols.size());
-  for (unsigned int j=0; j<cols.size(); ++j)
-    for (unsigned int i=0; i<rows.size(); ++i)
+  for (size_type j=0; j<cols.size(); ++j)
+    for (size_type i=0; i<rows.size(); ++i)
       {
-        const unsigned int start = rows.local_to_global(i, 0);
-        const unsigned int length = rows.block_size(i);
+        const size_type start = rows.local_to_global(i, 0);
+        const size_type length = rows.block_size(i);
 
         if (row_lengths[j].size()==1)
           block(i,j).reinit(rows.block_size(i),
@@ -391,8 +395,8 @@ BlockSparsityPattern::reinit(
 bool
 BlockSparsityPattern::is_compressed () const
 {
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<columns; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<columns; ++j)
       if (sub_objects[i][j]->is_compressed () == false)
         return false;
   return true;
@@ -408,8 +412,8 @@ BlockSparsityPattern::memory_consumption () const
           MemoryConsumption::memory_consumption (sub_objects) +
           MemoryConsumption::memory_consumption (row_indices) +
           MemoryConsumption::memory_consumption (column_indices));
-  for (unsigned int r=0; r<rows; ++r)
-    for (unsigned int c=0; c<columns; ++c)
+  for (size_type r=0; r<rows; ++r)
+    for (size_type c=0; c<columns; ++c)
       mem += MemoryConsumption::memory_consumption (*sub_objects[r][c]);
 
   return mem;
@@ -425,8 +429,8 @@ BlockSparsityPattern::copy_from  (const BlockCompressedSparsityPattern &csp)
   reinit (csp.n_block_rows(), csp.n_block_cols());
 
   // copy over blocks
-  for (unsigned int i=0; i<n_block_rows(); ++i)
-    for (unsigned int j=0; j<n_block_cols(); ++j)
+  for (size_type i=0; i<n_block_rows(); ++i)
+    for (size_type j=0; j<n_block_cols(); ++j)
       block(i,j).copy_from (csp.block(i,j));
 
   // and finally enquire their new
@@ -442,8 +446,8 @@ BlockSparsityPattern::copy_from  (const BlockCompressedSimpleSparsityPattern &cs
   reinit (csp.n_block_rows(), csp.n_block_cols());
 
   // copy over blocks
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<rows; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<rows; ++j)
       block(i,j).copy_from (csp.block(i,j));
 
   // and finally enquire their new
@@ -459,8 +463,8 @@ BlockSparsityPattern::copy_from  (const BlockCompressedSetSparsityPattern &csp)
   reinit (csp.n_block_rows(), csp.n_block_cols());
 
   // copy over blocks
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=0; j<rows; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=0; j<rows; ++j)
       block(i,j).copy_from (csp.block(i,j));
 
   // and finally enquire their new
@@ -477,8 +481,8 @@ BlockCompressedSparsityPattern::BlockCompressedSparsityPattern ()
 
 BlockCompressedSparsityPattern::
 BlockCompressedSparsityPattern (
-  const unsigned int n_rows,
-  const unsigned int n_columns)
+  const size_type n_rows,
+  const size_type n_columns)
   :
   BlockSparsityPatternBase<CompressedSparsityPattern>(n_rows,
                                                       n_columns)
@@ -487,8 +491,8 @@ BlockCompressedSparsityPattern (
 
 BlockCompressedSparsityPattern::
 BlockCompressedSparsityPattern (
-  const std::vector<unsigned int> &row_indices,
-  const std::vector<unsigned int> &col_indices)
+  const std::vector<size_type> &row_indices,
+  const std::vector<size_type> &col_indices)
 {
   reinit(row_indices, col_indices);
 }
@@ -505,12 +509,12 @@ BlockCompressedSparsityPattern (
 
 void
 BlockCompressedSparsityPattern::reinit (
-  const std::vector< unsigned int > &row_block_sizes,
-  const std::vector< unsigned int > &col_block_sizes)
+  const std::vector<size_type> &row_block_sizes,
+  const std::vector<size_type> &col_block_sizes)
 {
   BlockSparsityPatternBase<CompressedSparsityPattern>::reinit(row_block_sizes.size(), col_block_sizes.size());
-  for (unsigned int i=0; i<row_block_sizes.size(); ++i)
-    for (unsigned int j=0; j<col_block_sizes.size(); ++j)
+  for (size_type i=0; i<row_block_sizes.size(); ++i)
+    for (size_type j=0; j<col_block_sizes.size(); ++j)
       this->block(i,j).reinit(row_block_sizes[i],col_block_sizes[j]);
   this->collect_sizes();
 }
@@ -524,8 +528,8 @@ BlockCompressedSparsityPattern::reinit (
 {
   BlockSparsityPatternBase<CompressedSparsityPattern>::reinit(row_indices.size(),
                                                               col_indices.size());
-  for (unsigned int i=0; i<row_indices.size(); ++i)
-    for (unsigned int j=0; j<col_indices.size(); ++j)
+  for (size_type i=0; i<row_indices.size(); ++i)
+    for (size_type j=0; j<col_indices.size(); ++j)
       this->block(i,j).reinit(row_indices.block_size(i),
                               col_indices.block_size(j));
   this->collect_sizes();
@@ -540,8 +544,8 @@ BlockCompressedSetSparsityPattern::BlockCompressedSetSparsityPattern ()
 
 BlockCompressedSetSparsityPattern::
 BlockCompressedSetSparsityPattern (
-  const unsigned int n_rows,
-  const unsigned int n_columns)
+  const size_type n_rows,
+  const size_type n_columns)
   :
   BlockSparsityPatternBase<CompressedSetSparsityPattern>(n_rows,
                                                          n_columns)
@@ -550,8 +554,8 @@ BlockCompressedSetSparsityPattern (
 
 BlockCompressedSetSparsityPattern::
 BlockCompressedSetSparsityPattern (
-  const std::vector<unsigned int> &row_indices,
-  const std::vector<unsigned int> &col_indices)
+  const std::vector<size_type> &row_indices,
+  const std::vector<size_type> &col_indices)
 {
   reinit(row_indices, col_indices);
 }
@@ -568,12 +572,12 @@ BlockCompressedSetSparsityPattern (
 
 void
 BlockCompressedSetSparsityPattern::reinit (
-  const std::vector< unsigned int > &row_block_sizes,
-  const std::vector< unsigned int > &col_block_sizes)
+  const std::vector<size_type> &row_block_sizes,
+  const std::vector<size_type> &col_block_sizes)
 {
   BlockSparsityPatternBase<CompressedSetSparsityPattern>::reinit(row_block_sizes.size(), col_block_sizes.size());
-  for (unsigned int i=0; i<row_block_sizes.size(); ++i)
-    for (unsigned int j=0; j<col_block_sizes.size(); ++j)
+  for (size_type i=0; i<row_block_sizes.size(); ++i)
+    for (size_type j=0; j<col_block_sizes.size(); ++j)
       this->block(i,j).reinit(row_block_sizes[i],col_block_sizes[j]);
   this->collect_sizes();
 }
@@ -587,8 +591,8 @@ BlockCompressedSetSparsityPattern::reinit (
 {
   BlockSparsityPatternBase<CompressedSetSparsityPattern>::reinit(row_indices.size(),
       col_indices.size());
-  for (unsigned int i=0; i<row_indices.size(); ++i)
-    for (unsigned int j=0; j<col_indices.size(); ++j)
+  for (size_type i=0; i<row_indices.size(); ++i)
+    for (size_type j=0; j<col_indices.size(); ++j)
       this->block(i,j).reinit(row_indices.block_size(i),
                               col_indices.block_size(j));
   this->collect_sizes();
@@ -602,8 +606,8 @@ BlockCompressedSimpleSparsityPattern::BlockCompressedSimpleSparsityPattern ()
 
 
 BlockCompressedSimpleSparsityPattern::
-BlockCompressedSimpleSparsityPattern (const unsigned int n_rows,
-                                      const unsigned int n_columns)
+BlockCompressedSimpleSparsityPattern (const size_type n_rows,
+                                      const size_type n_columns)
   :
   BlockSparsityPatternBase<CompressedSimpleSparsityPattern>(n_rows,
                                                             n_columns)
@@ -612,14 +616,14 @@ BlockCompressedSimpleSparsityPattern (const unsigned int n_rows,
 
 
 BlockCompressedSimpleSparsityPattern::
-BlockCompressedSimpleSparsityPattern (const std::vector<unsigned int> &row_indices,
-                                      const std::vector<unsigned int> &col_indices)
+BlockCompressedSimpleSparsityPattern (const std::vector<size_type> &row_indices,
+                                      const std::vector<size_type> &col_indices)
   :
   BlockSparsityPatternBase<CompressedSimpleSparsityPattern>(row_indices.size(),
                                                             col_indices.size())
 {
-  for (unsigned int i=0; i<row_indices.size(); ++i)
-    for (unsigned int j=0; j<col_indices.size(); ++j)
+  for (size_type i=0; i<row_indices.size(); ++i)
+    for (size_type j=0; j<col_indices.size(); ++j)
       this->block(i,j).reinit(row_indices[i],col_indices[j]);
   this->collect_sizes();
 }
@@ -631,8 +635,8 @@ BlockCompressedSimpleSparsityPattern (const std::vector<IndexSet> &partitioning)
   BlockSparsityPatternBase<CompressedSimpleSparsityPattern>(partitioning.size(),
                                                             partitioning.size())
 {
-  for (unsigned int i=0; i<partitioning.size(); ++i)
-    for (unsigned int j=0; j<partitioning.size(); ++j)
+  for (size_type i=0; i<partitioning.size(); ++i)
+    for (size_type j=0; j<partitioning.size(); ++j)
       this->block(i,j).reinit(partitioning[i].size(),
                               partitioning[j].size(),
                               partitioning[i]);
@@ -643,13 +647,13 @@ BlockCompressedSimpleSparsityPattern (const std::vector<IndexSet> &partitioning)
 
 void
 BlockCompressedSimpleSparsityPattern::reinit (
-  const std::vector< unsigned int > &row_block_sizes,
-  const std::vector< unsigned int > &col_block_sizes)
+  const std::vector<size_type> &row_block_sizes,
+  const std::vector<size_type> &col_block_sizes)
 {
   BlockSparsityPatternBase<CompressedSimpleSparsityPattern>::
   reinit(row_block_sizes.size(), col_block_sizes.size());
-  for (unsigned int i=0; i<row_block_sizes.size(); ++i)
-    for (unsigned int j=0; j<col_block_sizes.size(); ++j)
+  for (size_type i=0; i<row_block_sizes.size(); ++i)
+    for (size_type j=0; j<col_block_sizes.size(); ++j)
       this->block(i,j).reinit(row_block_sizes[i],col_block_sizes[j]);
   this->collect_sizes();
 }
@@ -660,8 +664,8 @@ BlockCompressedSimpleSparsityPattern::reinit (
 {
   BlockSparsityPatternBase<CompressedSimpleSparsityPattern>::
   reinit(partitioning.size(), partitioning.size());
-  for (unsigned int i=0; i<partitioning.size(); ++i)
-    for (unsigned int j=0; j<partitioning.size(); ++j)
+  for (size_type i=0; i<partitioning.size(); ++i)
+    for (size_type j=0; j<partitioning.size(); ++j)
       this->block(i,j).reinit(partitioning[i].size(),
                               partitioning[j].size(),
                               partitioning[i]);
@@ -679,8 +683,8 @@ namespace TrilinosWrappers
 
 
   BlockSparsityPattern::
-  BlockSparsityPattern (const unsigned int n_rows,
-                        const unsigned int n_columns)
+  BlockSparsityPattern (const size_type n_rows,
+                        const size_type n_columns)
     :
     dealii::BlockSparsityPatternBase<SparsityPattern>(n_rows,
                                                       n_columns)
@@ -689,14 +693,14 @@ namespace TrilinosWrappers
 
 
   BlockSparsityPattern::
-  BlockSparsityPattern (const std::vector<unsigned int> &row_indices,
-                        const std::vector<unsigned int> &col_indices)
+  BlockSparsityPattern (const std::vector<size_type> &row_indices,
+                        const std::vector<size_type> &col_indices)
     :
     BlockSparsityPatternBase<SparsityPattern>(row_indices.size(),
                                               col_indices.size())
   {
-    for (unsigned int i=0; i<row_indices.size(); ++i)
-      for (unsigned int j=0; j<col_indices.size(); ++j)
+    for (size_type i=0; i<row_indices.size(); ++i)
+      for (size_type j=0; j<col_indices.size(); ++j)
         this->block(i,j).reinit(row_indices[i],col_indices[j]);
     this->collect_sizes();
   }
@@ -710,8 +714,8 @@ namespace TrilinosWrappers
     (parallel_partitioning.size(),
      parallel_partitioning.size())
   {
-    for (unsigned int i=0; i<parallel_partitioning.size(); ++i)
-      for (unsigned int j=0; j<parallel_partitioning.size(); ++j)
+    for (size_type i=0; i<parallel_partitioning.size(); ++i)
+      for (size_type j=0; j<parallel_partitioning.size(); ++j)
         this->block(i,j).reinit(parallel_partitioning[i],
                                 parallel_partitioning[j]);
     this->collect_sizes();
@@ -727,8 +731,8 @@ namespace TrilinosWrappers
     (parallel_partitioning.size(),
      parallel_partitioning.size())
   {
-    for (unsigned int i=0; i<parallel_partitioning.size(); ++i)
-      for (unsigned int j=0; j<parallel_partitioning.size(); ++j)
+    for (size_type i=0; i<parallel_partitioning.size(); ++i)
+      for (size_type j=0; j<parallel_partitioning.size(); ++j)
         this->block(i,j).reinit(parallel_partitioning[i],
                                 parallel_partitioning[j],
                                 communicator);
@@ -738,13 +742,13 @@ namespace TrilinosWrappers
 
 
   void
-  BlockSparsityPattern::reinit (const std::vector<unsigned int> &row_block_sizes,
-                                const std::vector<unsigned int> &col_block_sizes)
+  BlockSparsityPattern::reinit (const std::vector<size_type> &row_block_sizes,
+                                const std::vector<size_type> &col_block_sizes)
   {
     dealii::BlockSparsityPatternBase<SparsityPattern>::
     reinit(row_block_sizes.size(), col_block_sizes.size());
-    for (unsigned int i=0; i<row_block_sizes.size(); ++i)
-      for (unsigned int j=0; j<col_block_sizes.size(); ++j)
+    for (size_type i=0; i<row_block_sizes.size(); ++i)
+      for (size_type j=0; j<col_block_sizes.size(); ++j)
         this->block(i,j).reinit(row_block_sizes[i],col_block_sizes[j]);
     this->collect_sizes();
   }
@@ -757,8 +761,8 @@ namespace TrilinosWrappers
     dealii::BlockSparsityPatternBase<SparsityPattern>::
     reinit(parallel_partitioning.size(),
            parallel_partitioning.size());
-    for (unsigned int i=0; i<parallel_partitioning.size(); ++i)
-      for (unsigned int j=0; j<parallel_partitioning.size(); ++j)
+    for (size_type i=0; i<parallel_partitioning.size(); ++i)
+      for (size_type j=0; j<parallel_partitioning.size(); ++j)
         this->block(i,j).reinit(parallel_partitioning[i],
                                 parallel_partitioning[j]);
     this->collect_sizes();
@@ -773,8 +777,8 @@ namespace TrilinosWrappers
     dealii::BlockSparsityPatternBase<SparsityPattern>::
     reinit(parallel_partitioning.size(),
            parallel_partitioning.size());
-    for (unsigned int i=0; i<parallel_partitioning.size(); ++i)
-      for (unsigned int j=0; j<parallel_partitioning.size(); ++j)
+    for (size_type i=0; i<parallel_partitioning.size(); ++i)
+      for (size_type j=0; j<parallel_partitioning.size(); ++j)
         this->block(i,j).reinit(parallel_partitioning[i],
                                 parallel_partitioning[j],
                                 communicator);
index 134da283129ca9d5842fadfe8c5f9a992ed977ad..3399fbda3066e74d5b23980f4dc2ce0868254cae 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/block_vector.templates.h>
 
index a2c442c7e4ee86c6b69b821f9fd2a13fa49e1718..cc9f945d8873caec45ac8aabdfeea2dd5d244170 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (S : REAL_SCALARS)
index 9bbbd73fd18f4970e925471bfda0439465a93f49..a3b4663d1bed67abd3999b6d5cc0b77fb4d31456 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/chunk_sparse_matrix.templates.h>
 #include <deal.II/lac/block_vector.h>
index 3b1b4e6a7466e574ba300bf253b2ecfb5d6690cd..9b5f64387c2b2fa128d72c8d4e6e149fdf0212fe 100644 (file)
@@ -1,15 +1,19 @@
-//----------------------------  sparse_matrix.inst.in  ---------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  sparse_matrix.inst.in  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 // real instantiations
@@ -81,13 +85,13 @@ for (S1, S2 : REAL_SCALARS)
                const S1) const;
     template void ChunkSparseMatrix<S1>::
       PSOR<S2> (Vector<S2> &,
-               const std::vector<unsigned int>&,
-               const std::vector<unsigned int>&,
+               const std::vector<types::global_dof_index>&,
+               const std::vector<types::global_dof_index>&,
                const S1) const;
     template void ChunkSparseMatrix<S1>::
       TPSOR<S2> (Vector<S2> &,
-                const std::vector<unsigned int>&,
-                const std::vector<unsigned int>&,
+                const std::vector<types::global_dof_index>&,
+                const std::vector<types::global_dof_index>&,
                 const S1) const;
     template void ChunkSparseMatrix<S1>::
       SOR_step<S2> (Vector<S2> &,
@@ -188,13 +192,13 @@ for (S1, S2, S3 : REAL_SCALARS;
 //             const S1) const;
 //     template void ChunkSparseMatrix<S1>::
 //       PSOR<S2> (Vector<S2> &,
-//             const std::vector<unsigned int>&,
-//             const std::vector<unsigned int>&,
+//             const std::vector<types::global_dof_index>&,
+//             const std::vector<types::global_dof_index>&,
 //             const S1) const;
 //     template void ChunkSparseMatrix<S1>::
 //       TPSOR<S2> (Vector<S2> &,
-//              const std::vector<unsigned int>&,
-//              const std::vector<unsigned int>&,
+//              const std::vector<types::global_dof_index>&,
+//              const std::vector<types::global_dof_index>&,
 //              const S1) const;
 //     template void ChunkSparseMatrix<S1>::
 //       SOR_step<S2> (Vector<S2> &,
index 5bcb7c047087db0dc7bdb76dbc5eea6271adcc25..a9e5b9de0b1603e00c4d6051040cafca90349b9a 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/chunk_sparsity_pattern.h>
 #include <deal.II/lac/compressed_sparsity_pattern.h>
@@ -42,10 +46,10 @@ ChunkSparsityPattern::ChunkSparsityPattern (const ChunkSparsityPattern &s)
 
 
 
-ChunkSparsityPattern::ChunkSparsityPattern (const unsigned int m,
-                                            const unsigned int n,
-                                            const unsigned int max_per_row,
-                                            const unsigned int chunk_size,
+ChunkSparsityPattern::ChunkSparsityPattern (const size_type m,
+                                            const size_type n,
+                                            const size_type max_per_row,
+                                            const size_type chunk_size,
                                             const bool)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
@@ -54,10 +58,10 @@ ChunkSparsityPattern::ChunkSparsityPattern (const unsigned int m,
 }
 
 
-ChunkSparsityPattern::ChunkSparsityPattern (const unsigned int m,
-                                            const unsigned int n,
-                                            const unsigned int max_per_row,
-                                            const unsigned int chunk_size)
+ChunkSparsityPattern::ChunkSparsityPattern (const size_type m,
+                                            const size_type n,
+                                            const size_type max_per_row,
+                                            const size_type chunk_size)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
 
@@ -67,10 +71,10 @@ ChunkSparsityPattern::ChunkSparsityPattern (const unsigned int m,
 
 
 ChunkSparsityPattern::ChunkSparsityPattern (
-  const unsigned int m,
-  const unsigned int n,
-  const std::vector<unsigned int> &row_lengths,
-  const unsigned int chunk_size,
+  const size_type m,
+  const size_type n,
+  const std::vector<size_type> &row_lengths,
+  const size_type chunk_size,
   const bool)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
@@ -81,10 +85,10 @@ ChunkSparsityPattern::ChunkSparsityPattern (
 
 
 ChunkSparsityPattern::ChunkSparsityPattern (
-  const unsigned int m,
-  const unsigned int n,
-  const std::vector<unsigned int> &row_lengths,
-  const unsigned int chunk_size)
+  const size_type m,
+  const size_type n,
+  const std::vector<size_type> &row_lengths,
+  const size_type chunk_size)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
 
@@ -93,9 +97,9 @@ ChunkSparsityPattern::ChunkSparsityPattern (
 
 
 
-ChunkSparsityPattern::ChunkSparsityPattern (const unsigned int n,
-                                            const unsigned int max_per_row,
-                                            const unsigned int chunk_size)
+ChunkSparsityPattern::ChunkSparsityPattern (const size_type n,
+                                            const size_type max_per_row,
+                                            const size_type chunk_size)
 {
   reinit (n, n, max_per_row, chunk_size);
 }
@@ -103,9 +107,9 @@ ChunkSparsityPattern::ChunkSparsityPattern (const unsigned int n,
 
 
 ChunkSparsityPattern::ChunkSparsityPattern (
-  const unsigned int               m,
-  const std::vector<unsigned int> &row_lengths,
-  const unsigned int chunk_size,
+  const size_type m,
+  const std::vector<size_type> &row_lengths,
+  const size_type chunk_size,
   const bool)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
@@ -116,9 +120,9 @@ ChunkSparsityPattern::ChunkSparsityPattern (
 
 
 ChunkSparsityPattern::ChunkSparsityPattern (
-  const unsigned int               m,
-  const std::vector<unsigned int> &row_lengths,
-  const unsigned int chunk_size)
+  const size_type                m,
+  const std::vector<size_type > &row_lengths,
+  const size_type chunk_size)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
 
@@ -147,10 +151,10 @@ ChunkSparsityPattern::operator = (const ChunkSparsityPattern &s)
 
 
 void
-ChunkSparsityPattern::reinit (const unsigned int m,
-                              const unsigned int n,
-                              const unsigned int max_per_row,
-                              const unsigned int chunk_size,
+ChunkSparsityPattern::reinit (const size_type m,
+                              const size_type n,
+                              const size_type max_per_row,
+                              const size_type chunk_size,
                               const bool)
 {
   reinit (m, n, max_per_row, chunk_size);
@@ -158,15 +162,15 @@ ChunkSparsityPattern::reinit (const unsigned int m,
 
 
 void
-ChunkSparsityPattern::reinit (const unsigned int m,
-                              const unsigned int n,
-                              const unsigned int max_per_row,
-                              const unsigned int chunk_size)
+ChunkSparsityPattern::reinit (const size_type m,
+                              const size_type n,
+                              const size_type max_per_row,
+                              const size_type chunk_size)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
 
   // simply map this function to the other @p{reinit} function
-  const std::vector<unsigned int> row_lengths (m, max_per_row);
+  const std::vector<size_type> row_lengths (m, max_per_row);
   reinit (m, n, row_lengths, chunk_size);
 }
 
@@ -174,10 +178,10 @@ ChunkSparsityPattern::reinit (const unsigned int m,
 
 void
 ChunkSparsityPattern::reinit (
-  const unsigned int m,
-  const unsigned int n,
-  const VectorSlice<const std::vector<unsigned int> > &row_lengths,
-  const unsigned int chunk_size,
+  const size_type m,
+  const size_type n,
+  const VectorSlice<const std::vector<size_type> > &row_lengths,
+  const size_type chunk_size,
   const bool)
 {
   reinit (m, n, row_lengths, chunk_size);
@@ -186,10 +190,10 @@ ChunkSparsityPattern::reinit (
 
 void
 ChunkSparsityPattern::reinit (
-    const unsigned int m,
-    const unsigned int n,
-    const VectorSlice<const std::vector<unsigned int> > &row_lengths,
-    const unsigned int chunk_size)
+  const size_type m,
+  const size_type n,
+  const VectorSlice<const std::vector<size_type> > &row_lengths,
+  const size_type chunk_size)
 {
   Assert (row_lengths.size() == m, ExcInvalidNumber (m));
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
@@ -203,8 +207,8 @@ ChunkSparsityPattern::reinit (
   // to calculate how many chunks we need: we need to round up (m/chunk_size)
   // and (n/chunk_size). rounding up in integer arithmetic equals
   // ((m+chunk_size-1)/chunk_size):
-  const unsigned int m_chunks = (m+chunk_size-1) / chunk_size,
-                     n_chunks = (n+chunk_size-1) / chunk_size;
+  const size_type m_chunks = (m+chunk_size-1) / chunk_size,
+                  n_chunks = (n+chunk_size-1) / chunk_size;
 
   // compute the maximum number of chunks in each row. the passed array
   // denotes the number of entries in each row of the big matrix -- in the
@@ -213,7 +217,7 @@ ChunkSparsityPattern::reinit (
   // and entries in row zero at columns {0,2} and for row one at {4,6} -->
   // we'll need 4 chunks for the first chunk row!) :
   std::vector<unsigned int> chunk_row_lengths (m_chunks, 0);
-  for (unsigned int i=0; i<m; ++i)
+  for (size_type i=0; i<m; ++i)
     chunk_row_lengths[i/chunk_size] += row_lengths[i];
 
   // for the case that the reduced sparsity pattern optimizes the diagonal but
@@ -241,7 +245,7 @@ ChunkSparsityPattern::compress ()
 template <typename SparsityType>
 void
 ChunkSparsityPattern::copy_from (const SparsityType &csp,
-                                 const unsigned int  chunk_size,
+                                 const size_type     chunk_size,
                                  const bool)
 {
   copy_from (csp, chunk_size);
@@ -253,11 +257,16 @@ namespace internal
 {
   namespace
   {
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     // distinguish between compressed sparsity types that define row_begin()
     // and SparsityPattern that uses begin() as iterator type
     template <typename Sparsity>
     void copy_row (const Sparsity       &csp,
-                   const unsigned int    row,
+                   const size_type       row,
                    ChunkSparsityPattern &dst)
     {
       typename Sparsity::row_iterator col_num = csp.row_begin (row);
@@ -266,7 +275,7 @@ namespace internal
     }
 
     void copy_row (const SparsityPattern &csp,
-                   const unsigned int     row,
+                   const size_type        row,
                    ChunkSparsityPattern  &dst)
     {
       SparsityPattern::iterator col_num = csp.begin (row);
@@ -280,14 +289,14 @@ namespace internal
 template <typename SparsityType>
 void
 ChunkSparsityPattern::copy_from (const SparsityType &csp,
-                                 const unsigned int  chunk_size)
+                                 const size_type     chunk_size)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
 
   // count number of entries per row, then initialize the underlying sparsity
   // pattern
-  std::vector<unsigned int> entries_per_row (csp.n_rows(), 0);
-  for (unsigned int row = 0; row<csp.n_rows(); ++row)
+  std::vector<size_type> entries_per_row (csp.n_rows(), 0);
+  for (size_type row = 0; row<csp.n_rows(); ++row)
     entries_per_row[row] = csp.row_length(row);
 
   reinit (csp.n_rows(), csp.n_cols(),
@@ -295,7 +304,7 @@ ChunkSparsityPattern::copy_from (const SparsityType &csp,
           chunk_size);
 
   // then actually fill it
-  for (unsigned int row = 0; row<csp.n_rows(); ++row)
+  for (size_type row = 0; row<csp.n_rows(); ++row)
     internal::copy_row(csp, row, *this);
 
   // finally compress
@@ -307,7 +316,7 @@ ChunkSparsityPattern::copy_from (const SparsityType &csp,
 
 template <typename number>
 void ChunkSparsityPattern::copy_from (const FullMatrix<number> &matrix,
-                                      const unsigned int chunk_size,
+                                      const size_type chunk_size,
                                       const bool)
 {
   copy_from (matrix, chunk_size);
@@ -316,7 +325,7 @@ void ChunkSparsityPattern::copy_from (const FullMatrix<number> &matrix,
 
 template <typename number>
 void ChunkSparsityPattern::copy_from (const FullMatrix<number> &matrix,
-                                      const unsigned int chunk_size)
+                                      const size_type chunk_size)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
 
@@ -324,17 +333,17 @@ void ChunkSparsityPattern::copy_from (const FullMatrix<number> &matrix,
   // pattern. remember to also allocate space for the diagonal entry (if that
   // hasn't happened yet) if m==n since we always allocate that for diagonal
   // matrices
-  std::vector<unsigned int> entries_per_row (matrix.m(), 0);
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  std::vector<size_type> entries_per_row (matrix.m(), 0);
+  for (size_type row=0; row<matrix.m(); ++row)
     {
-      for (unsigned int col=0; col<matrix.n(); ++col)
-       if (matrix(row,col) != 0)
-         ++entries_per_row[row];
+      for (size_type col=0; col<matrix.n(); ++col)
+        if (matrix(row,col) != 0)
+          ++entries_per_row[row];
 
       if ((matrix.m() == matrix.n())
-         &&
-         (matrix(row,row) == 0))
-       ++entries_per_row[row];
+          &&
+          (matrix(row,row) == 0))
+        ++entries_per_row[row];
     }
 
   reinit (matrix.m(), matrix.n(),
@@ -342,8 +351,8 @@ void ChunkSparsityPattern::copy_from (const FullMatrix<number> &matrix,
           chunk_size);
 
   // then actually fill it
-  for (unsigned int row=0; row<matrix.m(); ++row)
-    for (unsigned int col=0; col<matrix.n(); ++col)
+  for (size_type row=0; row<matrix.m(); ++row)
+    for (size_type col=0; col<matrix.n(); ++col)
       if (matrix(row,col) != 0)
         add (row,col);
 
@@ -354,10 +363,10 @@ void ChunkSparsityPattern::copy_from (const FullMatrix<number> &matrix,
 
 void
 ChunkSparsityPattern::reinit (
-  const unsigned int m,
-  const unsigned int n,
-  const std::vector<unsigned int> &row_lengths,
-  const unsigned int chunk_size,
+  const size_type m,
+  const size_type n,
+  const std::vector<size_type> &row_lengths,
+  const size_type chunk_size,
   const bool)
 {
   reinit (m, n, row_lengths, chunk_size);
@@ -366,10 +375,10 @@ ChunkSparsityPattern::reinit (
 
 void
 ChunkSparsityPattern::reinit (
-  const unsigned int m,
-  const unsigned int n,
-  const std::vector<unsigned int> &row_lengths,
-  const unsigned int chunk_size)
+  const size_type m,
+  const size_type n,
+  const std::vector<size_type> &row_lengths,
+  const size_type chunk_size)
 {
   Assert (chunk_size > 0, ExcInvalidNumber (chunk_size));
 
@@ -433,7 +442,7 @@ ChunkSparsityPattern::empty () const
 
 
 
-unsigned int
+ChunkSparsityPattern::size_type
 ChunkSparsityPattern::max_entries_per_row () const
 {
   return sparsity_pattern.max_entries_per_row() * chunk_size;
@@ -442,8 +451,8 @@ ChunkSparsityPattern::max_entries_per_row () const
 
 
 void
-ChunkSparsityPattern::add (const unsigned int i,
-                           const unsigned int j)
+ChunkSparsityPattern::add (const size_type i,
+                           const size_type j)
 {
   Assert (i<rows, ExcInvalidIndex(i,rows));
   Assert (j<cols, ExcInvalidIndex(j,cols));
@@ -453,8 +462,8 @@ ChunkSparsityPattern::add (const unsigned int i,
 
 
 bool
-ChunkSparsityPattern::exists (const unsigned int i,
-                              const unsigned int j) const
+ChunkSparsityPattern::exists (const size_type i,
+                              const size_type j) const
 {
   Assert (i<rows, ExcIndexRange(i,0,rows));
   Assert (j<cols, ExcIndexRange(j,0,cols));
@@ -478,8 +487,8 @@ ChunkSparsityPattern::symmetrize ()
 
 
 
-unsigned int
-ChunkSparsityPattern::row_length (const unsigned int i) const
+ChunkSparsityPattern::size_type
+ChunkSparsityPattern::row_length (const size_type i) const
 {
   Assert (i<rows, ExcIndexRange(i,0,rows));
 
@@ -504,7 +513,7 @@ ChunkSparsityPattern::row_length (const unsigned int i) const
 
 
 
-unsigned int
+ChunkSparsityPattern::size_type
 ChunkSparsityPattern::n_nonzero_elements () const
 {
   if ((n_rows() % chunk_size == 0)
@@ -523,9 +532,9 @@ ChunkSparsityPattern::n_nonzero_elements () const
           (n_cols() % chunk_size == 0))
         {
           // columns align with chunks, but not rows
-          unsigned int n = sparsity_pattern.n_nonzero_elements() *
-                           chunk_size *
-                           chunk_size;
+          size_type n = sparsity_pattern.n_nonzero_elements() *
+                        chunk_size *
+                        chunk_size;
           n -= (sparsity_pattern.n_rows() * chunk_size - n_rows()) *
                sparsity_pattern.row_length(sparsity_pattern.n_rows()-1) *
                chunk_size;
@@ -534,38 +543,38 @@ ChunkSparsityPattern::n_nonzero_elements () const
 
       else
         {
-         // if columns don't align, then just iterate over all chunks and see
-         // what this leads to. follow the advice in the documentation of the
-         // sparsity pattern iterators to do the loop over individual rows,
-         // rather than all elements
-         unsigned int n = 0;
-
-         for (unsigned int row = 0; row < sparsity_pattern.n_rows(); ++row)
-           {
-             SparsityPattern::const_iterator p = sparsity_pattern.begin(row);
-             for (; p!=sparsity_pattern.end(row); ++p)
-               if ((row != sparsity_pattern.n_rows() - 1)
-                   &&
-                   (p->column() != sparsity_pattern.n_cols() - 1))
-                 n += chunk_size * chunk_size;
-               else if ((row == sparsity_pattern.n_rows() - 1)
-                   &&
-                   (p->column() != sparsity_pattern.n_cols() - 1))
-                 // last chunk row, but not last chunk column. only a smaller
-                 // number (n_rows % chunk_size) of rows actually exist
-                 n += (n_rows() % chunk_size) * chunk_size;
-               else if ((row != sparsity_pattern.n_rows() - 1)
-                   &&
-                   (p->column() == sparsity_pattern.n_cols() - 1))
-                 // last chunk column, but not row
-                 n += (n_cols() % chunk_size) * chunk_size;
-               else
-                 // bottom right chunk
-                 n += (n_cols() % chunk_size) *
-                 (n_rows() % chunk_size);
-           }
-
-         return n;
+          // if columns don't align, then just iterate over all chunks and see
+          // what this leads to. follow the advice in the documentation of the
+          // sparsity pattern iterators to do the loop over individual rows,
+          // rather than all elements
+          size_type n = 0;
+
+          for (size_type row = 0; row < sparsity_pattern.n_rows(); ++row)
+            {
+              SparsityPattern::const_iterator p = sparsity_pattern.begin(row);
+              for (; p!=sparsity_pattern.end(row); ++p)
+                if ((row != sparsity_pattern.n_rows() - 1)
+                    &&
+                    (p->column() != sparsity_pattern.n_cols() - 1))
+                  n += chunk_size * chunk_size;
+                else if ((row == sparsity_pattern.n_rows() - 1)
+                         &&
+                         (p->column() != sparsity_pattern.n_cols() - 1))
+                  // last chunk row, but not last chunk column. only a smaller
+                  // number (n_rows % chunk_size) of rows actually exist
+                  n += (n_rows() % chunk_size) * chunk_size;
+                else if ((row != sparsity_pattern.n_rows() - 1)
+                         &&
+                         (p->column() == sparsity_pattern.n_cols() - 1))
+                  // last chunk column, but not row
+                  n += (n_cols() % chunk_size) * chunk_size;
+                else
+                  // bottom right chunk
+                  n += (n_cols() % chunk_size) *
+                       (n_rows() % chunk_size);
+            }
+
+          return n;
         }
     }
 }
@@ -580,16 +589,16 @@ ChunkSparsityPattern::print (std::ostream &out) const
 
   AssertThrow (out, ExcIO());
 
-  for (unsigned int i=0; i<sparsity_pattern.rows; ++i)
-    for (unsigned int d=0;
+  for (size_type i=0; i<sparsity_pattern.rows; ++i)
+    for (size_type d=0;
          (d<chunk_size) && (i*chunk_size + d < n_rows());
          ++d)
       {
         out << '[' << i *chunk_size+d;
-        for (unsigned int j=sparsity_pattern.rowstart[i];
+        for (size_type j=sparsity_pattern.rowstart[i];
              j<sparsity_pattern.rowstart[i+1]; ++j)
           if (sparsity_pattern.colnums[j] != sparsity_pattern.invalid_entry)
-            for (unsigned int e=0;
+            for (size_type e=0;
                  ((e<chunk_size) &&
                   (sparsity_pattern.colnums[j]*chunk_size + e < n_cols()));
                  ++e)
@@ -612,15 +621,15 @@ ChunkSparsityPattern::print_gnuplot (std::ostream &out) const
 
   // for each entry in the underlying sparsity pattern, repeat everything
   // chunk_size x chunk_size times
-  for (unsigned int i=0; i<sparsity_pattern.rows; ++i)
-    for (unsigned int j=sparsity_pattern.rowstart[i];
+  for (size_type i=0; i<sparsity_pattern.rows; ++i)
+    for (size_type j=sparsity_pattern.rowstart[i];
          j<sparsity_pattern.rowstart[i+1]; ++j)
       if (sparsity_pattern.colnums[j] != sparsity_pattern.invalid_entry)
-        for (unsigned int d=0;
+        for (size_type d=0;
              ((d<chunk_size) &&
               (sparsity_pattern.colnums[j]*chunk_size+d < n_cols()));
              ++d)
-          for (unsigned int e=0;
+          for (size_type e=0;
                (e<chunk_size) && (i*chunk_size + e < n_rows());
                ++e)
             // while matrix entries are usually written (i,j), with i vertical
@@ -635,7 +644,7 @@ ChunkSparsityPattern::print_gnuplot (std::ostream &out) const
 
 
 
-unsigned int
+ChunkSparsityPattern::size_type
 ChunkSparsityPattern::bandwidth () const
 {
   // calculate the bandwidth from that of the underlying sparsity
@@ -722,19 +731,19 @@ ChunkSparsityPattern::memory_consumption () const
 // explicit instantiations
 template
 void ChunkSparsityPattern::copy_from<SparsityPattern> (const SparsityPattern &,
-                                                       const unsigned int,
+                                                       const size_type,
                                                        const bool);
 template
 void ChunkSparsityPattern::copy_from<CompressedSparsityPattern> (const CompressedSparsityPattern &,
-    const unsigned int,
+    const size_type ,
     const bool);
 template
 void ChunkSparsityPattern::copy_from<CompressedSetSparsityPattern> (const CompressedSetSparsityPattern &,
-    const unsigned int,
+    const size_type ,
     const bool);
 template
 void ChunkSparsityPattern::copy_from<CompressedSimpleSparsityPattern> (const CompressedSimpleSparsityPattern &,
-    const unsigned int,
+    const size_type ,
     const bool);
 template
 void ChunkSparsityPattern::create_from<SparsityPattern>
@@ -766,11 +775,11 @@ void ChunkSparsityPattern::create_from<CompressedSimpleSparsityPattern>
  const bool);
 template
 void ChunkSparsityPattern::copy_from<float> (const FullMatrix<float> &,
-                                             const unsigned int,
+                                             const size_type ,
                                              const bool);
 template
 void ChunkSparsityPattern::copy_from<double> (const FullMatrix<double> &,
-                                              const unsigned int,
+                                              const size_type ,
                                               const bool);
 
 DEAL_II_NAMESPACE_CLOSE
index 6a99f09f16393336bc401b1887b27f7d4d999aef..8086c68642cd7e38893e099523d84c2fae998373 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/compressed_set_sparsity_pattern.h>
 
@@ -46,8 +48,8 @@ CompressedSetSparsityPattern (const CompressedSetSparsityPattern &s)
 
 
 
-CompressedSetSparsityPattern::CompressedSetSparsityPattern (const unsigned int m,
-                                                            const unsigned int n)
+CompressedSetSparsityPattern::CompressedSetSparsityPattern (const size_type m,
+                                                            const size_type n)
   :
   rows(0),
   cols(0)
@@ -57,7 +59,7 @@ CompressedSetSparsityPattern::CompressedSetSparsityPattern (const unsigned int m
 
 
 
-CompressedSetSparsityPattern::CompressedSetSparsityPattern (const unsigned int n)
+CompressedSetSparsityPattern::CompressedSetSparsityPattern (const size_type n)
   :
   rows(0),
   cols(0)
@@ -82,8 +84,8 @@ CompressedSetSparsityPattern::operator = (const CompressedSetSparsityPattern &s)
 
 
 void
-CompressedSetSparsityPattern::reinit (const unsigned int m,
-                                      const unsigned int n)
+CompressedSetSparsityPattern::reinit (const size_type m,
+                                      const size_type n)
 {
   rows = m;
   cols = n;
@@ -108,13 +110,13 @@ CompressedSetSparsityPattern::empty () const
 
 
 
-unsigned int
+CompressedSetSparsityPattern::size_type
 CompressedSetSparsityPattern::max_entries_per_row () const
 {
-  unsigned int m = 0;
-  for (unsigned int i=0; i<rows; ++i)
+  size_type m = 0;
+  for (size_type i=0; i<rows; ++i)
     {
-      m = std::max (m, static_cast<unsigned int>(lines[i].entries.size()));
+      m = std::max (m, static_cast<size_type>(lines[i].entries.size()));
     }
 
   return m;
@@ -123,8 +125,8 @@ CompressedSetSparsityPattern::max_entries_per_row () const
 
 
 bool
-CompressedSetSparsityPattern::exists (const unsigned int i,
-                                      const unsigned int j) const
+CompressedSetSparsityPattern::exists (const size_type i,
+                                      const size_type j) const
 {
   Assert (i<rows, ExcIndexRange(i, 0, rows));
   Assert (j<cols, ExcIndexRange(j, 0, cols));
@@ -150,9 +152,9 @@ CompressedSetSparsityPattern::symmetrize ()
   // 2. that the @p{add} function can
   // be called on elements that
   // already exist without any harm
-  for (unsigned int row=0; row<rows; ++row)
+  for (size_type row=0; row<rows; ++row)
     {
-      for (std::set<unsigned int>::const_iterator
+      for (std::set<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end();
            ++j)
@@ -170,11 +172,11 @@ CompressedSetSparsityPattern::print (std::ostream &out) const
 {
   AssertThrow (out, ExcIO());
 
-  for (unsigned int row=0; row<rows; ++row)
+  for (size_type row=0; row<rows; ++row)
     {
       out << '[' << row;
 
-      for (std::set<unsigned int>::const_iterator
+      for (std::set<size_type >::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
         out << ',' << *j;
@@ -192,9 +194,9 @@ CompressedSetSparsityPattern::print_gnuplot (std::ostream &out) const
 {
   AssertThrow (out, ExcIO());
 
-  for (unsigned int row=0; row<rows; ++row)
+  for (size_type row=0; row<rows; ++row)
     {
-      for (std::set<unsigned int>::const_iterator
+      for (std::set<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
         // while matrix entries are usually
@@ -211,16 +213,16 @@ CompressedSetSparsityPattern::print_gnuplot (std::ostream &out) const
 
 
 
-unsigned int
+CompressedSetSparsityPattern::size_type
 CompressedSetSparsityPattern::bandwidth () const
 {
-  unsigned int b=0;
-  for (unsigned int row=0; row<rows; ++row)
+  size_type b=0;
+  for (size_type row=0; row<rows; ++row)
     {
-      for (std::set<unsigned int>::const_iterator
+      for (std::set<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
-        if (static_cast<unsigned int>(std::abs(static_cast<int>(row-*j))) > b)
+        if (static_cast<size_type>(std::abs(static_cast<int>(row-*j))) > b)
           b = std::abs(static_cast<signed int>(row-*j));
     }
 
@@ -229,11 +231,11 @@ CompressedSetSparsityPattern::bandwidth () const
 
 
 
-unsigned int
+CompressedSetSparsityPattern::size_type
 CompressedSetSparsityPattern::n_nonzero_elements () const
 {
-  unsigned int n=0;
-  for (unsigned int i=0; i<rows; ++i)
+  size_type n=0;
+  for (size_type i=0; i<rows; ++i)
     {
       n += lines[i].entries.size();
     }
index 72e6164fa534058411879365c1c814258d36f27e..df3953b87f6245f76f6b209a17d061903240c60f 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/compressed_simple_sparsity_pattern.h>
 #include <deal.II/base/memory_consumption.h>
@@ -34,7 +36,7 @@ CompressedSimpleSparsityPattern::Line::add_entries (ForwardIterator begin,
   if (n_elements <= 0)
     return;
 
-  const unsigned int stop_size = entries.size() + n_elements;
+  const size_type stop_size = entries.size() + n_elements;
 
   if (indices_are_sorted == true && n_elements > 3)
     {
@@ -60,8 +62,8 @@ CompressedSimpleSparsityPattern::Line::add_entries (ForwardIterator begin,
       // first entry is a duplicate before
       // actually doing something.
       ForwardIterator my_it = begin;
-      unsigned int col = *my_it;
-      std::vector<unsigned int>::iterator it =
+      size_type col = *my_it;
+      std::vector<size_type>::iterator it =
         Utilities::lower_bound(entries.begin(), entries.end(), col);
       while (*it == col)
         {
@@ -90,14 +92,14 @@ CompressedSimpleSparsityPattern::Line::add_entries (ForwardIterator begin,
 
       // resize vector by just inserting the
       // list
-      const unsigned int pos1 = it - entries.begin();
+      const size_type pos1 = it - entries.begin();
       Assert (pos1 <= entries.size(), ExcInternalError());
       entries.insert (it, my_it, end);
       it = entries.begin() + pos1;
-      Assert (entries.size() >= (unsigned int)(it-entries.begin()), ExcInternalError());
+      Assert (entries.size() >= (size_type)(it-entries.begin()), ExcInternalError());
 
       // now merge the two lists.
-      std::vector<unsigned int>::iterator it2 = it + (end-my_it);
+      std::vector<size_type>::iterator it2 = it + (end-my_it);
 
       // as long as there are indices both in
       // the end of the entries list and in the
@@ -125,7 +127,7 @@ CompressedSimpleSparsityPattern::Line::add_entries (ForwardIterator begin,
         *it++ = *it2++;
 
       // resize and return
-      const unsigned int new_size = it - entries.begin();
+      const size_type new_size = it - entries.begin();
       Assert (new_size <= stop_size, ExcInternalError());
       entries.resize (new_size);
       return;
@@ -140,8 +142,8 @@ CompressedSimpleSparsityPattern::Line::add_entries (ForwardIterator begin,
   if (stop_size > entries.capacity())
     entries.reserve (stop_size);
 
-  unsigned int col = *my_it;
-  std::vector<unsigned int>::iterator it, it2;
+  size_type col = *my_it;
+  std::vector<size_type>::iterator it, it2;
   // insert the first element as for one
   // entry only first check the last
   // element (or if line is still empty)
@@ -206,10 +208,10 @@ CompressedSimpleSparsityPattern::Line::add_entries (ForwardIterator begin,
 }
 
 
-std::size_t
+CompressedSimpleSparsityPattern::size_type
 CompressedSimpleSparsityPattern::Line::memory_consumption () const
 {
-  return entries.capacity()*sizeof(unsigned int)+sizeof(Line);
+  return entries.capacity()*sizeof(size_type)+sizeof(Line);
 }
 
 
@@ -236,8 +238,8 @@ CompressedSimpleSparsityPattern (const CompressedSimpleSparsityPattern &s)
 
 
 
-CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const unsigned int m,
-    const unsigned int n,
+CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const size_type m,
+    const size_type n,
     const IndexSet &rowset_
                                                                  )
   :
@@ -249,8 +251,17 @@ CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const unsigned
 }
 
 
+CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const IndexSet &rowset_)
+  :
+  rows(0),
+  cols(0),
+  rowset(0)
+{
+  reinit (rowset_.size(), rowset_.size(), rowset_);
+}
+
 
-CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const unsigned int n)
+CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const size_type n)
   :
   rows(0),
   cols(0),
@@ -276,8 +287,8 @@ CompressedSimpleSparsityPattern::operator = (const CompressedSimpleSparsityPatte
 
 
 void
-CompressedSimpleSparsityPattern::reinit (const unsigned int m,
-                                         const unsigned int n,
+CompressedSimpleSparsityPattern::reinit (const size_type m,
+                                         const size_type n,
                                          const IndexSet &rowset_)
 {
   rows = m;
@@ -306,13 +317,13 @@ CompressedSimpleSparsityPattern::empty () const
 
 
 
-unsigned int
+CompressedSimpleSparsityPattern::size_type
 CompressedSimpleSparsityPattern::max_entries_per_row () const
 {
-  unsigned int m = 0;
-  for (unsigned int i=0; i<lines.size(); ++i)
+  size_type m = 0;
+  for (size_type i=0; i<lines.size(); ++i)
     {
-      m = std::max (m, static_cast<unsigned int>(lines[i].entries.size()));
+      m = std::max (m, static_cast<size_type>(lines[i].entries.size()));
     }
 
   return m;
@@ -321,14 +332,14 @@ CompressedSimpleSparsityPattern::max_entries_per_row () const
 
 
 bool
-CompressedSimpleSparsityPattern::exists (const unsigned int i,
-                                         const unsigned int j) const
+CompressedSimpleSparsityPattern::exists (const size_type i,
+                                         const size_type j) const
 {
   Assert (i<rows, ExcIndexRange(i, 0, rows));
   Assert (j<cols, ExcIndexRange(j, 0, cols));
   Assert( rowset.size()==0 || rowset.is_element(i), ExcInternalError());
 
-  const unsigned int rowindex =
+  const size_type rowindex =
     rowset.size()==0 ? i : rowset.index_within_set(i);
 
   return std::binary_search (lines[rowindex].entries.begin(),
@@ -354,12 +365,12 @@ CompressedSimpleSparsityPattern::symmetrize ()
   // 2. that the @p{add} function can
   // be called on elements that
   // already exist without any harm
-  for (unsigned int row=0; row<lines.size(); ++row)
+  for (size_type row=0; row<lines.size(); ++row)
     {
-      const unsigned int rowindex =
+      const size_type rowindex =
         rowset.size()==0 ? row : rowset.nth_index_in_set(row);
 
-      for (std::vector<unsigned int>::const_iterator
+      for (std::vector<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end();
            ++j)
@@ -375,11 +386,11 @@ CompressedSimpleSparsityPattern::symmetrize ()
 void
 CompressedSimpleSparsityPattern::print (std::ostream &out) const
 {
-  for (unsigned int row=0; row<lines.size(); ++row)
+  for (size_type row=0; row<lines.size(); ++row)
     {
       out << '[' << (rowset.size()==0 ? row : rowset.nth_index_in_set(row));
 
-      for (std::vector<unsigned int>::const_iterator
+      for (std::vector<size_type >::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
         out << ',' << *j;
@@ -395,12 +406,12 @@ CompressedSimpleSparsityPattern::print (std::ostream &out) const
 void
 CompressedSimpleSparsityPattern::print_gnuplot (std::ostream &out) const
 {
-  for (unsigned int row=0; row<lines.size(); ++row)
+  for (size_type row=0; row<lines.size(); ++row)
     {
-      const unsigned int rowindex =
+      const size_type rowindex =
         rowset.size()==0 ? row : rowset.nth_index_in_set(row);
 
-      for (std::vector<unsigned int>::const_iterator
+      for (std::vector<size_type >::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
         // while matrix entries are usually
@@ -419,19 +430,19 @@ CompressedSimpleSparsityPattern::print_gnuplot (std::ostream &out) const
 
 
 
-unsigned int
+CompressedSimpleSparsityPattern::size_type
 CompressedSimpleSparsityPattern::bandwidth () const
 {
-  unsigned int b=0;
-  for (unsigned int row=0; row<lines.size(); ++row)
+  size_type b=0;
+  for (size_type row=0; row<lines.size(); ++row)
     {
-      const unsigned int rowindex =
+      const size_type rowindex =
         rowset.size()==0 ? row : rowset.nth_index_in_set(row);
 
-      for (std::vector<unsigned int>::const_iterator
+      for (std::vector<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
-        if (static_cast<unsigned int>(std::abs(static_cast<int>(rowindex-*j))) > b)
+        if (static_cast<size_type>(std::abs(static_cast<int>(rowindex-*j))) > b)
           b = std::abs(static_cast<signed int>(rowindex-*j));
     }
 
@@ -440,11 +451,11 @@ CompressedSimpleSparsityPattern::bandwidth () const
 
 
 
-unsigned int
+CompressedSimpleSparsityPattern::size_type
 CompressedSimpleSparsityPattern::n_nonzero_elements () const
 {
-  unsigned int n=0;
-  for (unsigned int i=0; i<lines.size(); ++i)
+  size_type n=0;
+  for (size_type i=0; i<lines.size(); ++i)
     {
       n += lines[i].entries.size();
     }
@@ -453,12 +464,12 @@ CompressedSimpleSparsityPattern::n_nonzero_elements () const
 }
 
 
-std::size_t
+CompressedSimpleSparsityPattern::size_type
 CompressedSimpleSparsityPattern::memory_consumption () const
 {
   //TODO: IndexSet...
-  std::size_t mem = sizeof(CompressedSimpleSparsityPattern);
-  for (unsigned int i=0; i<lines.size(); ++i)
+  size_type mem = sizeof(CompressedSimpleSparsityPattern);
+  for (size_type i=0; i<lines.size(); ++i)
     mem += MemoryConsumption::memory_consumption (lines[i]);
 
   return mem;
@@ -466,16 +477,16 @@ CompressedSimpleSparsityPattern::memory_consumption () const
 
 
 // explicit instantiations
-template void CompressedSimpleSparsityPattern::Line::add_entries(unsigned int *,
-    unsigned int *,
+template void CompressedSimpleSparsityPattern::Line::add_entries(size_type *,
+    size_type *,
     const bool);
-template void CompressedSimpleSparsityPattern::Line::add_entries(const unsigned int *,
-    const unsigned int *,
+template void CompressedSimpleSparsityPattern::Line::add_entries(const size_type *,
+    const size_type *,
     const bool);
 #ifndef DEAL_II_VECTOR_ITERATOR_IS_POINTER
 template void CompressedSimpleSparsityPattern::Line::
-add_entries(std::vector<unsigned int>::iterator,
-            std::vector<unsigned int>::iterator,
+add_entries(std::vector<size_type>::iterator,
+            std::vector<size_type>::iterator,
             const bool);
 #endif
 
index 391824fe614580943614a3c528f11869c534ba19..a857dec9c1d717b2d6dec756d70afddc158572e7 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/compressed_sparsity_pattern.h>
 
@@ -151,7 +153,7 @@ CompressedSparsityPattern::Line::flush_cache () const
               ExcInternalError());
       if (n_new_entries > entries.size())
         {
-          std::vector<unsigned int> new_entries;
+          std::vector<types::global_dof_index> new_entries;
           new_entries.reserve (n_new_entries);
           unsigned int cache_position = 0;
           unsigned int entry_position = 0;
@@ -265,7 +267,7 @@ CompressedSparsityPattern::Line::add_entries (ForwardIterator begin,
                   ExcInternalError());
           if (n_new_entries > entries.size())
             {
-              std::vector<unsigned int> new_entries;
+              std::vector<types::global_dof_index> new_entries;
               new_entries.reserve (n_new_entries);
               ForwardIterator my_it = begin;
               unsigned int entry_position = 0;
@@ -338,8 +340,8 @@ CompressedSparsityPattern (const CompressedSparsityPattern &s)
 
 
 
-CompressedSparsityPattern::CompressedSparsityPattern (const unsigned int m,
-                                                      const unsigned int n)
+CompressedSparsityPattern::CompressedSparsityPattern (const size_type m,
+                                                      const size_type n)
   :
   rows(0),
   cols(0)
@@ -349,7 +351,7 @@ CompressedSparsityPattern::CompressedSparsityPattern (const unsigned int m,
 
 
 
-CompressedSparsityPattern::CompressedSparsityPattern (const unsigned int n)
+CompressedSparsityPattern::CompressedSparsityPattern (const size_type n)
   :
   rows(0),
   cols(0)
@@ -374,8 +376,8 @@ CompressedSparsityPattern::operator = (const CompressedSparsityPattern &s)
 
 
 void
-CompressedSparsityPattern::reinit (const unsigned int m,
-                                   const unsigned int n)
+CompressedSparsityPattern::reinit (const size_type m,
+                                   const size_type n)
 {
   rows = m;
   cols = n;
@@ -400,15 +402,15 @@ CompressedSparsityPattern::empty () const
 
 
 
-unsigned int
+CompressedSparsityPattern::size_type
 CompressedSparsityPattern::max_entries_per_row () const
 {
-  unsigned int m = 0;
-  for (unsigned int i=0; i<rows; ++i)
+  size_type m = 0;
+  for (size_type i=0; i<rows; ++i)
     {
       if (lines[i].cache_entries != 0)
         lines[i].flush_cache ();
-      m = std::max (m, static_cast<unsigned int>(lines[i].entries.size()));
+      m = std::max (m, static_cast<size_type>(lines[i].entries.size()));
     }
 
   return m;
@@ -417,8 +419,8 @@ CompressedSparsityPattern::max_entries_per_row () const
 
 
 bool
-CompressedSparsityPattern::exists (const unsigned int i,
-                                   const unsigned int j) const
+CompressedSparsityPattern::exists (const size_type i,
+                                   const size_type j) const
 {
   Assert (i<rows, ExcIndexRange(i, 0, rows));
   Assert (j<cols, ExcIndexRange(j, 0, cols));
@@ -448,11 +450,11 @@ CompressedSparsityPattern::symmetrize ()
   // 2. that the @p{add} function can
   // be called on elements that
   // already exist without any harm
-  for (unsigned int row=0; row<rows; ++row)
+  for (size_type row=0; row<rows; ++row)
     {
       if (lines[row].cache_entries != 0)
         lines[row].flush_cache ();
-      for (std::vector<unsigned int>::const_iterator
+      for (std::vector<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end();
            ++j)
@@ -468,14 +470,14 @@ CompressedSparsityPattern::symmetrize ()
 void
 CompressedSparsityPattern::print (std::ostream &out) const
 {
-  for (unsigned int row=0; row<rows; ++row)
+  for (size_type row=0; row<rows; ++row)
     {
       if (lines[row].cache_entries != 0)
         lines[row].flush_cache ();
 
       out << '[' << row;
 
-      for (std::vector<unsigned int>::const_iterator
+      for (std::vector<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
         out << ',' << *j;
@@ -491,11 +493,11 @@ CompressedSparsityPattern::print (std::ostream &out) const
 void
 CompressedSparsityPattern::print_gnuplot (std::ostream &out) const
 {
-  for (unsigned int row=0; row<rows; ++row)
+  for (size_type row=0; row<rows; ++row)
     {
       if (lines[row].cache_entries != 0)
         lines[row].flush_cache ();
-      for (std::vector<unsigned int>::const_iterator
+      for (std::vector<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
         // while matrix entries are usually
@@ -511,19 +513,19 @@ CompressedSparsityPattern::print_gnuplot (std::ostream &out) const
 
 
 
-unsigned int
+CompressedSparsityPattern::size_type
 CompressedSparsityPattern::bandwidth () const
 {
-  unsigned int b=0;
-  for (unsigned int row=0; row<rows; ++row)
+  size_type b=0;
+  for (size_type row=0; row<rows; ++row)
     {
       if (lines[row].cache_entries != 0)
         lines[row].flush_cache ();
 
-      for (std::vector<unsigned int>::const_iterator
+      for (std::vector<size_type>::const_iterator
            j=lines[row].entries.begin();
            j != lines[row].entries.end(); ++j)
-        if (static_cast<unsigned int>(std::abs(static_cast<int>(row-*j))) > b)
+        if (static_cast<size_type>(std::abs(static_cast<int>(row-*j))) > b)
           b = std::abs(static_cast<signed int>(row-*j));
     }
 
@@ -532,11 +534,11 @@ CompressedSparsityPattern::bandwidth () const
 
 
 
-unsigned int
+CompressedSparsityPattern::size_type
 CompressedSparsityPattern::n_nonzero_elements () const
 {
-  unsigned int n=0;
-  for (unsigned int i=0; i<rows; ++i)
+  size_type n=0;
+  for (size_type i=0; i<rows; ++i)
     {
       if (lines[i].cache_entries != 0)
         lines[i].flush_cache ();
@@ -548,16 +550,16 @@ CompressedSparsityPattern::n_nonzero_elements () const
 
 
 // explicit instantiations
-template void CompressedSparsityPattern::Line::add_entries(unsigned int *,
-                                                           unsigned int *,
+template void CompressedSparsityPattern::Line::add_entries(size_type *,
+                                                           size_type *,
                                                            const bool);
-template void CompressedSparsityPattern::Line::add_entries(const unsigned int *,
-                                                           const unsigned int *,
+template void CompressedSparsityPattern::Line::add_entries(const size_type *,
+                                                           const size_type *,
                                                            const bool);
 #ifndef DEAL_II_VECTOR_ITERATOR_IS_POINTER
 template void CompressedSparsityPattern::Line::
-add_entries(std::vector<unsigned int>::iterator,
-            std::vector<unsigned int>::iterator,
+add_entries(std::vector<size_type>::iterator,
+            std::vector<size_type>::iterator,
             const bool);
 #endif
 
index 3e7c63c3845a23acfbec934fa9aaec2a4600e48e..099e3703d6925fad293116dbedd2d02ac07c507a 100644 (file)
@@ -1,15 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/constraint_matrix.h>
 #include <deal.II/lac/constraint_matrix.templates.h>
@@ -54,7 +57,7 @@ const Table<2,bool> ConstraintMatrix::default_empty_table = Table<2,bool>();
 
 
 bool
-ConstraintMatrix::check_zero_weight (const std::pair<unsigned int, double> &p)
+ConstraintMatrix::check_zero_weight (const std::pair<size_type, double> &p)
 {
   return (p.second == 0);
 }
@@ -88,9 +91,9 @@ ConstraintMatrix::ConstraintLine::memory_consumption () const
 
 
 void
-ConstraintMatrix::add_lines (const std::set<unsigned int> &lines)
+ConstraintMatrix::add_lines (const std::set<size_type> &lines)
 {
-  for (std::set<unsigned int>::const_iterator
+  for (std::set<size_type>::const_iterator
        i = lines.begin(); i != lines.end(); ++i)
     add_line (*i);
 }
@@ -100,7 +103,7 @@ ConstraintMatrix::add_lines (const std::set<unsigned int> &lines)
 void
 ConstraintMatrix::add_lines (const std::vector<bool> &lines)
 {
-  for (unsigned int i=0; i<lines.size(); ++i)
+  for (size_type i=0; i<lines.size(); ++i)
     if (lines[i] == true)
       add_line (i);
 }
@@ -110,7 +113,7 @@ ConstraintMatrix::add_lines (const std::vector<bool> &lines)
 void
 ConstraintMatrix::add_lines (const IndexSet &lines)
 {
-  for (unsigned int i=0; i<lines.n_elements(); ++i)
+  for (size_type i=0; i<lines.n_elements(); ++i)
     add_line (lines.nth_index_in_set(i));
 }
 
@@ -118,8 +121,8 @@ ConstraintMatrix::add_lines (const IndexSet &lines)
 
 void
 ConstraintMatrix::add_entries
-(const unsigned int                                  line,
- const std::vector<std::pair<unsigned int,double> > &col_val_pairs)
+(const size_type                                  line,
+ const std::vector<std::pair<size_type,double> > &col_val_pairs)
 {
   Assert (sorted==false, ExcMatrixIsClosed());
   Assert (is_constrained(line), ExcLineInexistant(line));
@@ -132,7 +135,7 @@ ConstraintMatrix::add_entries
   //
   // in any case: skip this entry if an entry for this column already
   // exists, since we don't want to enter it twice
-  for (std::vector<std::pair<unsigned int,double> >::const_iterator
+  for (std::vector<std::pair<size_type,double> >::const_iterator
        col_val_pair = col_val_pairs.begin();
        col_val_pair!=col_val_pairs.end(); ++col_val_pair)
     {
@@ -170,10 +173,10 @@ void ConstraintMatrix::add_selected_constraints
        line!=constraints.lines.end(); ++line)
     if (filter.is_element(line->line))
       {
-        const unsigned int row = filter.index_within_set (line->line);
+        const size_type row = filter.index_within_set (line->line);
         add_line (row);
         set_inhomogeneity (row, line->inhomogeneity);
-        for (unsigned int i=0; i<line->entries.size(); ++i)
+        for (size_type i=0; i<line->entries.size(); ++i)
           if (filter.is_element(line->entries[i].first))
             add_entry (row, filter.index_within_set (line->entries[i].first),
                        line->entries[i].second);
@@ -193,9 +196,9 @@ void ConstraintMatrix::close ()
   // update list of pointers and give the vector a sharp size since we
   // won't modify the size any more after this point.
   {
-    std::vector<unsigned int> new_lines (lines_cache.size(),
-                                         numbers::invalid_unsigned_int);
-    unsigned int counter = 0;
+    std::vector<size_type> new_lines (lines_cache.size(),
+                                      numbers::invalid_size_type);
+    size_type counter = 0;
     for (std::vector<ConstraintLine>::const_iterator line=lines.begin();
          line!=lines.end(); ++line, ++counter)
       new_lines[calculate_line_index(line->line)] = counter;
@@ -203,8 +206,8 @@ void ConstraintMatrix::close ()
   }
 
   // in debug mode: check whether we really set the pointers correctly.
-  for (unsigned int i=0; i<lines_cache.size(); ++i)
-    if (lines_cache[i] != numbers::invalid_unsigned_int)
+  for (size_type i=0; i<lines_cache.size(); ++i)
+    if (lines_cache[i] != numbers::invalid_size_type)
       Assert (i == calculate_line_index(lines[lines_cache[i]].line),
               ExcInternalError());
 
@@ -229,7 +232,7 @@ void ConstraintMatrix::close ()
   // Let us figure out the largest dof index. This is an upper bound for the
   // number of constraints because it is an approximation for the number of dofs
   // in our system.
-  unsigned int largest_idx = 0;
+  size_type largest_idx = 0;
   for (std::vector<ConstraintLine>::iterator line = lines.begin();
        line!=lines.end(); ++line)
     {
@@ -252,7 +255,7 @@ void ConstraintMatrix::close ()
   // we sort the list so that throwing out duplicates becomes much more
   // efficient. also, we have to do it only once, rather than in each
   // iteration
-  unsigned int iteration = 0;
+  size_type iteration = 0;
   while (true)
     {
       bool chained_constraint_replaced = false;
@@ -263,14 +266,14 @@ void ConstraintMatrix::close ()
 #ifdef DEBUG
           // we need to keep track of how many replacements we do in this line, because we can
           // end up in a cycle A->B->C->A without the number of entries growing.
-          unsigned int n_replacements = 0;
+          size_type n_replacements = 0;
 #endif
 
           // loop over all entries of this line (including ones that we
           // have appended in this go around) and see whether they are
           // further constrained. ignore elements that we don't store on
           // the current processor
-          unsigned int entry = 0;
+          size_type entry = 0;
           while (entry < line->entries.size())
             if (((local_lines.size() == 0)
                  ||
@@ -282,8 +285,8 @@ void ConstraintMatrix::close ()
                 chained_constraint_replaced = true;
 
                 // look up the chain of constraints for this entry
-                const unsigned int dof_index = line->entries[entry].first;
-                const double       weight = line->entries[entry].second;
+                const size_type  dof_index = line->entries[entry].first;
+                const double     weight = line->entries[entry].second;
 
                 Assert (dof_index != line->line,
                         ExcMessage ("Cycle in constraints detected!"));
@@ -303,7 +306,7 @@ void ConstraintMatrix::close ()
                 // of other dofs:
                 if (constrained_line->entries.size() > 0)
                   {
-                    for (unsigned int i=0; i<constrained_line->entries.size(); ++i)
+                    for (size_type i=0; i<constrained_line->entries.size(); ++i)
                       Assert (dof_index != constrained_line->entries[i].first,
                               ExcMessage ("Cycle in constraints detected!"));
 
@@ -314,7 +317,7 @@ void ConstraintMatrix::close ()
                                       constrained_line->entries[0].second *
                                       weight);
 
-                    for (unsigned int i=1; i<constrained_line->entries.size(); ++i)
+                    for (size_type i=1; i<constrained_line->entries.size(); ++i)
                       line->entries
                       .push_back (std::make_pair (constrained_line->entries[i].first,
                                                   constrained_line->entries[i].second *
@@ -378,8 +381,8 @@ void ConstraintMatrix::close ()
       // references the same dofs more than once in order to find how many
       // non-duplicate entries we have. This lets us allocate the correct
       // amount of memory for the constraint entries.
-      unsigned int duplicates = 0;
-      for (unsigned int i=1; i<line->entries.size(); ++i)
+      size_type duplicates = 0;
+      for (size_type i=1; i<line->entries.size(); ++i)
         if (line->entries[i].first == line->entries[i-1].first)
           duplicates++;
 
@@ -397,7 +400,7 @@ void ConstraintMatrix::close ()
               // resolve the duplicates
               new_entries.reserve (line->entries.size() - duplicates);
               new_entries.push_back(line->entries[0]);
-              for (unsigned int j=1; j<line->entries.size(); ++j)
+              for (size_type j=1; j<line->entries.size(); ++j)
                 if (line->entries[j].first == line->entries[j-1].first)
                   {
                     Assert (new_entries.back().first == line->entries[j].first,
@@ -412,7 +415,7 @@ void ConstraintMatrix::close ()
 
               // make sure there are really no duplicates left and that the
               // list is still sorted
-              for (unsigned int j=1; j<new_entries.size(); ++j)
+              for (size_type j=1; j<new_entries.size(); ++j)
                 {
                   Assert (new_entries[j].first != new_entries[j-1].first,
                           ExcInternalError());
@@ -436,11 +439,11 @@ void ConstraintMatrix::close ()
       // precomputed tables. in this case, the interpolation weights are
       // also subject to round-off
       double sum = 0;
-      for (unsigned int i=0; i<line->entries.size(); ++i)
+      for (size_type i=0; i<line->entries.size(); ++i)
         sum += line->entries[i].second;
       if ((sum != 1.0) && (std::fabs (sum-1.) < 1.e-13))
         {
-          for (unsigned int i=0; i<line->entries.size(); ++i)
+          for (size_type i=0; i<line->entries.size(); ++i)
             line->entries[i].second /= sum;
           line->inhomogeneity /= sum;
         }
@@ -484,7 +487,7 @@ ConstraintMatrix::merge (const ConstraintMatrix &other_constraints,
 
   if (other_constraints.lines_cache.size() > lines_cache.size())
     lines_cache.resize(other_constraints.lines_cache.size(),
-                       numbers::invalid_unsigned_int);
+                       numbers::invalid_size_type);
 
   // first action is to fold into the present object possible constraints
   // in the second object. we don't strictly need to do this any more since
@@ -499,7 +502,7 @@ ConstraintMatrix::merge (const ConstraintMatrix &other_constraints,
        line!=lines.end(); ++line)
     {
       tmp.clear ();
-      for (unsigned int i=0; i<line->entries.size(); ++i)
+      for (size_type i=0; i<line->entries.size(); ++i)
         {
           // if the present dof is not constrained, or if we won't take the
           // constraint from the other object, then simply copy it over
@@ -525,8 +528,8 @@ ConstraintMatrix::merge (const ConstraintMatrix &other_constraints,
 
               for (ConstraintLine::Entries::const_iterator j=other_line->begin();
                    j!=other_line->end(); ++j)
-                tmp.push_back (std::pair<unsigned int,double>(j->first,
-                                                              j->second*weight));
+                tmp.push_back (std::pair<size_type,double>(j->first,
+                                                           j->second*weight));
 
               line->inhomogeneity += other_constraints.get_inhomogeneity(line->entries[i].first) *
                                      weight;
@@ -574,7 +577,7 @@ ConstraintMatrix::merge (const ConstraintMatrix &other_constraints,
       }
 
   // update the lines cache
-  unsigned int counter = 0;
+  size_type counter = 0;
   for (std::vector<ConstraintLine>::const_iterator line=lines.begin();
        line!=lines.end(); ++line, ++counter)
     lines_cache[calculate_line_index(line->line)] = counter;
@@ -587,13 +590,13 @@ ConstraintMatrix::merge (const ConstraintMatrix &other_constraints,
 
 
 
-void ConstraintMatrix::shift (const unsigned int offset)
+void ConstraintMatrix::shift (const size_type offset)
 {
   //TODO: this doesn't work with IndexSets yet. [TH]
   AssertThrow(local_lines.size()==0, ExcNotImplemented());
 
   lines_cache.insert (lines_cache.begin(), offset,
-                      numbers::invalid_unsigned_int);
+                      numbers::invalid_size_type);
 
   for (std::vector<ConstraintLine>::iterator i = lines.begin();
        i != lines.end(); ++i)
@@ -616,7 +619,7 @@ void ConstraintMatrix::clear ()
   }
 
   {
-    std::vector<unsigned int> tmp;
+    std::vector<size_type> tmp;
     lines_cache.swap (tmp);
   }
 
@@ -642,20 +645,24 @@ void ConstraintMatrix::condense (const SparsityPattern &uncondensed,
 
   // store for each line of the matrix its new line number after
   // compression. If the shift is -1, this line will be condensed away
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
   std::vector<int> new_line;
+#else
+  std::vector<long long int> new_line;
+#endif
 
   new_line.reserve (uncondensed.n_rows());
 
   std::vector<ConstraintLine>::const_iterator next_constraint = lines.begin();
-  unsigned int                                shift           = 0;
-  unsigned int n_rows = uncondensed.n_rows();
+  size_type                                   shift           = 0;
+  size_type n_rows = uncondensed.n_rows();
 
   if (next_constraint == lines.end())
     // if no constraint is to be handled
-    for (unsigned int row=0; row!=n_rows; ++row)
+    for (size_type row=0; row!=n_rows; ++row)
       new_line.push_back (row);
   else
-    for (unsigned int row=0; row!=n_rows; ++row)
+    for (size_type row=0; row!=n_rows; ++row)
       if (row == next_constraint->line)
         {
           // this line is constrained
@@ -666,7 +673,7 @@ void ConstraintMatrix::condense (const SparsityPattern &uncondensed,
           if (next_constraint == lines.end())
             // nothing more to do; finish rest of loop
             {
-              for (unsigned int i=row+1; i<n_rows; ++i)
+              for (size_type i=row+1; i<n_rows; ++i)
                 new_line.push_back (i-shift);
               break;
             };
@@ -679,7 +686,7 @@ void ConstraintMatrix::condense (const SparsityPattern &uncondensed,
   // note: in this loop we need not check whether @p{next_constraint} is a
   // valid iterator, since @p{next_constraint} is only evaluated so often as
   // there are entries in new_line[*] which tells us which constraints exist
-  for (unsigned int row=0; row<uncondensed.n_rows(); ++row)
+  for (size_type row=0; row<uncondensed.n_rows(); ++row)
     if (new_line[row] != -1)
       // line not constrained copy entries if column will not be condensed
       // away, distribute otherwise
@@ -694,7 +701,7 @@ void ConstraintMatrix::condense (const SparsityPattern &uncondensed,
             while (c->line != j->column())
               ++c;
 
-            for (unsigned int q=0; q!=c->entries.size(); ++q)
+            for (size_type q=0; q!=c->entries.size(); ++q)
               condensed.add (new_line[row], new_line[c->entries[q].first]);
           }
     else
@@ -705,7 +712,7 @@ void ConstraintMatrix::condense (const SparsityPattern &uncondensed,
           // for each entry: distribute
           if (new_line[j->column()] != -1)
             // column is not constrained
-            for (unsigned int q=0; q!=next_constraint->entries.size(); ++q)
+            for (size_type q=0; q!=next_constraint->entries.size(); ++q)
               condensed.add (new_line[next_constraint->entries[q].first],
                              new_line[j->column()]);
 
@@ -718,8 +725,8 @@ void ConstraintMatrix::condense (const SparsityPattern &uncondensed,
               std::vector<ConstraintLine>::const_iterator c = lines.begin();
               while (c->line != j->column()) ++c;
 
-              for (unsigned int p=0; p!=c->entries.size(); ++p)
-                for (unsigned int q=0; q!=next_constraint->entries.size(); ++q)
+              for (size_type p=0; p!=c->entries.size(); ++p)
+                for (size_type q=0; q!=next_constraint->entries.size(); ++q)
                   condensed.add (new_line[next_constraint->entries[q].first],
                                  new_line[c->entries[p].first]);
             };
@@ -742,16 +749,16 @@ void ConstraintMatrix::condense (SparsityPattern &sparsity) const
   // is numbers::invalid_unsigned_int, no distribution is necessary.
   // otherwise, the number states which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute(sparsity.n_rows(),
-                                       numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute(sparsity.n_rows(),
+                                    numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = c;
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         {
           // regular line. loop over cols all valid cols. note that this
           // changes the line we are presently working on: we add additional
@@ -762,20 +769,20 @@ void ConstraintMatrix::condense (SparsityPattern &sparsity) const
           // the last old entry and stop work there, but since operating on
           // the newly added ones only takes two comparisons (column index
           // valid, distribute[column] necessarily
-          // ==numbers::invalid_unsigned_int), it is cheaper to not do so and
+          // ==numbers::invalid_size_type), it is cheaper to not do so and
           // run right until the end of the line
           for (SparsityPattern::iterator entry = sparsity.begin(row);
                ((entry != sparsity.end(row)) &&
                 entry->is_valid_entry());
                ++entry)
             {
-              const unsigned int column = entry->column();
+              const size_type column = entry->column();
 
-              if (distribute[column] != numbers::invalid_unsigned_int)
+              if (distribute[column] != numbers::invalid_size_type)
                 {
                   // distribute entry at regular row @p{row} and irregular
                   // column sparsity.colnums[j]
-                  for (unsigned int q=0;
+                  for (size_type q=0;
                        q!=lines[distribute[column]].entries.size();
                        ++q)
                     sparsity.add (row,
@@ -790,19 +797,19 @@ void ConstraintMatrix::condense (SparsityPattern &sparsity) const
           for (SparsityPattern::iterator entry = sparsity.begin(row);
                (entry != sparsity.end(row)) && entry->is_valid_entry(); ++entry)
             {
-              const unsigned int column = entry->column();
-              if (distribute[column] == numbers::invalid_unsigned_int)
+              const size_type column = entry->column();
+              if (distribute[column] == numbers::invalid_size_type)
                 // distribute entry at irregular row @p{row} and regular
                 // column sparsity.colnums[j]
-                for (unsigned int q=0;
+                for (size_type q=0;
                      q!=lines[distribute[row]].entries.size(); ++q)
                   sparsity.add (lines[distribute[row]].entries[q].first,
                                 column);
               else
                 // distribute entry at irregular row @p{row} and irregular
                 // column sparsity.get_column_numbers()[j]
-                for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
-                  for (unsigned int q=0;
+                for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                  for (size_type q=0;
                        q!=lines[distribute[column]].entries.size(); ++q)
                     sparsity.add (lines[distribute[row]].entries[p].first,
                                   lines[distribute[column]].entries[q].first);
@@ -825,23 +832,23 @@ void ConstraintMatrix::condense (CompressedSparsityPattern &sparsity) const
   // is numbers::invalid_unsigned_int, no distribution is necessary.
   // otherwise, the number states which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute(sparsity.n_rows(),
-                                       numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute(sparsity.n_rows(),
+                                    numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = c;
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         // regular line. loop over cols. note that as we proceed to
         // distribute cols, the loop may get longer
-        for (unsigned int j=0; j<sparsity.row_length(row); ++j)
+        for (size_type j=0; j<sparsity.row_length(row); ++j)
           {
-            const unsigned int column = sparsity.column_number(row,j);
+            const size_type column = sparsity.column_number(row,j);
 
-            if (distribute[column] != numbers::invalid_unsigned_int)
+            if (distribute[column] != numbers::invalid_size_type)
               {
                 // distribute entry at regular row @p{row} and irregular
                 // column column. note that this changes the line we are
@@ -859,17 +866,17 @@ void ConstraintMatrix::condense (CompressedSparsityPattern &sparsity) const
                 // one to the right in the case that we add an entry up
                 // front that did not exist before. check whether it
                 // existed before by tracking the length of this row
-                unsigned int old_rowlength = sparsity.row_length(row);
-                for (unsigned int q=0;
+                size_type old_rowlength = sparsity.row_length(row);
+                for (size_type q=0;
                      q!=lines[distribute[column]].entries.size();
                      ++q)
                   {
-                    const unsigned int
+                    const size_type
                     new_col = lines[distribute[column]].entries[q].first;
 
                     sparsity.add (row, new_col);
 
-                    const unsigned int new_rowlength = sparsity.row_length(row);
+                    const size_type new_rowlength = sparsity.row_length(row);
                     if ((new_col < column) && (old_rowlength != new_rowlength))
                       ++j;
                     old_rowlength = new_rowlength;
@@ -878,22 +885,22 @@ void ConstraintMatrix::condense (CompressedSparsityPattern &sparsity) const
           }
       else
         // row must be distributed
-        for (unsigned int j=0; j<sparsity.row_length(row); ++j)
+        for (size_type j=0; j<sparsity.row_length(row); ++j)
           {
-            const unsigned int column = sparsity.column_number(row,j);
+            const size_type column = sparsity.column_number(row,j);
 
-            if (distribute[column] == numbers::invalid_unsigned_int)
+            if (distribute[column] == numbers::invalid_size_type)
               // distribute entry at irregular row @p{row} and regular
               // column sparsity.colnums[j]
-              for (unsigned int q=0;
+              for (size_type q=0;
                    q!=lines[distribute[row]].entries.size(); ++q)
                 sparsity.add (lines[distribute[row]].entries[q].first,
                               column);
             else
               // distribute entry at irregular row @p{row} and irregular
               // column sparsity.get_column_numbers()[j]
-              for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
-                for (unsigned int q=0;
+              for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                for (size_type q=0;
                      q!=lines[distribute[sparsity.column_number(row,j)]]
                      .entries.size(); ++q)
                   sparsity.add (lines[distribute[row]].entries[p].first,
@@ -915,16 +922,16 @@ void ConstraintMatrix::condense (CompressedSetSparsityPattern &sparsity) const
   // is numbers::invalid_unsigned_int, no distribution is necessary.
   // otherwise, the number states which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute(sparsity.n_rows(),
-                                       numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute(sparsity.n_rows(),
+                                    numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = c;
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         {
           // regular line. loop over cols. note that as we proceed to
           // distribute cols, the loop may get longer
@@ -932,16 +939,16 @@ void ConstraintMatrix::condense (CompressedSetSparsityPattern &sparsity) const
 
           for (; col_num != sparsity.row_end (row); ++col_num)
             {
-              const unsigned int column = *col_num;
+              const size_type column = *col_num;
 
-              if (distribute[column] != numbers::invalid_unsigned_int)
+              if (distribute[column] != numbers::invalid_size_type)
                 {
                   // row
-                  for (unsigned int q=0;
+                  for (size_type q=0;
                        q!=lines[distribute[column]].entries.size();
                        ++q)
                     {
-                      const unsigned int
+                      const size_type
                       new_col = lines[distribute[column]].entries[q].first;
 
                       sparsity.add (row, new_col);
@@ -956,20 +963,20 @@ void ConstraintMatrix::condense (CompressedSetSparsityPattern &sparsity) const
 
           for (; col_num != sparsity.row_end (row); ++col_num)
             {
-              const unsigned int column = *col_num;
+              const size_type column = *col_num;
 
-              if (distribute[column] == numbers::invalid_unsigned_int)
+              if (distribute[column] == numbers::invalid_size_type)
                 // distribute entry at irregular row @p{row} and regular
                 // column sparsity.colnums[j]
-                for (unsigned int q=0;
+                for (size_type q=0;
                      q!=lines[distribute[row]].entries.size(); ++q)
                   sparsity.add (lines[distribute[row]].entries[q].first,
                                 column);
               else
                 // distribute entry at irregular row @p{row} and irregular
                 // column sparsity.get_column_numbers()[j]
-                for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
-                  for (unsigned int q=0;
+                for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                  for (size_type q=0;
                        q!=lines[distribute[column]]
                        .entries.size(); ++q)
                     sparsity.add (lines[distribute[row]].entries[p].first,
@@ -992,23 +999,23 @@ void ConstraintMatrix::condense (CompressedSimpleSparsityPattern &sparsity) cons
   // is numbers::invalid_unsigned_int, no distribution is necessary.
   // otherwise, the number states which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute(sparsity.n_rows(),
-                                       numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute(sparsity.n_rows(),
+                                    numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = c;
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         // regular line. loop over cols. note that as we proceed to
         // distribute cols, the loop may get longer
-        for (unsigned int j=0; j<sparsity.row_length(row); ++j)
+        for (size_type j=0; j<sparsity.row_length(row); ++j)
           {
-            const unsigned int column = sparsity.column_number(row,j);
+            const size_type column = sparsity.column_number(row,j);
 
-            if (distribute[column] != numbers::invalid_unsigned_int)
+            if (distribute[column] != numbers::invalid_size_type)
               {
                 // distribute entry at regular row @p{row} and irregular
                 // column column. note that this changes the line we are
@@ -1026,17 +1033,17 @@ void ConstraintMatrix::condense (CompressedSimpleSparsityPattern &sparsity) cons
                 // one to the right in the case that we add an entry up
                 // front that did not exist before. check whether it
                 // existed before by tracking the length of this row
-                unsigned int old_rowlength = sparsity.row_length(row);
-                for (unsigned int q=0;
+                size_type old_rowlength = sparsity.row_length(row);
+                for (size_type q=0;
                      q!=lines[distribute[column]].entries.size();
                      ++q)
                   {
-                    const unsigned int
+                    const size_type
                     new_col = lines[distribute[column]].entries[q].first;
 
                     sparsity.add (row, new_col);
 
-                    const unsigned int new_rowlength = sparsity.row_length(row);
+                    const size_type new_rowlength = sparsity.row_length(row);
                     if ((new_col < column) && (old_rowlength != new_rowlength))
                       ++j;
                     old_rowlength = new_rowlength;
@@ -1045,22 +1052,22 @@ void ConstraintMatrix::condense (CompressedSimpleSparsityPattern &sparsity) cons
           }
       else
         // row must be distributed
-        for (unsigned int j=0; j<sparsity.row_length(row); ++j)
+        for (size_type j=0; j<sparsity.row_length(row); ++j)
           {
-            const unsigned int column = sparsity.column_number(row,j);
+            const size_type column = sparsity.column_number(row,j);
 
-            if (distribute[column] == numbers::invalid_unsigned_int)
+            if (distribute[column] == numbers::invalid_size_type)
               // distribute entry at irregular row @p{row} and regular
               // column sparsity.colnums[j]
-              for (unsigned int q=0;
+              for (size_type q=0;
                    q!=lines[distribute[row]].entries.size(); ++q)
                 sparsity.add (lines[distribute[row]].entries[q].first,
                               column);
             else
               // distribute entry at irregular row @p{row} and irregular
               // column sparsity.get_column_numbers()[j]
-              for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
-                for (unsigned int q=0;
+              for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                for (size_type q=0;
                      q!=lines[distribute[sparsity.column_number(row,j)]]
                      .entries.size(); ++q)
                   sparsity.add (lines[distribute[row]].entries[p].first,
@@ -1086,34 +1093,34 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
   const BlockIndices &
   index_mapping = sparsity.get_column_indices();
 
-  const unsigned int n_blocks = sparsity.n_block_rows();
+  const size_type n_blocks = sparsity.n_block_rows();
 
   // store for each index whether it must be distributed or not. If entry
   // is numbers::invalid_unsigned_int, no distribution is necessary.
   // otherwise, the number states which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute (sparsity.n_rows(),
-                                        numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute (sparsity.n_rows(),
+                                     numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = c;
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
       // get index of this row within the blocks
-      const std::pair<unsigned int,unsigned int>
+      const std::pair<size_type,size_type>
       block_index = index_mapping.global_to_local(row);
-      const unsigned int block_row = block_index.first;
+      const size_type block_row = block_index.first;
 
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         // regular line. loop over all columns and see whether this column
         // must be distributed
         {
 
           // to loop over all entries in this row, we have to loop over all
           // blocks in this blockrow and the corresponding row therein
-          for (unsigned int block_col=0; block_col<n_blocks; ++block_col)
+          for (size_type block_col=0; block_col<n_blocks; ++block_col)
             {
               const SparsityPattern &
               block_sparsity = sparsity.block(block_row, block_col);
@@ -1124,14 +1131,14 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
                    entry->is_valid_entry();
                    ++entry)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global(block_col, entry->column());
 
-                  if (distribute[global_col] != numbers::invalid_unsigned_int)
+                  if (distribute[global_col] != numbers::invalid_size_type)
                     // distribute entry at regular row @p{row} and
                     // irregular column global_col
                     {
-                      for (unsigned int q=0;
+                      for (size_type q=0;
                            q!=lines[distribute[global_col]].entries.size(); ++q)
                         sparsity.add (row,
                                       lines[distribute[global_col]].entries[q].first);
@@ -1143,7 +1150,7 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
         {
           // row must be distributed. split the whole row into the chunks
           // defined by the blocks
-          for (unsigned int block_col=0; block_col<n_blocks; ++block_col)
+          for (size_type block_col=0; block_col<n_blocks; ++block_col)
             {
               const SparsityPattern &
               block_sparsity = sparsity.block(block_row,block_col);
@@ -1154,22 +1161,22 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
                    entry->is_valid_entry();
                    ++entry)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global (block_col, entry->column());
 
-                  if (distribute[global_col] == numbers::invalid_unsigned_int)
+                  if (distribute[global_col] == numbers::invalid_size_type)
                     // distribute entry at irregular row @p{row} and
                     // regular column global_col.
                     {
-                      for (unsigned int q=0; q!=lines[distribute[row]].entries.size(); ++q)
+                      for (size_type q=0; q!=lines[distribute[row]].entries.size(); ++q)
                         sparsity.add (lines[distribute[row]].entries[q].first, global_col);
                     }
                   else
                     // distribute entry at irregular row @p{row} and
                     // irregular column @p{global_col}
                     {
-                      for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
-                        for (unsigned int q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
+                      for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                        for (size_type q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
                           sparsity.add (lines[distribute[row]].entries[p].first,
                                         lines[distribute[global_col]].entries[q].first);
                     }
@@ -1196,28 +1203,28 @@ void ConstraintMatrix::condense (BlockCompressedSparsityPattern &sparsity) const
   const BlockIndices &
   index_mapping = sparsity.get_column_indices();
 
-  const unsigned int n_blocks = sparsity.n_block_rows();
+  const size_type n_blocks = sparsity.n_block_rows();
 
   // store for each index whether it must be distributed or not. If entry
   // is numbers::invalid_unsigned_int, no distribution is necessary.
   // otherwise, the number states which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute (sparsity.n_rows(),
-                                        numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute (sparsity.n_rows(),
+                                     numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = static_cast<signed int>(c);
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
       // get index of this row within the blocks
-      const std::pair<unsigned int,unsigned int>
+      const std::pair<size_type,size_type>
       block_index = index_mapping.global_to_local(row);
-      const unsigned int block_row = block_index.first;
-      const unsigned int local_row = block_index.second;
+      const size_type block_row = block_index.first;
+      const size_type local_row = block_index.second;
 
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         // regular line. loop over all columns and see whether this column
         // must be distributed. note that as we proceed to distribute cols,
         // the loop over cols may get longer.
@@ -1230,22 +1237,22 @@ void ConstraintMatrix::condense (BlockCompressedSparsityPattern &sparsity) const
 
           // to loop over all entries in this row, we have to loop over all
           // blocks in this blockrow and the corresponding row therein
-          for (unsigned int block_col=0; block_col<n_blocks; ++block_col)
+          for (size_type block_col=0; block_col<n_blocks; ++block_col)
             {
               const CompressedSparsityPattern &
               block_sparsity = sparsity.block(block_row, block_col);
 
-              for (unsigned int j=0; j<block_sparsity.row_length(local_row); ++j)
+              for (size_type j=0; j<block_sparsity.row_length(local_row); ++j)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global(block_col,
                                                     block_sparsity.column_number(local_row,j));
 
-                  if (distribute[global_col] != numbers::invalid_unsigned_int)
+                  if (distribute[global_col] != numbers::invalid_size_type)
                     // distribute entry at regular row @p{row} and
                     // irregular column global_col
                     {
-                      for (unsigned int q=0;
+                      for (size_type q=0;
                            q!=lines[distribute[global_col]]
                            .entries.size(); ++q)
                         sparsity.add (row,
@@ -1258,22 +1265,22 @@ void ConstraintMatrix::condense (BlockCompressedSparsityPattern &sparsity) const
         {
           // row must be distributed. split the whole row into the chunks
           // defined by the blocks
-          for (unsigned int block_col=0; block_col<n_blocks; ++block_col)
+          for (size_type block_col=0; block_col<n_blocks; ++block_col)
             {
               const CompressedSparsityPattern &
               block_sparsity = sparsity.block(block_row,block_col);
 
-              for (unsigned int j=0; j<block_sparsity.row_length(local_row); ++j)
+              for (size_type j=0; j<block_sparsity.row_length(local_row); ++j)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global (block_col,
                                                      block_sparsity.column_number(local_row,j));
 
-                  if (distribute[global_col] == numbers::invalid_unsigned_int)
+                  if (distribute[global_col] == numbers::invalid_size_type)
                     // distribute entry at irregular row @p{row} and
                     // regular column global_col.
                     {
-                      for (unsigned int q=0; q!=lines[distribute[row]].entries.size(); ++q)
+                      for (size_type q=0; q!=lines[distribute[row]].entries.size(); ++q)
                         sparsity.add (lines[distribute[row]].entries[q].first,
                                       global_col);
                     }
@@ -1281,8 +1288,8 @@ void ConstraintMatrix::condense (BlockCompressedSparsityPattern &sparsity) const
                     // distribute entry at irregular row @p{row} and
                     // irregular column @p{global_col}
                     {
-                      for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
-                        for (unsigned int q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
+                      for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                        for (size_type q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
                           sparsity.add (lines[distribute[row]].entries[p].first,
                                         lines[distribute[global_col]].entries[q].first);
                     };
@@ -1307,28 +1314,28 @@ void ConstraintMatrix::condense (BlockCompressedSetSparsityPattern &sparsity) co
   const BlockIndices &
   index_mapping = sparsity.get_column_indices();
 
-  const unsigned int n_blocks = sparsity.n_block_rows();
+  const size_type n_blocks = sparsity.n_block_rows();
 
   // store for each index whether it must be distributed or not. If entry
   // is numbers::invalid_unsigned_int, no distribution is necessary.
   // otherwise, the number states which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute (sparsity.n_rows(),
-                                        numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute (sparsity.n_rows(),
+                                     numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = static_cast<signed int>(c);
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
       // get index of this row within the blocks
-      const std::pair<unsigned int,unsigned int>
+      const std::pair<size_type,size_type>
       block_index = index_mapping.global_to_local(row);
-      const unsigned int block_row = block_index.first;
-      const unsigned int local_row = block_index.second;
+      const size_type block_row = block_index.first;
+      const size_type local_row = block_index.second;
 
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         // regular line. loop over all columns and see whether this column
         // must be distributed. note that as we proceed to distribute cols,
         // the loop over cols may get longer.
@@ -1341,7 +1348,7 @@ void ConstraintMatrix::condense (BlockCompressedSetSparsityPattern &sparsity) co
 
           // to loop over all entries in this row, we have to loop over all
           // blocks in this blockrow and the corresponding row therein
-          for (unsigned int block_col=0; block_col<n_blocks; ++block_col)
+          for (size_type block_col=0; block_col<n_blocks; ++block_col)
             {
               const CompressedSetSparsityPattern &
               block_sparsity = sparsity.block(block_row, block_col);
@@ -1350,14 +1357,14 @@ void ConstraintMatrix::condense (BlockCompressedSetSparsityPattern &sparsity) co
                    j = block_sparsity.row_begin(local_row);
                    j != block_sparsity.row_end(local_row); ++j)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global(block_col, *j);
 
-                  if (distribute[global_col] != numbers::invalid_unsigned_int)
+                  if (distribute[global_col] != numbers::invalid_size_type)
                     // distribute entry at regular row @p{row} and
                     // irregular column global_col
                     {
-                      for (unsigned int q=0;
+                      for (size_type q=0;
                            q!=lines[distribute[global_col]]
                            .entries.size(); ++q)
                         sparsity.add (row,
@@ -1370,7 +1377,7 @@ void ConstraintMatrix::condense (BlockCompressedSetSparsityPattern &sparsity) co
         {
           // row must be distributed. split the whole row into the chunks
           // defined by the blocks
-          for (unsigned int block_col=0; block_col<n_blocks; ++block_col)
+          for (size_type block_col=0; block_col<n_blocks; ++block_col)
             {
               const CompressedSetSparsityPattern &
               block_sparsity = sparsity.block(block_row,block_col);
@@ -1379,14 +1386,14 @@ void ConstraintMatrix::condense (BlockCompressedSetSparsityPattern &sparsity) co
                    j = block_sparsity.row_begin(local_row);
                    j != block_sparsity.row_end(local_row); ++j)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global (block_col, *j);
 
-                  if (distribute[global_col] == numbers::invalid_unsigned_int)
+                  if (distribute[global_col] == numbers::invalid_size_type)
                     // distribute entry at irregular row @p{row} and
                     // regular column global_col.
                     {
-                      for (unsigned int q=0; q!=lines[distribute[row]].entries.size(); ++q)
+                      for (size_type q=0; q!=lines[distribute[row]].entries.size(); ++q)
                         sparsity.add (lines[distribute[row]].entries[q].first,
                                       global_col);
                     }
@@ -1394,8 +1401,8 @@ void ConstraintMatrix::condense (BlockCompressedSetSparsityPattern &sparsity) co
                     // distribute entry at irregular row @p{row} and
                     // irregular column @p{global_col}
                     {
-                      for (unsigned int p=0; p!=lines[distribute[row]].entries.size(); ++p)
-                        for (unsigned int q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
+                      for (size_type p=0; p!=lines[distribute[row]].entries.size(); ++p)
+                        for (size_type q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
                           sparsity.add (lines[distribute[row]].entries[p].first,
                                         lines[distribute[global_col]].entries[q].first);
                     };
@@ -1420,28 +1427,28 @@ void ConstraintMatrix::condense (BlockCompressedSimpleSparsityPattern &sparsity)
   const BlockIndices &
   index_mapping = sparsity.get_column_indices();
 
-  const unsigned int n_blocks = sparsity.n_block_rows();
+  const size_type n_blocks = sparsity.n_block_rows();
 
   // store for each index whether it must be distributed or not. If entry
   // is numbers::invalid_unsigned_int, no distribution is necessary.
   // otherwise, the number states which line in the constraint matrix
   // handles this index
-  std::vector<unsigned int> distribute (sparsity.n_rows(),
-                                        numbers::invalid_unsigned_int);
+  std::vector<size_type> distribute (sparsity.n_rows(),
+                                     numbers::invalid_size_type);
 
-  for (unsigned int c=0; c<lines.size(); ++c)
+  for (size_type c=0; c<lines.size(); ++c)
     distribute[lines[c].line] = static_cast<signed int>(c);
 
-  const unsigned int n_rows = sparsity.n_rows();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = sparsity.n_rows();
+  for (size_type row=0; row<n_rows; ++row)
     {
       // get index of this row within the blocks
-      const std::pair<unsigned int,unsigned int>
+      const std::pair<size_type,size_type>
       block_index = index_mapping.global_to_local(row);
-      const unsigned int block_row = block_index.first;
-      const unsigned int local_row = block_index.second;
+      const size_type block_row = block_index.first;
+      const size_type local_row = block_index.second;
 
-      if (distribute[row] == numbers::invalid_unsigned_int)
+      if (distribute[row] == numbers::invalid_size_type)
         // regular line. loop over all columns and see whether this column
         // must be distributed. note that as we proceed to distribute cols,
         // the loop over cols may get longer.
@@ -1454,22 +1461,22 @@ void ConstraintMatrix::condense (BlockCompressedSimpleSparsityPattern &sparsity)
 
           // to loop over all entries in this row, we have to loop over all
           // blocks in this blockrow and the corresponding row therein
-          for (unsigned int block_col=0; block_col<n_blocks; ++block_col)
+          for (size_type block_col=0; block_col<n_blocks; ++block_col)
             {
               const CompressedSimpleSparsityPattern &
               block_sparsity = sparsity.block(block_row, block_col);
 
-              for (unsigned int j=0; j<block_sparsity.row_length(local_row); ++j)
+              for (size_type j=0; j<block_sparsity.row_length(local_row); ++j)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global(block_col,
                                                     block_sparsity.column_number(local_row,j));
 
-                  if (distribute[global_col] != numbers::invalid_unsigned_int)
+                  if (distribute[global_col] != numbers::invalid_size_type)
                     // distribute entry at regular row @p{row} and
                     // irregular column global_col
                     {
-                      for (unsigned int q=0;
+                      for (size_type q=0;
                            q!=lines[distribute[global_col]]
                            .entries.size(); ++q)
                         sparsity.add (row,
@@ -1482,21 +1489,22 @@ void ConstraintMatrix::condense (BlockCompressedSimpleSparsityPattern &sparsity)
         {
           // row must be distributed. split the whole row into the chunks
           // defined by the blocks
-          for (unsigned int block_col=0; block_col<n_blocks; ++block_col)
+          for (size_type block_col=0; block_col<n_blocks; ++block_col)
             {
               const CompressedSimpleSparsityPattern &
               block_sparsity = sparsity.block(block_row,block_col);
 
-              for (unsigned int j=0; j<block_sparsity.row_length(local_row); ++j)
+              for (size_type j=0; j<block_sparsity.row_length(local_row); ++j)
                 {
-                  const unsigned int global_col
+                  const size_type global_col
                     = index_mapping.local_to_global (block_col,
                                                      block_sparsity.column_number(local_row,j));
 
-                  if (distribute[global_col] == numbers::invalid_unsigned_int)
+                  if (distribute[global_col] == numbers::invalid_size_type)
                     // distribute entry at irregular row @p{row} and
                     // regular column global_col.
-                    { for (unsigned int q=0;
+                    {
+                      for (size_type q=0;
                            q!=lines[distribute[row]].entries.size(); ++q)
                         sparsity.add (lines[distribute[row]].entries[q].first,
                                       global_col);
@@ -1504,9 +1512,10 @@ void ConstraintMatrix::condense (BlockCompressedSimpleSparsityPattern &sparsity)
                   else
                     // distribute entry at irregular row @p{row} and
                     // irregular column @p{global_col}
-                    { for (unsigned int p=0;
+                    {
+                      for (size_type p=0;
                            p!=lines[distribute[row]].entries.size(); ++p)
-                        for (unsigned int q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
+                        for (size_type q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
                           sparsity.add (lines[distribute[row]].entries[p].first,
                                         lines[distribute[global_col]].entries[q].first);
                     };
@@ -1518,7 +1527,7 @@ void ConstraintMatrix::condense (BlockCompressedSimpleSparsityPattern &sparsity)
 
 
 
-bool ConstraintMatrix::is_identity_constrained (const unsigned int index) const
+bool ConstraintMatrix::is_identity_constrained (const size_type index) const
 {
   if (is_constrained(index) == false)
     return false;
@@ -1534,15 +1543,16 @@ bool ConstraintMatrix::is_identity_constrained (const unsigned int index) const
 
 
 
-unsigned int ConstraintMatrix::max_constraint_indirections () const
+ConstraintMatrix::size_type
+ConstraintMatrix::max_constraint_indirections () const
 {
-  unsigned int return_value = 0;
+  size_type return_value = 0;
   for (std::vector<ConstraintLine>::const_iterator i=lines.begin();
        i!=lines.end(); ++i)
     // use static cast, since typeof(size)==std::size_t, which is !=
-    // unsigned int on AIX
+    // size_type on AIX
     return_value = std::max(return_value,
-                            static_cast<unsigned int>(i->entries.size()));
+                            static_cast<size_type>(i->entries.size()));
 
   return return_value;
 }
@@ -1562,12 +1572,12 @@ bool ConstraintMatrix::has_inhomogeneities () const
 
 void ConstraintMatrix::print (std::ostream &out) const
 {
-  for (unsigned int i=0; i!=lines.size(); ++i)
+  for (size_type i=0; i!=lines.size(); ++i)
     {
       // output the list of constraints as pairs of dofs and their weights
       if (lines[i].entries.size() > 0)
         {
-          for (unsigned int j=0; j<lines[i].entries.size(); ++j)
+          for (size_type j=0; j<lines[i].entries.size(); ++j)
             out << "    " << lines[i].line
                 << " " << lines[i].entries[j].first
                 << ":  " << lines[i].entries[j].second << "\n";
@@ -1601,11 +1611,11 @@ ConstraintMatrix::write_dot (std::ostream &out) const
 {
   out << "digraph constraints {"
       << std::endl;
-  for (unsigned int i=0; i!=lines.size(); ++i)
+  for (size_type i=0; i!=lines.size(); ++i)
     {
       // same concept as in the previous function
       if (lines[i].entries.size() > 0)
-        for (unsigned int j=0; j<lines[i].entries.size(); ++j)
+        for (size_type j=0; j<lines[i].entries.size(); ++j)
           out << "  " << lines[i].line << "->" << lines[i].entries[j].first
               << "; // weight: "
               << lines[i].entries[j].second
@@ -1655,7 +1665,7 @@ ConstraintMatrix::memory_consumption () const
       VectorType       &condensed_vector) const; \
   template void ConstraintMatrix:: \
   distribute_local_to_global<VectorType > (const Vector<double>            &, \
-                                           const std::vector<unsigned int> &, \
+                                           const std::vector<ConstraintMatrix::size_type>  &, \
                                            VectorType                      &, \
                                            const FullMatrix<double>        &) const; \
   template void ConstraintMatrix::distribute<VectorType >(const VectorType &condensed,\
@@ -1664,7 +1674,7 @@ ConstraintMatrix::memory_consumption () const
 #define PARALLEL_VECTOR_FUNCTIONS(VectorType) \
   template void ConstraintMatrix:: \
   distribute_local_to_global<VectorType > (const Vector<double>            &, \
-                                           const std::vector<unsigned int> &, \
+                                           const std::vector<ConstraintMatrix::size_type>  &, \
                                            VectorType                      &, \
                                            const FullMatrix<double>        &) const
 
@@ -1683,7 +1693,7 @@ PARALLEL_VECTOR_FUNCTIONS(TrilinosWrappers::MPI::BlockVector);
   template void ConstraintMatrix:: \
   distribute_local_to_global<MatrixType,VectorType > (const FullMatrix<double>        &, \
                                                       const Vector<double>            &, \
-                                                      const std::vector<unsigned int> &, \
+                                                      const std::vector<ConstraintMatrix::size_type> &, \
                                                       MatrixType                      &, \
                                                       VectorType                      &, \
                                                       bool                             , \
@@ -1692,7 +1702,7 @@ PARALLEL_VECTOR_FUNCTIONS(TrilinosWrappers::MPI::BlockVector);
   template void ConstraintMatrix:: \
   distribute_local_to_global<MatrixType,Vector<double> > (const FullMatrix<double>        &, \
                                                           const Vector<double>            &, \
-                                                          const std::vector<unsigned int> &, \
+                                                          const std::vector<ConstraintMatrix::size_type> &, \
                                                           MatrixType                      &, \
                                                           Vector<double>                  &, \
                                                           bool                             , \
@@ -1701,7 +1711,7 @@ PARALLEL_VECTOR_FUNCTIONS(TrilinosWrappers::MPI::BlockVector);
   template void ConstraintMatrix:: \
   distribute_local_to_global<MatrixType,VectorType > (const FullMatrix<double>        &, \
                                                       const Vector<double>            &, \
-                                                      const std::vector<unsigned int> &, \
+                                                      const std::vector<ConstraintMatrix::size_type> &, \
                                                       MatrixType                      &, \
                                                       VectorType                      &, \
                                                       bool                             , \
@@ -1710,7 +1720,7 @@ PARALLEL_VECTOR_FUNCTIONS(TrilinosWrappers::MPI::BlockVector);
   template void ConstraintMatrix:: \
   distribute_local_to_global<MatrixType,Vector<double> > (const FullMatrix<double>        &, \
                                                           const Vector<double>            &, \
-                                                          const std::vector<unsigned int> &, \
+                                                          const std::vector<ConstraintMatrix::size_type> &, \
                                                           MatrixType                      &, \
                                                           Vector<double>                  &, \
                                                           bool                             , \
@@ -1761,27 +1771,27 @@ BLOCK_MATRIX_VECTOR_FUNCTIONS(TrilinosWrappers::BlockSparseMatrix, TrilinosWrapp
 
 #define SPARSITY_FUNCTIONS(SparsityType) \
   template void ConstraintMatrix::add_entries_local_to_global<SparsityType> (\
-      const std::vector<unsigned int> &, \
+      const std::vector<ConstraintMatrix::size_type> &, \
       SparsityType &,                    \
       const bool,                        \
       const Table<2,bool> &, \
       internal::bool2type<false>) const; \
   template void ConstraintMatrix::add_entries_local_to_global<SparsityType> (\
-      const std::vector<unsigned int> &, \
-      const std::vector<unsigned int> &, \
+      const std::vector<ConstraintMatrix::size_type> &, \
+      const std::vector<ConstraintMatrix::size_type> &, \
       SparsityType &,                    \
       const bool,                        \
       const Table<2,bool> &) const
 #define BLOCK_SPARSITY_FUNCTIONS(SparsityType) \
   template void ConstraintMatrix::add_entries_local_to_global<SparsityType> (\
-      const std::vector<unsigned int> &, \
+      const std::vector<ConstraintMatrix::size_type> &, \
       SparsityType &,                    \
       const bool,                        \
       const Table<2,bool> &, \
       internal::bool2type<true>) const; \
   template void ConstraintMatrix::add_entries_local_to_global<SparsityType> (\
-      const std::vector<unsigned int> &, \
-      const std::vector<unsigned int> &, \
+      const std::vector<ConstraintMatrix::size_type> &, \
+      const std::vector<ConstraintMatrix::size_type> &, \
       SparsityType &,                    \
       const bool,                        \
       const Table<2,bool> &) const
@@ -1804,8 +1814,8 @@ BLOCK_SPARSITY_FUNCTIONS(TrilinosWrappers::BlockSparsityPattern);
 #define ONLY_MATRIX_FUNCTIONS(MatrixType) \
   template void ConstraintMatrix::distribute_local_to_global<MatrixType > (\
       const FullMatrix<double>        &, \
-      const std::vector<unsigned int> &, \
-      const std::vector<unsigned int> &, \
+      const std::vector<ConstraintMatrix::size_type> &, \
+      const std::vector<ConstraintMatrix::size_type> &, \
       MatrixType                      &) const
 
 ONLY_MATRIX_FUNCTIONS(SparseMatrix<float>);
index 1a69fff4a28f66e0dbec0f362442c3c2c35ae2c7..6320aaa188fb684712f7120cfa4bd853614bf9ce 100644 (file)
@@ -1,9 +1,25 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 for (S: REAL_SCALARS; T : DEAL_II_VEC_TEMPLATES)
   {
     template void ConstraintMatrix::condense<T<S> >(const T<S> &, T<S> &) const;
     template void ConstraintMatrix::condense<T<S> >(T<S> &vec) const;
     template void ConstraintMatrix::distribute_local_to_global<T<S> > (
-      const Vector<double>&, const std::vector<unsigned int> &, T<S> &, const FullMatrix<double>&) const;
+      const Vector<double>&, const std::vector<types::global_dof_index> &, T<S> &, const FullMatrix<double>&) const;
     template void ConstraintMatrix::distribute<T<S> >(const T<S> &, T<S> &) const;
     template void ConstraintMatrix::set_zero<T<S> >(T<S> &) const;
   }
@@ -14,7 +30,7 @@ for (S: REAL_SCALARS; T : DEAL_II_VEC_TEMPLATES)
     template void ConstraintMatrix::condense<parallel::distributed::T<S> >(const parallel::distributed::T<S> &, parallel::distributed::T<S> &) const;
     template void ConstraintMatrix::condense<parallel::distributed::T<S> >(parallel::distributed::T<S> &vec) const;
     template void ConstraintMatrix::distribute_local_to_global<parallel::distributed::T<S> > (
-      const Vector<double>&, const std::vector<unsigned int> &, parallel::distributed::T<S> &, const FullMatrix<double>&) const;
+      const Vector<double>&, const std::vector<types::global_dof_index> &, parallel::distributed::T<S> &, const FullMatrix<double>&) const;
     template void ConstraintMatrix::distribute<parallel::distributed::T<S> >(const parallel::distributed::T<S> &, parallel::distributed::T<S> &) const;
     template void ConstraintMatrix::set_zero<parallel::distributed::T<S> >(parallel::distributed::T<S> &) const;
   }
@@ -25,7 +41,7 @@ for (V: EXTERNAL_SEQUENTIAL_VECTORS)
     template void ConstraintMatrix::condense<V >(const V&, V&) const;
     template void ConstraintMatrix::condense<V >(V&vec) const;
     template void ConstraintMatrix::distribute_local_to_global<V > (
-      const Vector<double>&, const std::vector<unsigned int> &, V&, const FullMatrix<double>&) const;
+      const Vector<double>&, const std::vector<types::global_dof_index> &, V&, const FullMatrix<double>&) const;
     template void ConstraintMatrix::distribute<V >(const V&, V&) const;
     template void ConstraintMatrix::set_zero<V >(V&) const;
   }
index ca061d2d18f14c1258a8ff24055bf487f4c79ea8..92bab173773db563da1cf9579d07c4be2a996fd8 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/lac/full_matrix.templates.h>
index 47db43ec24581b7727df922158f26da399ac1af8..f902a726977ea46cb57cb52555f8dde5b58afe0e 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (S : REAL_SCALARS)
@@ -22,22 +26,22 @@ for (S : REAL_SCALARS)
       std::ostream&, const unsigned int, const unsigned int) const;    
 
     template void FullMatrix<S>::copy_from<1>(
-      const Tensor<2,1>&, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned);
+      const Tensor<2,1>&, const size_type, const size_type, const size_type, const size_type, const size_type, const size_type);
 
     template void FullMatrix<S>::copy_from<2>(
-      const Tensor<2,2>&, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned);
+      const Tensor<2,2>&, const size_type, const size_type, const size_type, const size_type, const size_type, const size_type);
 
     template void FullMatrix<S>::copy_from<3>(
-      const Tensor<2,3>&, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned);
+      const Tensor<2,3>&, const size_type, const size_type, const size_type, const size_type, const size_type, const size_type);
 
     template void FullMatrix<S>::copy_to<1>(
-      Tensor<2,1>&, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned) const;
+      Tensor<2,1>&, const size_type, const size_type, const size_type, const size_type, const size_type, const size_type) const;
 
     template void FullMatrix<S>::copy_to<2>(
-      Tensor<2,2>&, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned) const;
+      Tensor<2,2>&, const size_type, const size_type, const size_type, const size_type, const size_type, const size_type) const;
 
     template void FullMatrix<S>::copy_to<3>(
-      Tensor<2,3>&, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned, const unsigned) const;
+      Tensor<2,3>&, const size_type, const size_type, const size_type, const size_type, const size_type, const size_type) const;
   }
 
 for (S1, S2 : REAL_SCALARS)
@@ -47,7 +51,7 @@ for (S1, S2 : REAL_SCALARS)
 
     template
       void FullMatrix<S1>::fill<S2> (
-       const FullMatrix<S2>&, unsigned, unsigned, unsigned, unsigned);
+       const FullMatrix<S2>&, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
     template
       void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&);
     template
@@ -59,12 +63,12 @@ for (S1, S2 : REAL_SCALARS)
                                    const S1, const FullMatrix<S2>&);
     template
       void FullMatrix<S1>::add<S2> (
-       const FullMatrix<S2>&, S1, unsigned, unsigned,unsigned, unsigned);
+       const FullMatrix<S2>&, S1, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
     template
       void FullMatrix<S1>::Tadd<S2> (const S1, const FullMatrix<S2>&);
     template
       void FullMatrix<S1>::Tadd<S2> (
-       const FullMatrix<S2>&, S1, unsigned, unsigned, unsigned, unsigned);
+       const FullMatrix<S2>&, S1, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
     template
       void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&);
     template
@@ -93,8 +97,8 @@ for (S1, S2 : REAL_SCALARS)
     template
       void FullMatrix<S1>::fill_permutation<S2> (
        const FullMatrix<S2>&,
-       const std::vector<unsigned int>&,
-       const std::vector<unsigned int>&);
+       const std::vector<size_type>&,
+       const std::vector<size_type>&);
     template
       void FullMatrix<S1>::vmult<S2>(
       Vector<S2>&, const Vector<S2>&, bool) const;
@@ -155,7 +159,7 @@ for (S1, S2 : COMPLEX_SCALARS)
   {
     template
       void FullMatrix<S1>::fill<S2> (
-       const FullMatrix<S2>&, unsigned, unsigned, unsigned, unsigned);
+       const FullMatrix<S2>&, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
     template
       void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&);
     template
@@ -167,12 +171,13 @@ for (S1, S2 : COMPLEX_SCALARS)
                                    const S1, const FullMatrix<S2>&);
     template
       void FullMatrix<S1>::add<S2> (
-       const FullMatrix<S2>&, S1, unsigned, unsigned,unsigned, unsigned);
+       const FullMatrix<S2>&, S1, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
     template
       void FullMatrix<S1>::Tadd<S2> (const S1, const FullMatrix<S2>&);
     template
       void FullMatrix<S1>::Tadd<S2> (
-       const FullMatrix<S2>&, S1, unsigned, unsigned, unsigned, unsigned);
+       const FullMatrix<S2>&, S1, types::global_dof_index, types::global_dof_index,
+  types::global_dof_index, types::global_dof_index);
     template
       void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&);
     template
@@ -197,8 +202,8 @@ for (S1, S2 : COMPLEX_SCALARS)
     template
       void FullMatrix<S1>::fill_permutation<S2> (
        const FullMatrix<S2>&,
-       const std::vector<unsigned int>&,
-       const std::vector<unsigned int>&);
+       const std::vector<size_type>&,
+       const std::vector<size_type>&);
     template
       void FullMatrix<S1>::vmult<S2>(
       Vector<S2>&, const Vector<S2>&, bool) const;
index f61fcbd94af9e69f85b778ae33a9b4fb8549f240..215f9c07e19ca7e531b36d53a09d1f5690a52797 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/lapack_full_matrix.h>
 #include <deal.II/lac/lapack_templates.h>
@@ -26,7 +30,7 @@ DEAL_II_NAMESPACE_OPEN
 using namespace LAPACKSupport;
 
 template <typename number>
-LAPACKFullMatrix<number>::LAPACKFullMatrix(const unsigned int n)
+LAPACKFullMatrix<number>::LAPACKFullMatrix(const size_type n)
   :
   TransposeTable<number> (n,n),
   state(matrix)
@@ -35,8 +39,8 @@ LAPACKFullMatrix<number>::LAPACKFullMatrix(const unsigned int n)
 
 template <typename number>
 LAPACKFullMatrix<number>::LAPACKFullMatrix(
-  const unsigned int m,
-  const unsigned int n)
+  const size_type m,
+  const size_type n)
   :
   TransposeTable<number> (m,n),
   state(matrix)
@@ -68,8 +72,8 @@ LAPACKFullMatrix<number>::operator = (const FullMatrix<number2> &M)
 {
   Assert (this->n_rows() == M.m(), ExcDimensionMismatch(this->n_rows(), M.m()));
   Assert (this->n_cols() == M.n(), ExcDimensionMismatch(this->n_cols(), M.n()));
-  for (unsigned int i=0; i<this->n_rows(); ++i)
-    for (unsigned int j=0; j<this->n_cols(); ++j)
+  for (size_type i=0; i<this->n_rows(); ++i)
+    for (size_type j=0; j<this->n_cols(); ++j)
       (*this)(i,j) = M(i,j);
 
   state = LAPACKSupport::matrix;
@@ -123,7 +127,7 @@ LAPACKFullMatrix<number>::vmult (
       work.resize(std::max(mm,nn));
       gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.val, &one, &null, &work[0], &one);
       // Multiply by singular values
-      for (unsigned int i=0; i<wr.size(); ++i)
+      for (size_type i=0; i<wr.size(); ++i)
         work[i] *= wr[i];
       // Multiply with U
       gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, &work[0], &one, &beta, w.val, &one);
@@ -137,7 +141,7 @@ LAPACKFullMatrix<number>::vmult (
       work.resize(std::max(mm,nn));
       gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.val, &one, &null, &work[0], &one);
       // Multiply by singular values
-      for (unsigned int i=0; i<wr.size(); ++i)
+      for (size_type i=0; i<wr.size(); ++i)
         work[i] *= wr[i];
       // Multiply with V
       gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, &work[0], &one, &beta, w.val, &one);
@@ -182,7 +186,7 @@ LAPACKFullMatrix<number>::Tvmult (
       work.resize(std::max(mm,nn));
       gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.val, &one, &null, &work[0], &one);
       // Multiply by singular values
-      for (unsigned int i=0; i<wr.size(); ++i)
+      for (size_type i=0; i<wr.size(); ++i)
         work[i] *= wr[i];
       // Multiply with V
       gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, &work[0], &one, &beta, w.val, &one);
@@ -196,7 +200,7 @@ LAPACKFullMatrix<number>::Tvmult (
         work.resize(std::max(mm,nn));
         gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.val, &one, &null, &work[0], &one);
         // Multiply by singular values
-        for (unsigned int i=0; i<wr.size(); ++i)
+        for (size_type i=0; i<wr.size(); ++i)
           work[i] *= wr[i];
         // Multiply with U
         gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, &work[0], &one, &beta, w.val, &one);
@@ -290,7 +294,7 @@ LAPACKFullMatrix<number>::compute_inverse_svd(const double threshold)
   Assert (state==LAPACKSupport::svd, ExcState(state));
 
   const double lim = wr[0]*threshold;
-  for (unsigned int i=0; i<wr.size(); ++i)
+  for (size_type i=0; i<wr.size(); ++i)
     {
       if (wr[i] > lim)
         wr[i] = 1./wr[i];
@@ -414,7 +418,7 @@ LAPACKFullMatrix<number>::compute_eigenvalues(
   lwork = 4*nn;                    // no query mode
 #endif
   // resize workspace array
-  work.resize((unsigned int) lwork);
+  work.resize((size_type ) lwork);
 
   // Finally compute the eigenvalues.
   geev(jobvl, jobvr, &nn, values, &nn,
@@ -445,7 +449,7 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(
 {
   Assert(state == matrix, ExcState(state));
   const int nn = (this->n_cols() > 0 ? this->n_cols() : 1);
-  Assert(static_cast<unsigned int>(nn) == this->n_rows(), ExcNotQuadratic());
+  Assert(static_cast<size_type>(nn) == this->n_rows(), ExcNotQuadratic());
 
   wr.resize(nn);
   LAPACKFullMatrix<number> matrix_eigenvectors(nn, nn);
@@ -460,8 +464,8 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(
   const char *const uplo(&U);
   const char *const range(&V);
   const int *const  dummy(&one);
-  std::vector<int> iwork(static_cast<unsigned int> (5*nn));
-  std::vector<int> ifail(static_cast<unsigned int> (nn));
+  std::vector<int> iwork(static_cast<size_type> (5*nn));
+  std::vector<int> ifail(static_cast<size_type> (nn));
 
 
   // Optimal workspace query:
@@ -507,7 +511,7 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(
   lwork = 8*nn > 1 ? 8*nn : 1; // no query mode
 #endif
   // resize workspace arrays
-  work.resize(static_cast<unsigned int> (lwork));
+  work.resize(static_cast<size_type> (lwork));
 
   // Finally compute the eigenvalues.
   syevx (jobz, range,
@@ -527,11 +531,11 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(
 
   eigenvalues.reinit(n_eigenpairs);
   eigenvectors.reinit(nn, n_eigenpairs, true);
-  for (unsigned int i=0; i < static_cast<unsigned int> (n_eigenpairs); ++i)
+  for (size_type i=0; i < static_cast<size_type> (n_eigenpairs); ++i)
     {
       eigenvalues(i) = wr[i];
-      unsigned int col_begin(i*nn);
-      for (unsigned int j=0; j < static_cast<unsigned int> (nn); ++j)
+      size_type col_begin(i*nn);
+      for (size_type j=0; j < static_cast<size_type> (nn); ++j)
         {
           eigenvectors(j,i) = values_eigenvectors[col_begin+j];
         }
@@ -554,9 +558,9 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric(
 {
   Assert(state == matrix, ExcState(state));
   const int nn = (this->n_cols() > 0 ? this->n_cols() : 1);
-  Assert(static_cast<unsigned int>(nn) == this->n_rows(), ExcNotQuadratic());
+  Assert(static_cast<size_type>(nn) == this->n_rows(), ExcNotQuadratic());
   Assert(B.n_rows() == B.n_cols(), ExcNotQuadratic());
-  Assert(static_cast<unsigned int>(nn) == B.n_cols(),
+  Assert(static_cast<size_type>(nn) == B.n_cols(),
          ExcDimensionMismatch (nn, B.n_cols()));
 
   wr.resize(nn);
@@ -573,8 +577,8 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric(
   const char *const uplo(&U);
   const char *const range(&V);
   const int *const  dummy(&one);
-  std::vector<int> iwork(static_cast<unsigned int> (5*nn));
-  std::vector<int> ifail(static_cast<unsigned int> (nn));
+  std::vector<int> iwork(static_cast<size_type> (5*nn));
+  std::vector<int> ifail(static_cast<size_type> (nn));
 
 
   // Optimal workspace query:
@@ -618,7 +622,7 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric(
   lwork = 8*nn > 1 ? 8*nn : 1; // no query mode
 #endif
   // resize workspace arrays
-  work.resize(static_cast<unsigned int> (lwork));
+  work.resize(static_cast<size_type> (lwork));
 
   // Finally compute the generalized
   // eigenvalues.
@@ -637,12 +641,12 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric(
 
   eigenvalues.reinit(n_eigenpairs);
   eigenvectors.resize(n_eigenpairs);
-  for (unsigned int i=0; i < static_cast<unsigned int> (n_eigenpairs); ++i)
+  for (size_type i=0; i < static_cast<size_type> (n_eigenpairs); ++i)
     {
       eigenvalues(i) = wr[i];
-      unsigned int col_begin(i*nn);
+      size_type col_begin(i*nn);
       eigenvectors[i].reinit(nn, true);
-      for (unsigned int j=0; j < static_cast<unsigned int> (nn); ++j)
+      for (size_type j=0; j < static_cast<size_type> (nn); ++j)
         {
           eigenvectors[i](j) = values_eigenvectors[col_begin+j];
         }
@@ -661,11 +665,11 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric (
 {
   Assert(state == matrix, ExcState(state));
   const int nn = this->n_cols();
-  Assert(static_cast<unsigned int>(nn) == this->n_rows(), ExcNotQuadratic());
+  Assert(static_cast<size_type>(nn) == this->n_rows(), ExcNotQuadratic());
   Assert(B.n_rows() == B.n_cols(), ExcNotQuadratic());
-  Assert(static_cast<unsigned int>(nn) == B.n_cols(),
+  Assert(static_cast<size_type>(nn) == B.n_cols(),
          ExcDimensionMismatch (nn, B.n_cols()));
-  Assert(eigenvectors.size() <= static_cast<unsigned int>(nn),
+  Assert(eigenvectors.size() <= static_cast<size_type>(nn),
          ExcMessage ("eigenvectors.size() > matrix.n_cols()"));
 
   wr.resize(nn);
@@ -719,7 +723,7 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric (
   lwork = 3*nn-1 > 1 ? 3*nn-1 : 1; // no query mode
 #endif
   // resize workspace array
-  work.resize((unsigned int) lwork);
+  work.resize((size_type) lwork);
 
   // Finally compute the generalized
   // eigenvalues.
@@ -734,11 +738,11 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric (
   if (info != 0)
     std::cerr << "LAPACK error in sygv" << std::endl;
 
-  for (unsigned int i=0; i < eigenvectors.size(); ++i)
+  for (size_type i=0; i < eigenvectors.size(); ++i)
     {
-      unsigned int col_begin(i*nn);
+      size_type col_begin(i*nn);
       eigenvectors[i].reinit(nn, true);
-      for (unsigned int j=0; j < static_cast<unsigned int>(nn); ++j)
+      for (size_type j=0; j < static_cast<size_type>(nn); ++j)
         {
           eigenvectors[i](j) = values_A[col_begin+j];
         }
@@ -805,9 +809,9 @@ LAPACKFullMatrix<number>::print_formatted (
         width = precision+2;
     }
 
-  for (unsigned int i=0; i<this->n_rows(); ++i)
+  for (size_type i=0; i<this->n_rows(); ++i)
     {
-      for (unsigned int j=0; j<this->n_cols(); ++j)
+      for (size_type j=0; j<this->n_cols(); ++j)
         if (std::fabs(this->el(i,j)) > threshold)
           out << std::setw(width)
               << this->el(i,j) * denominator << ' ';
index ddde87b7ccaaac133dd9591678e57cd65b11b130..9db46db4a07de69bf2bf3c6cb005ad3203b1ef4d 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2013 by the deal.II authors
+// Copyright (C) 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (S : REAL_SCALARS)
index 174d6c3b82a4a35d6d44a54c650d32af31695093..69b68c0298bb6df2d4fc91c1836b7319b8c7c3dd 100644 (file)
@@ -1,23 +1,25 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/matrix_lib.templates.h>
 #include <deal.II/lac/sparse_matrix.h>
 
 DEAL_II_NAMESPACE_OPEN
 
-MeanValueFilter::MeanValueFilter(unsigned int component)
+MeanValueFilter::MeanValueFilter(size_type component)
   :
   component(component)
 {}
index 95a74f15d2108d33ae9b7a0348d48456d144f96a..634d5dd7f93931b51798c97192d4ee1c0ddb13d9 100644 (file)
@@ -1,25 +1,27 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/matrix_out.h>
 
 DEAL_II_NAMESPACE_OPEN
 
 
-MatrixOut::Options::Options (const bool         show_absolute_values,
-                             const unsigned int block_size,
-                             const bool         discontinuous)
+MatrixOut::Options::Options (const bool      show_absolute_values,
+                             const size_type block_size,
+                             const bool      discontinuous)
   :
   show_absolute_values (show_absolute_values),
   block_size (block_size),
index 6433b8fc75b9a4df77bca7259575bf94be9a5e4f..9781ae3ad93437720599247fb5f37f8678420902 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/parallel_vector.h>
 #include <deal.II/lac/parallel_vector.templates.h>
index 534d690dc19dde5602af24d58ff5bd2a1786d067..5763c77c13ee6583824fdd6f6e52b4ceb2ac4ccf 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (SCALAR : REAL_SCALARS)
index 4701a9ff0541ceb14a1781b81c74b4c848effe37..58e6e29973f7347d555b6cd144ee0d25600896f6 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_block_sparse_matrix.h>
 
@@ -41,8 +43,8 @@ namespace PETScWrappers
 
   void
   BlockSparseMatrix::
-  reinit (const unsigned int n_block_rows,
-          const unsigned int n_block_columns)
+  reinit (const size_type n_block_rows,
+          const size_type n_block_columns)
   {
     // first delete previous content of
     // the subobjects array
@@ -57,8 +59,8 @@ namespace PETScWrappers
     this->column_block_indices.reinit (n_block_columns, 0);
 
     // and reinitialize the blocks
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         {
           BlockType *p = new BlockType();
           this->sub_objects[r][c] = p;
index fb5fbcd0537e44791fa35cbe1708d24e520b40d1..20903076e895f8618d229625ce26b31938c742f7 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_full_matrix.h>
 
@@ -22,8 +24,8 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace PETScWrappers
 {
-  FullMatrix::FullMatrix (const unsigned int m,
-                          const unsigned int n)
+  FullMatrix::FullMatrix (const size_type m,
+                          const size_type n)
   {
     const int ierr
       = MatCreateSeqDense(PETSC_COMM_SELF, m, n, PETSC_NULL,
index 036addb3394f3fd99bebd16715d9635b585130e6..fb96b311eb4ce3e7b7a6d3dec09dd3e3a4ff7541 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_matrix_base.h>
 
@@ -63,8 +65,7 @@ namespace PETScWrappers
       // iterator for an empty line (what
       // would it point to?)
       Assert (ncols != 0, ExcInternalError());
-      colnum_cache.reset (new std::vector<unsigned int> (colnums,
-                                                         colnums+ncols));
+      colnum_cache.reset (new std::vector<size_type> (colnums, colnums+ncols));
       value_cache.reset (new std::vector<PetscScalar> (values, values+ncols));
 
       // and finally restore the matrix
@@ -134,8 +135,8 @@ namespace PETScWrappers
 
 
   void
-  MatrixBase::clear_row (const unsigned int row,
-                         const PetscScalar  new_diag_value)
+  MatrixBase::clear_row (const size_type   row,
+                         const PetscScalar new_diag_value)
   {
     compress ();
 
@@ -171,8 +172,8 @@ namespace PETScWrappers
 
 
   void
-  MatrixBase::clear_rows (const std::vector<unsigned int> &rows,
-                          const PetscScalar                new_diag_value)
+  MatrixBase::clear_rows (const std::vector<size_type> &rows,
+                          const PetscScalar             new_diag_value)
   {
     compress ();
 
@@ -214,8 +215,8 @@ namespace PETScWrappers
 
 
   PetscScalar
-  MatrixBase::el (const unsigned int i,
-                  const unsigned int j) const
+  MatrixBase::el (const size_type i,
+                  const size_type j) const
   {
     PetscInt petsc_i = i, petsc_j = j;
 
@@ -232,7 +233,7 @@ namespace PETScWrappers
 
 
   PetscScalar
-  MatrixBase::diag_element (const unsigned int i) const
+  MatrixBase::diag_element (const size_type i) const
   {
     Assert (m() == n(), ExcNotQuadratic());
 
@@ -267,7 +268,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  MatrixBase::size_type
   MatrixBase::m () const
   {
     PetscInt n_rows, n_cols;
@@ -280,7 +281,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  MatrixBase::size_type
   MatrixBase::n () const
   {
     PetscInt n_rows, n_cols;
@@ -293,7 +294,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  MatrixBase::size_type
   MatrixBase::local_size () const
   {
     PetscInt n_rows, n_cols;
@@ -306,7 +307,7 @@ namespace PETScWrappers
 
 
 
-  std::pair<unsigned int, unsigned int>
+  std::pair<MatrixBase::size_type, MatrixBase::size_type>
   MatrixBase::local_range () const
   {
     PetscInt begin, end;
@@ -320,7 +321,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  MatrixBase::size_type
   MatrixBase::n_nonzero_elements () const
   {
     MatInfo mat_info;
@@ -328,14 +329,14 @@ namespace PETScWrappers
       = MatGetInfo (matrix, MAT_GLOBAL_SUM, &mat_info);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-    return static_cast<unsigned int>(mat_info.nz_used);
+    return static_cast<size_type>(mat_info.nz_used);
   }
 
 
 
-  unsigned int
+  MatrixBase::size_type
   MatrixBase::
-  row_length (const unsigned int row) const
+  row_length (const size_type row) const
   {
 //TODO: this function will probably only work if compress() was called on the
 //matrix previously. however, we can't do this here, since it would impose
@@ -428,10 +429,10 @@ namespace PETScWrappers
 
 
 #if DEAL_II_PETSC_VERSION_GTE(3,1,0)
-  PetscReal
+  PetscScalar
   MatrixBase::trace () const
   {
-    PetscReal result;
+    PetscScalar result;
 
     const int ierr
       = MatGetTrace (matrix, &result);
@@ -468,16 +469,16 @@ namespace PETScWrappers
 
   MatrixBase &
   MatrixBase::add (const MatrixBase &other,
-                  const PetscScalar factor)
+                   const PetscScalar factor)
   {
     const int ierr = MatAXPY (matrix, factor,
-                             other, DIFFERENT_NONZERO_PATTERN);
+                              other, DIFFERENT_NONZERO_PATTERN);
 
     Assert (ierr == 0, ExcPETScError(ierr));
 
     return *this;
   }
-  
+
 
   void
   MatrixBase::vmult (VectorBase       &dst,
@@ -609,6 +610,36 @@ namespace PETScWrappers
     MatView (matrix, PETSC_VIEWER_STDOUT_WORLD);
   }
 
+  void
+  MatrixBase::print (std::ostream &out,
+                     const bool    alternative_output) const
+  {
+    std::pair<MatrixBase::size_type, MatrixBase::size_type>
+    loc_range = local_range();
+
+    PetscInt ncols;
+    const PetscInt    *colnums;
+    const PetscScalar *values;
+
+    MatrixBase::size_type row;
+    for (row = loc_range.first; row < loc_range.second; ++row)
+      {
+        int ierr;
+        ierr = MatGetRow(*this, row, &ncols, &colnums, &values);
+        AssertThrow (ierr == 0, MatrixBase::ExcPETScError(ierr));
+
+        for (PetscInt col = 0; col < ncols; ++col)
+          {
+            out << "(" << row << "," << colnums[col] << ") " << values[col] << std::endl;
+          }
+
+        ierr = MatRestoreRow(*this, row, &ncols, &colnums, &values);
+        AssertThrow (ierr == 0, MatrixBase::ExcPETScError(ierr));
+      }
+
+    AssertThrow (out, ExcIO());
+  }
+
 
 
   std::size_t
@@ -617,7 +648,7 @@ namespace PETScWrappers
     MatInfo info;
     MatGetInfo(matrix, MAT_LOCAL, &info);
 
-    return sizeof(*this) + static_cast<unsigned int>(info.memory);
+    return sizeof(*this) + static_cast<size_type>(info.memory);
   }
 
 }
index 0a02fd6a27a0f873a0e132b1de32d4ca8d2a5f61..9295ce6146bbedf2cbbba2b2149dd730f05b99aa 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/petsc_matrix_free.h>
 
index e56704cb8f9b4223a8c751fd91ef74008e663213..531cd6be0637db50efc5de40c0079ec14dbc0094 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_parallel_block_sparse_matrix.h>
 
@@ -42,8 +44,8 @@ namespace PETScWrappers
 
     void
     BlockSparseMatrix::
-    reinit (const unsigned int n_block_rows,
-            const unsigned int n_block_columns)
+    reinit (const size_type n_block_rows,
+            const size_type n_block_columns)
     {
       // first delete previous content of
       // the subobjects array
@@ -58,12 +60,63 @@ namespace PETScWrappers
       this->column_block_indices.reinit (n_block_columns, 0);
 
       // and reinitialize the blocks
+      for (size_type r=0; r<this->n_block_rows(); ++r)
+        for (size_type c=0; c<this->n_block_cols(); ++c)
+          {
+            BlockType *p = new BlockType();
+            this->sub_objects[r][c] = p;
+          }
+    }
+
+    void
+    BlockSparseMatrix::
+    reinit(const std::vector<IndexSet> &rows,
+           const std::vector<IndexSet> &cols,
+           const BlockCompressedSimpleSparsityPattern &bcsp,
+           const MPI_Comm &com)
+    {
+      Assert(rows.size() == bcsp.n_block_rows(), ExcMessage("invalid size"));
+      Assert(cols.size() == bcsp.n_block_cols(), ExcMessage("invalid size"));
+
+
+      clear();
+      this->sub_objects.reinit (bcsp.n_block_rows(),
+                                bcsp.n_block_cols());
+
+      std::vector<types::global_dof_index> row_sizes;
+      for (unsigned int r=0; r<bcsp.n_block_rows(); ++r)
+        row_sizes.push_back( bcsp.block(r,0).n_rows() );
+      this->row_block_indices.reinit (row_sizes);
+
+      std::vector<types::global_dof_index> col_sizes;
+      for (unsigned int c=0; c<bcsp.n_block_cols(); ++c)
+        col_sizes.push_back( bcsp.block(0,c).n_cols() );
+      this->column_block_indices.reinit (col_sizes);
+
       for (unsigned int r=0; r<this->n_block_rows(); ++r)
         for (unsigned int c=0; c<this->n_block_cols(); ++c)
           {
+            Assert(rows[r].size() == bcsp.block(r,c).n_rows(), ExcMessage("invalid size"));
+            Assert(cols[c].size() == bcsp.block(r,c).n_cols(), ExcMessage("invalid size"));
+
             BlockType *p = new BlockType();
+            p->reinit(rows[r],
+                      cols[c],
+                      bcsp.block(r,c),
+                      com);
             this->sub_objects[r][c] = p;
           }
+
+      collect_sizes();
+    }
+
+    void
+    BlockSparseMatrix::
+    reinit(const std::vector<IndexSet> &sizes,
+           const BlockCompressedSimpleSparsityPattern &bcsp,
+           const MPI_Comm &com)
+    {
+      reinit(sizes, sizes, bcsp, com);
     }
 
 
index fc11d85a10e26022c0cb0a568a315577da83abcb..6103c62213050ebbfb48062711ceb883ad6a907b 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_parallel_block_vector.h>
 
@@ -24,6 +26,8 @@ namespace PETScWrappers
 {
   namespace MPI
   {
+    typedef types::global_dof_index size_type;
+
     BlockVector &
     BlockVector::operator = (const PETScWrappers::BlockVector &v)
     {
@@ -35,6 +39,21 @@ namespace PETScWrappers
 
       return *this;
     }
+
+
+    void
+    BlockVector::reinit (const unsigned int num_blocks)
+    {
+      std::vector<size_type> block_sizes (num_blocks, 0);
+      this->block_indices.reinit (block_sizes);
+      if (this->components.size() != this->n_blocks())
+        this->components.resize(this->n_blocks());
+
+      for (unsigned int i=0; i<this->n_blocks(); ++i)
+        components[i].reinit (MPI_COMM_SELF, 0, 0);
+
+      collect_sizes();
+    }
   }
 
 }
index b90774a75f61640296493f8d477701565982dd66..e366b66458b53cd427ad0b2fa3528a3a5d6973ea 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_parallel_sparse_matrix.h>
 
@@ -42,13 +44,13 @@ namespace PETScWrappers
 
 
 
-    SparseMatrix::SparseMatrix (const MPI_Comm    &communicator,
-                                const unsigned int m,
-                                const unsigned int n,
-                                const unsigned int local_rows,
-                                const unsigned int local_columns,
-                                const unsigned int n_nonzero_per_row,
-                                const bool         is_symmetric)
+    SparseMatrix::SparseMatrix (const MPI_Comm  &communicator,
+                                const size_type  m,
+                                const size_type  n,
+                                const size_type  local_rows,
+                                const size_type  local_columns,
+                                const size_type  n_nonzero_per_row,
+                                const bool       is_symmetric)
       :
       communicator (communicator)
     {
@@ -58,13 +60,13 @@ namespace PETScWrappers
 
 
 
-    SparseMatrix::SparseMatrix (const MPI_Comm    &communicator,
-                                const unsigned int m,
-                                const unsigned int n,
-                                const unsigned int local_rows,
-                                const unsigned int local_columns,
-                                const std::vector<unsigned int> &row_lengths,
-                                const bool         is_symmetric)
+    SparseMatrix::SparseMatrix (const MPI_Comm               &communicator,
+                                const size_type               m,
+                                const size_type               n,
+                                const size_type               local_rows,
+                                const size_type               local_columns,
+                                const std::vector<size_type> &row_lengths,
+                                const bool                    is_symmetric)
       :
       communicator (communicator)
     {
@@ -76,12 +78,12 @@ namespace PETScWrappers
 
     template <typename SparsityType>
     SparseMatrix::
-    SparseMatrix (const MPI_Comm                  &communicator,
-                  const SparsityType              &sparsity_pattern,
-                  const std::vector<unsigned int> &local_rows_per_process,
-                  const std::vector<unsigned int> &local_columns_per_process,
-                  const unsigned int               this_process,
-                  const bool                       preset_nonzero_locations)
+    SparseMatrix (const MPI_Comm               &communicator,
+                  const SparsityType           &sparsity_pattern,
+                  const std::vector<size_type> &local_rows_per_process,
+                  const std::vector<size_type> &local_columns_per_process,
+                  const unsigned int            this_process,
+                  const bool                    preset_nonzero_locations)
       :
       communicator (communicator)
     {
@@ -99,16 +101,26 @@ namespace PETScWrappers
       return *this;
     }
 
+    void
+    SparseMatrix::copy_from (const SparseMatrix &other)
+    {
+      if (&other == this)
+        return;
 
+      this->communicator = other.communicator;
+
+      int ierr = MatCopy(other.matrix, matrix, SAME_NONZERO_PATTERN);
+      AssertThrow (ierr == 0, ExcPETScError(ierr));
+    }
 
     void
-    SparseMatrix::reinit (const MPI_Comm    &communicator,
-                          const unsigned int m,
-                          const unsigned int n,
-                          const unsigned int local_rows,
-                          const unsigned int local_columns,
-                          const unsigned int n_nonzero_per_row,
-                          const bool         is_symmetric)
+    SparseMatrix::reinit (const MPI_Comm  &communicator,
+                          const size_type  m,
+                          const size_type  n,
+                          const size_type  local_rows,
+                          const size_type  local_columns,
+                          const size_type  n_nonzero_per_row,
+                          const bool       is_symmetric)
     {
       this->communicator = communicator;
 
@@ -128,13 +140,13 @@ namespace PETScWrappers
 
 
     void
-    SparseMatrix::reinit (const MPI_Comm    &communicator,
-                          const unsigned int m,
-                          const unsigned int n,
-                          const unsigned int local_rows,
-                          const unsigned int local_columns,
-                          const std::vector<unsigned int> &row_lengths,
-                          const bool         is_symmetric)
+    SparseMatrix::reinit (const MPI_Comm               &communicator,
+                          const size_type               m,
+                          const size_type               n,
+                          const size_type               local_rows,
+                          const size_type               local_columns,
+                          const std::vector<size_type> &row_lengths,
+                          const bool                    is_symmetric)
     {
       this->communicator = communicator;
 
@@ -155,12 +167,12 @@ namespace PETScWrappers
     template <typename SparsityType>
     void
     SparseMatrix::
-    reinit (const MPI_Comm                  &communicator,
-            const SparsityType              &sparsity_pattern,
-            const std::vector<unsigned int> &local_rows_per_process,
-            const std::vector<unsigned int> &local_columns_per_process,
-            const unsigned int               this_process,
-            const bool                       preset_nonzero_locations)
+    reinit (const MPI_Comm               &communicator,
+            const SparsityType           &sparsity_pattern,
+            const std::vector<size_type> &local_rows_per_process,
+            const std::vector<size_type> &local_columns_per_process,
+            const unsigned int            this_process,
+            const bool                    preset_nonzero_locations)
     {
       this->communicator = communicator;
 
@@ -178,15 +190,35 @@ namespace PETScWrappers
                  preset_nonzero_locations);
     }
 
+    template <typename SparsityType>
+    void
+    SparseMatrix::
+    reinit (const IndexSet &local_rows,
+            const IndexSet &local_columns,
+            const SparsityType &sparsity_pattern,
+            const MPI_Comm &communicator)
+    {
+      this->communicator = communicator;
 
+      // get rid of old matrix and generate a
+      // new one
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
+      const int ierr = MatDestroy (matrix);
+#else
+      const int ierr = MatDestroy (&matrix);
+#endif
+      AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+      do_reinit (local_rows, local_columns, sparsity_pattern);
+    }
 
     void
-    SparseMatrix::do_reinit (const unsigned int m,
-                             const unsigned int n,
-                             const unsigned int local_rows,
-                             const unsigned int local_columns,
-                             const unsigned int n_nonzero_per_row,
-                             const bool         is_symmetric)
+    SparseMatrix::do_reinit (const size_type m,
+                             const size_type n,
+                             const size_type local_rows,
+                             const size_type local_columns,
+                             const size_type n_nonzero_per_row,
+                             const bool      is_symmetric)
     {
       Assert (local_rows <= m, ExcLocalRowsTooLarge (local_rows, m));
 
@@ -233,12 +265,12 @@ namespace PETScWrappers
 
 
     void
-    SparseMatrix::do_reinit (const unsigned int m,
-                             const unsigned int n,
-                             const unsigned int local_rows,
-                             const unsigned int local_columns,
-                             const std::vector<unsigned int> &row_lengths,
-                             const bool         is_symmetric)
+    SparseMatrix::do_reinit (const size_type m,
+                             const size_type n,
+                             const size_type local_rows,
+                             const size_type local_columns,
+                             const std::vector<size_type> &row_lengths,
+                             const bool      is_symmetric)
     {
       Assert (local_rows <= m, ExcLocalRowsTooLarge (local_rows, m));
 
@@ -251,7 +283,7 @@ namespace PETScWrappers
       // MatCreateMPIAIJ throws an
       // error. In this case use a
       // PETScWrappers::SparseMatrix
-      for (unsigned int i=0; i<row_lengths.size(); ++i)
+      for (size_type i=0; i<row_lengths.size(); ++i)
         Assert(row_lengths[i]<=local_columns,
                ExcIndexRange(row_lengths[i], 1, local_columns+1));
 
@@ -308,15 +340,181 @@ namespace PETScWrappers
     }
 
 
+    template <typename SparsityType>
+    void
+    SparseMatrix::
+    do_reinit (const IndexSet &local_rows,
+               const IndexSet &local_columns,
+               const SparsityType         &sparsity_pattern)
+    {
+      Assert(sparsity_pattern.n_rows()==local_rows.size(),
+             ExcMessage("SparsityPattern and IndexSet have different number of rows"));
+      Assert(sparsity_pattern.n_cols()==local_columns.size(),
+             ExcMessage("SparsityPattern and IndexSet have different number of columns"));
+      Assert(local_rows.is_contiguous() && local_columns.is_contiguous(),
+             ExcMessage("PETSc only supports contiguous row/column ranges"));
+
+
+
+
+      // create the matrix. We do not set row length but set the
+      // correct SparsityPattern later.
+      int ierr;
+
+      ierr = MatCreate(communicator,&matrix);
+      AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+      ierr = MatSetSizes(matrix,
+                         local_rows.n_elements(),
+                         local_columns.n_elements(),
+                         sparsity_pattern.n_rows(),
+                         sparsity_pattern.n_cols());
+      AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+      ierr = MatSetType(matrix,MATMPIAIJ);
+      AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+
+      // next preset the exact given matrix
+      // entries with zeros. this doesn't avoid any
+      // memory allocations, but it at least
+      // avoids some searches later on. the
+      // key here is that we can use the
+      // matrix set routines that set an
+      // entire row at once, not a single
+      // entry at a time
+      //
+      // for the usefulness of this option
+      // read the documentation of this
+      // class.
+      //if (preset_nonzero_locations == true)
+      if (local_rows.n_elements()>0)
+        {
+          Assert(local_columns.n_elements()>0, ExcInternalError());
+          // MatMPIAIJSetPreallocationCSR
+          // can be used to allocate the sparsity
+          // pattern of a matrix
+
+          const PetscInt local_row_start = local_rows.nth_index_in_set(0);
+          const PetscInt
+          local_row_end = local_row_start + local_rows.n_elements();
+
+
+          // first set up the column number
+          // array for the rows to be stored
+          // on the local processor. have one
+          // dummy entry at the end to make
+          // sure petsc doesn't read past the
+          // end
+          std::vector<PetscInt>
+
+          rowstart_in_window (local_row_end - local_row_start + 1, 0),
+                             colnums_in_window;
+          {
+            unsigned int n_cols = 0;
+            for (PetscInt i=local_row_start; i<local_row_end; ++i)
+              {
+                const PetscInt row_length = sparsity_pattern.row_length(i);
+                rowstart_in_window[i+1-local_row_start]
+                  = rowstart_in_window[i-local_row_start] + row_length;
+                n_cols += row_length;
+              }
+            colnums_in_window.resize (n_cols+1, -1);
+          }
+
+          // now copy over the information
+          // from the sparsity pattern.
+          {
+            PetscInt *ptr = & colnums_in_window[0];
+
+            for (PetscInt i=local_row_start; i<local_row_end; ++i)
+              {
+                typename SparsityType::row_iterator
+                row_start = sparsity_pattern.row_begin(i),
+                row_end = sparsity_pattern.row_end(i);
+
+                std::copy(row_start, row_end, ptr);
+                ptr += row_end - row_start;
+              }
+          }
+
+
+          // then call the petsc function
+          // that summarily allocates these
+          // entries:
+          MatMPIAIJSetPreallocationCSR (matrix,
+                                        &rowstart_in_window[0],
+                                        &colnums_in_window[0],
+                                        0);
+        }
+      else
+        {
+          PetscInt i=0;
+          MatMPIAIJSetPreallocationCSR (matrix,
+                                        &i,
+                                        &i,
+                                        0);
+
+
+        }
+      compress (dealii::VectorOperation::insert);
+
+      {
+
+        // Tell PETSc that we are not
+        // planning on adding new entries
+        // to the matrix. Generate errors
+        // in debug mode.
+        int ierr;
+#if DEAL_II_PETSC_VERSION_LT(3,0,0)
+#ifdef DEBUG
+        ierr = MatSetOption (matrix, MAT_NEW_NONZERO_LOCATION_ERR);
+        AssertThrow (ierr == 0, ExcPETScError(ierr));
+#else
+        ierr = MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS);
+        AssertThrow (ierr == 0, ExcPETScError(ierr));
+#endif
+#else
+#ifdef DEBUG
+        ierr = MatSetOption (matrix, MAT_NEW_NONZERO_LOCATION_ERR, PETSC_TRUE);
+        AssertThrow (ierr == 0, ExcPETScError(ierr));
+#else
+        ierr = MatSetOption (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE);
+        AssertThrow (ierr == 0, ExcPETScError(ierr));
+#endif
+#endif
+
+        // Tell PETSc to keep the
+        // SparsityPattern entries even if
+        // we delete a row with
+        // clear_rows() which calls
+        // MatZeroRows(). Otherwise one can
+        // not write into that row
+        // afterwards.
+#if DEAL_II_PETSC_VERSION_LT(3,0,0)
+        ierr = MatSetOption (matrix, MAT_KEEP_ZEROED_ROWS);
+        AssertThrow (ierr == 0, ExcPETScError(ierr));
+#elif DEAL_II_PETSC_VERSION_LT(3,1,0)
+        ierr = MatSetOption (matrix, MAT_KEEP_ZEROED_ROWS, PETSC_TRUE);
+        AssertThrow (ierr == 0, ExcPETScError(ierr));
+#else
+        ierr = MatSetOption (matrix, MAT_KEEP_NONZERO_PATTERN, PETSC_TRUE);
+        AssertThrow (ierr == 0, ExcPETScError(ierr));
+#endif
+
+      }
+
+    }
+
 
     template <typename SparsityType>
     void
     SparseMatrix::
-    do_reinit (const SparsityType              &sparsity_pattern,
-               const std::vector<unsigned int> &local_rows_per_process,
-               const std::vector<unsigned int> &local_columns_per_process,
-               const unsigned int               this_process,
-               const bool                       preset_nonzero_locations)
+    do_reinit (const SparsityType           &sparsity_pattern,
+               const std::vector<size_type> &local_rows_per_process,
+               const std::vector<size_type> &local_columns_per_process,
+               const unsigned int            this_process,
+               const bool                    preset_nonzero_locations)
     {
       Assert (local_rows_per_process.size() == local_columns_per_process.size(),
               ExcDimensionMismatch (local_rows_per_process.size(),
@@ -330,14 +528,14 @@ namespace PETScWrappers
       // and how many arent. for this, we
       // first have to know which areas are
       // ours
-      unsigned int local_row_start = 0;
-      unsigned int local_col_start = 0;
+      size_type local_row_start = 0;
+      size_type local_col_start = 0;
       for (unsigned int p=0; p<this_process; ++p)
         {
           local_row_start += local_rows_per_process[p];
           local_col_start += local_columns_per_process[p];
         }
-      const unsigned int
+      const size_type
       local_row_end = local_row_start + local_rows_per_process[this_process];
 
 #if DEAL_II_PETSC_VERSION_LT(2,3,3)
@@ -346,7 +544,7 @@ namespace PETScWrappers
       //at least starting from 2.3.3 (tested,
       //see below)
 
-      const unsigned int
+      const size_type
       local_col_end = local_col_start + local_columns_per_process[this_process];
 
       // then count the elements in- and
@@ -355,10 +553,10 @@ namespace PETScWrappers
 
       row_lengths_in_window (local_row_end - local_row_start),
                             row_lengths_out_of_window (local_row_end - local_row_start);
-      for (unsigned int row = local_row_start; row<local_row_end; ++row)
-        for (unsigned int c=0; c<sparsity_pattern.row_length(row); ++c)
+      for (size_type row = local_row_start; row<local_row_end; ++row)
+        for (size_type c=0; c<sparsity_pattern.row_length(row); ++c)
           {
-            const unsigned int column = sparsity_pattern.column_number(row,c);
+            const size_type column = sparsity_pattern.column_number(row,c);
 
             if ((column >= local_col_start) &&
                 (column < local_col_end))
@@ -438,10 +636,10 @@ namespace PETScWrappers
           rowstart_in_window (local_row_end - local_row_start + 1, 0),
                              colnums_in_window;
           {
-            unsigned int n_cols = 0;
-            for (unsigned int i=local_row_start; i<local_row_end; ++i)
+            size_type n_cols = 0;
+            for (size_type i=local_row_start; i<local_row_end; ++i)
               {
-                const unsigned int row_length = sparsity_pattern.row_length(i);
+                const size_type row_length = sparsity_pattern.row_length(i);
                 rowstart_in_window[i+1-local_row_start]
                   = rowstart_in_window[i-local_row_start] + row_length;
                 n_cols += row_length;
@@ -452,9 +650,9 @@ namespace PETScWrappers
           // now copy over the information
           // from the sparsity pattern.
           {
-            PetscIntptr = & colnums_in_window[0];
+            PetscInt *ptr = & colnums_in_window[0];
 
-            for (unsigned int i=local_row_start; i<local_row_end; ++i)
+            for (size_type i=local_row_start; i<local_row_end; ++i)
               {
                 typename SparsityType::row_iterator
                 row_start = sparsity_pattern.row_begin(i),
@@ -499,7 +697,7 @@ namespace PETScWrappers
             values (sparsity_pattern.max_entries_per_row(),
                     1.);
 
-            for (unsigned int i=local_row_start; i<local_row_end; ++i)
+            for (size_type i=local_row_start; i<local_row_end; ++i)
               {
                 PetscInt petsc_i = i;
                 MatSetValues (matrix, 1, &petsc_i,
@@ -567,66 +765,79 @@ namespace PETScWrappers
     template
     SparseMatrix::SparseMatrix (const MPI_Comm &,
                                 const SparsityPattern &,
-                                const std::vector<unsigned int> &,
-                                const std::vector<unsigned int> &,
+                                const std::vector<size_type> &,
+                                const std::vector<size_type> &,
                                 const unsigned int,
                                 const bool);
     template
     SparseMatrix::SparseMatrix (const MPI_Comm &,
                                 const CompressedSparsityPattern &,
-                                const std::vector<unsigned int> &,
-                                const std::vector<unsigned int> &,
+                                const std::vector<size_type> &,
+                                const std::vector<size_type> &,
                                 const unsigned int,
                                 const bool);
     template
     SparseMatrix::SparseMatrix (const MPI_Comm &,
                                 const CompressedSimpleSparsityPattern &,
-                                const std::vector<unsigned int> &,
-                                const std::vector<unsigned int> &,
+                                const std::vector<size_type> &,
+                                const std::vector<size_type> &,
                                 const unsigned int,
                                 const bool);
 
     template void
     SparseMatrix::reinit (const MPI_Comm &,
                           const SparsityPattern &,
-                          const std::vector<unsigned int> &,
-                          const std::vector<unsigned int> &,
+                          const std::vector<size_type> &,
+                          const std::vector<size_type> &,
                           const unsigned int,
                           const bool);
     template void
     SparseMatrix::reinit (const MPI_Comm &,
                           const CompressedSparsityPattern &,
-                          const std::vector<unsigned int> &,
-                          const std::vector<unsigned int> &,
+                          const std::vector<size_type> &,
+                          const std::vector<size_type> &,
                           const unsigned int,
                           const bool);
     template void
     SparseMatrix::reinit (const MPI_Comm &,
                           const CompressedSimpleSparsityPattern &,
-                          const std::vector<unsigned int> &,
-                          const std::vector<unsigned int> &,
+                          const std::vector<size_type> &,
+                          const std::vector<size_type> &,
                           const unsigned int,
                           const bool);
 
+    template void
+    SparseMatrix::
+    reinit (const IndexSet &,
+            const IndexSet &,
+            const CompressedSimpleSparsityPattern &,
+            const MPI_Comm &);
+
     template void
     SparseMatrix::do_reinit (const SparsityPattern &,
-                             const std::vector<unsigned int> &,
-                             const std::vector<unsigned int> &,
+                             const std::vector<size_type> &,
+                             const std::vector<size_type> &,
                              const unsigned int ,
                              const bool);
     template void
     SparseMatrix::do_reinit (const CompressedSparsityPattern &,
-                             const std::vector<unsigned int> &,
-                             const std::vector<unsigned int> &,
+                             const std::vector<size_type> &,
+                             const std::vector<size_type> &,
                              const unsigned int ,
                              const bool);
     template void
     SparseMatrix::do_reinit (const CompressedSimpleSparsityPattern &,
-                             const std::vector<unsigned int> &,
-                             const std::vector<unsigned int> &,
+                             const std::vector<size_type> &,
+                             const std::vector<size_type> &,
                              const unsigned int ,
                              const bool);
 
+    template void
+    SparseMatrix::
+    do_reinit (const IndexSet &,
+               const IndexSet &,
+               const CompressedSimpleSparsityPattern &);
+
 
     PetscScalar
     SparseMatrix::matrix_norm_square (const Vector &v) const
index 70196a4add02316658571f6d10fe56d6c6e0e32f..7c4cc997ee4aadc034b73de53cde899cc936ba9c 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2006, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_parallel_vector.h>
 
@@ -41,9 +43,9 @@ namespace PETScWrappers
 
 
 
-    Vector::Vector (const MPI_Comm    &communicator,
-                    const unsigned int n,
-                    const unsigned int local_size)
+    Vector::Vector (const MPI_Comm &communicator,
+                    const size_type n,
+                    const size_type local_size)
       :
       communicator (communicator)
     {
@@ -52,9 +54,9 @@ namespace PETScWrappers
 
 
 
-    Vector::Vector (const MPI_Comm    &communicator,
+    Vector::Vector (const MPI_Comm   &communicator,
                     const VectorBase  &v,
-                    const unsigned int local_size)
+                    const size_type   local_size)
       :
       communicator (communicator)
     {
@@ -79,20 +81,45 @@ namespace PETScWrappers
       Vector::create_vector(local.size(), local.n_elements(), ghost_set);
     }
 
+    Vector::Vector (const IndexSet   &local,
+                    const IndexSet &ghost,
+                    const MPI_Comm     &communicator)
+      :
+      communicator (communicator)
+    {
+      Assert(local.is_contiguous(), ExcNotImplemented());
+
+      IndexSet ghost_set = ghost;
+      ghost_set.subtract_set(local);
+
+      Vector::create_vector(local.size(), local.n_elements(), ghost_set);
+    }
+
+
+    Vector::Vector (const IndexSet   &local,
+                    const MPI_Comm     &communicator)
+      :
+      communicator (communicator)
+    {
+      Assert(local.is_contiguous(), ExcNotImplemented());
+      Vector::create_vector(local.size(), local.n_elements());
+    }
+
+
     Vector::Vector (const MPI_Comm     &communicator,
-                     const IndexSet   &local)
-    :
-          communicator (communicator)
+                    const IndexSet   &local)
+      :
+      communicator (communicator)
     {
       Assert(local.is_contiguous(), ExcNotImplemented());
       Vector::create_vector(local.size(), local.n_elements());
     }
 
     void
-    Vector::reinit (const MPI_Comm    &comm,
-                    const unsigned int n,
-                    const unsigned int local_sz,
-                    const bool         fast)
+    Vector::reinit (const MPI_Comm  &comm,
+                    const size_type  n,
+                    const size_type  local_sz,
+                    const bool       fast)
     {
       communicator = comm;
 
@@ -149,6 +176,14 @@ namespace PETScWrappers
     Vector::reinit (const MPI_Comm     &comm,
                     const IndexSet   &local,
                     const IndexSet &ghost)
+    {
+      reinit(local, ghost, comm);
+    }
+
+    void
+    Vector::reinit (const IndexSet   &local,
+                    const IndexSet &ghost,
+                    const MPI_Comm     &comm)
     {
       communicator = comm;
 
@@ -162,11 +197,19 @@ namespace PETScWrappers
 
     void
     Vector::reinit (const MPI_Comm     &comm,
-                 const IndexSet   &local)
+                    const IndexSet   &local)
+    {
+      reinit(local, comm);
+    }
+
+    void
+    Vector::reinit (const IndexSet &local,
+                    const MPI_Comm &comm)
     {
       communicator = comm;
 
       Assert(local.is_contiguous(), ExcNotImplemented());
+      Assert(local.size()>0, ExcMessage("can not create vector of size 0."));
       create_vector(local.size(), local.n_elements());
     }
 
@@ -175,7 +218,7 @@ namespace PETScWrappers
     Vector::operator = (const PETScWrappers::Vector &v)
     {
       Assert(last_action==VectorOperation::unknown,
-          ExcMessage("Call to compress() required before calling operator=."));
+             ExcMessage("Call to compress() required before calling operator=."));
       //TODO [TH]: can not access v.last_action here. Implement is_compressed()?
       //Assert(v.last_action==VectorOperation::unknown,
       //    ExcMessage("Call to compress() required before calling operator=."));
@@ -194,7 +237,7 @@ namespace PETScWrappers
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
       // then copy:
-      const std::pair<unsigned int, unsigned int>
+      const std::pair<size_type, size_type>
       local_elements = local_range ();
       std::copy (src_array + local_elements.first,
                  src_array + local_elements.second,
@@ -214,8 +257,8 @@ namespace PETScWrappers
 
 
     void
-    Vector::create_vector (const unsigned int  n,
-                           const unsigned int  local_size)
+    Vector::create_vector (const size_type n,
+                           const size_type local_size)
     {
       Assert (local_size <= n, ExcIndexRange (local_size, 0, n));
       ghosted = false;
@@ -232,18 +275,15 @@ namespace PETScWrappers
 
 
     void
-    Vector::create_vector (const unsigned int  n,
-                           const unsigned int  local_size,
+    Vector::create_vector (const size_type n,
+                           const size_type local_size,
                            const IndexSet &ghostnodes)
     {
       Assert (local_size <= n, ExcIndexRange (local_size, 0, n));
       ghosted = true;
       ghost_indices = ghostnodes;
 
-      //64bit indices won't work yet:
-      Assert (sizeof(unsigned int)==sizeof(PetscInt), ExcInternalError());
-
-      std::vector<unsigned int> ghostindices;
+      std::vector<size_type> ghostindices;
       ghostnodes.fill_index_vector(ghostindices);
 
       const PetscInt *ptr
@@ -272,7 +312,7 @@ namespace PETScWrappers
 
       ierr = VecGetOwnershipRange (vector, &begin, &end);
 
-      Assert(local_size==(unsigned int)(end-begin), ExcInternalError());
+      Assert(local_size==(size_type)(end-begin), ExcInternalError());
 
       Vec l;
       ierr = VecGhostGetLocalForm(vector, &l);
index d799ae708f32e15cf4b3f6239aa44624ff4132de..8c466b0ba6a9c9b3242f4bc4971a5116aa4ddbf8 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2006, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_precondition.h>
 
index dfed0c3b3514d357d6291122b53c95c72c3bd061..9da2aeef47b12c563b67c1f306b1aa7f37bd02d2 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2006, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/lac/petsc_solver.h>
@@ -849,10 +853,10 @@ namespace PETScWrappers
   }
 
   PetscErrorCode SparseDirectMUMPS::convergence_test (KSP               /*ksp*/,
-                                                     const PetscInt      iteration,
-                                                     const PetscReal     residual_norm,
-                                                     KSPConvergedReason *reason,
-                                                     void               *solver_control_x)
+                                                      const PetscInt      iteration,
+                                                      const PetscReal     residual_norm,
+                                                      KSPConvergedReason *reason,
+                                                      void               *solver_control_x)
   {
     SolverControl &solver_control = *reinterpret_cast<SolverControl *>(solver_control_x);
 
index e77038d6cd50ba45ac1eb37061d4f44ef86f72e5..3b31a7531670da70b1e3039676ae88d80edb3bb3 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_sparse_matrix.h>
 
@@ -37,20 +39,20 @@ namespace PETScWrappers
 
 
 
-  SparseMatrix::SparseMatrix (const unsigned int m,
-                              const unsigned int n,
-                              const unsigned int n_nonzero_per_row,
-                              const bool         is_symmetric)
+  SparseMatrix::SparseMatrix (const size_type m,
+                              const size_type n,
+                              const size_type n_nonzero_per_row,
+                              const bool      is_symmetric)
   {
     do_reinit (m, n, n_nonzero_per_row, is_symmetric);
   }
 
 
 
-  SparseMatrix::SparseMatrix (const unsigned int m,
-                              const unsigned int n,
-                              const std::vector<unsigned int> &row_lengths,
-                              const bool         is_symmetric)
+  SparseMatrix::SparseMatrix (const size_type               m,
+                              const size_type               n,
+                              const std::vector<size_type> &row_lengths,
+                              const bool                    is_symmetric)
   {
     do_reinit (m, n, row_lengths, is_symmetric);
   }
@@ -77,10 +79,10 @@ namespace PETScWrappers
 
 
   void
-  SparseMatrix::reinit (const unsigned int m,
-                        const unsigned int n,
-                        const unsigned int n_nonzero_per_row,
-                        const bool         is_symmetric)
+  SparseMatrix::reinit (const size_type m,
+                        const size_type n,
+                        const size_type n_nonzero_per_row,
+                        const bool      is_symmetric)
   {
     // get rid of old matrix and generate a
     // new one
@@ -97,10 +99,10 @@ namespace PETScWrappers
 
 
   void
-  SparseMatrix::reinit (const unsigned int m,
-                        const unsigned int n,
-                        const std::vector<unsigned int> &row_lengths,
-                        const bool         is_symmetric)
+  SparseMatrix::reinit (const size_type               m,
+                        const size_type               n,
+                        const std::vector<size_type> &row_lengths,
+                        const bool                    is_symmetric)
   {
     // get rid of old matrix and generate a
     // new one
@@ -147,10 +149,10 @@ namespace PETScWrappers
 
 
   void
-  SparseMatrix::do_reinit (const unsigned int m,
-                           const unsigned int n,
-                           const unsigned int n_nonzero_per_row,
-                           const bool         is_symmetric)
+  SparseMatrix::do_reinit (const size_type m,
+                           const size_type n,
+                           const size_type n_nonzero_per_row,
+                           const bool      is_symmetric)
   {
     // use the call sequence indicating only
     // a maximal number of elements per row
@@ -178,10 +180,10 @@ namespace PETScWrappers
 
 
   void
-  SparseMatrix::do_reinit (const unsigned int m,
-                           const unsigned int n,
-                           const std::vector<unsigned int> &row_lengths,
-                           const bool         is_symmetric)
+  SparseMatrix::do_reinit (const size_type               m,
+                           const size_type               n,
+                           const std::vector<size_type> &row_lengths,
+                           const bool                    is_symmetric)
   {
     Assert (row_lengths.size() == m,
             ExcDimensionMismatch (row_lengths.size(), m));
@@ -195,7 +197,7 @@ namespace PETScWrappers
     // convert, unless we want to play dirty
     // tricks with conversions of pointers
     const std::vector<PetscInt>
-      int_row_lengths (row_lengths.begin(), row_lengths.end());
+    int_row_lengths (row_lengths.begin(), row_lengths.end());
 
     const int ierr
       = MatCreateSeqAIJ(PETSC_COMM_SELF, m, n, 0,
@@ -224,8 +226,8 @@ namespace PETScWrappers
   SparseMatrix::do_reinit (const SparsityType &sparsity_pattern,
                            const bool          preset_nonzero_locations)
   {
-    std::vector<unsigned int> row_lengths (sparsity_pattern.n_rows());
-    for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
+    std::vector<size_type> row_lengths (sparsity_pattern.n_rows());
+    for (size_type i=0; i<sparsity_pattern.n_rows(); ++i)
       row_lengths[i] = sparsity_pattern.row_length (i);
 
     do_reinit (sparsity_pattern.n_rows(),
@@ -249,12 +251,11 @@ namespace PETScWrappers
       {
         std::vector<PetscInt>    row_entries;
         std::vector<PetscScalar> row_values;
-
-        for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
+        for (size_type i=0; i<sparsity_pattern.n_rows(); ++i)
           {
             row_entries.resize (row_lengths[i]);
             row_values.resize (row_lengths[i], 0.0);
-            for (unsigned int j=0; j<row_lengths[i]; ++j)
+            for (size_type j=0; j<row_lengths[i]; ++j)
               row_entries[j] = sparsity_pattern.column_number (i,j);
 
             const PetscInt int_row = i;
index 31c9eb3427e4811f765d11fcef1ad4c6b5bc6627..68881a9f98d147ab77ce9ceb1b89312698bc36c5 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2006, 2008, 2012 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_vector.h>
 
@@ -31,7 +33,7 @@ namespace PETScWrappers
 
 
 
-  Vector::Vector (const unsigned int n)
+  Vector::Vector (const size_type n)
   {
     Vector::create_vector (n);
   }
@@ -61,8 +63,8 @@ namespace PETScWrappers
 
 
   void
-  Vector::reinit (const unsigned int n,
-                  const bool         fast)
+  Vector::reinit (const size_type n,
+                  const bool      fast)
   {
     // only do something if the sizes
     // mismatch
@@ -107,7 +109,7 @@ namespace PETScWrappers
 
 
   void
-  Vector::create_vector (const unsigned int n)
+  Vector::create_vector (const size_type n)
   {
     const int ierr
       = VecCreateSeq (PETSC_COMM_SELF, n, &vector);
index 0f8deef8afced3690cd46e7d63e4545815aec742..ae6e39c52b464a5c1ecef6322f34519eb54750d2 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2004 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/petsc_vector_base.h>
 
@@ -87,8 +89,8 @@ namespace PETScWrappers
 
               PetscScalar value;
 
-              if ( index>=static_cast<unsigned int>(begin)
-                   && index<static_cast<unsigned int>(end) )
+              if ( index>=static_cast<size_type>(begin)
+                   && index<static_cast<size_type>(end) )
                 {
                   //local entry
                   value = *(ptr+index-begin);
@@ -96,10 +98,10 @@ namespace PETScWrappers
               else
                 {
                   //ghost entry
-                  const unsigned int ghostidx
+                  const size_type ghostidx
                     = vector.ghost_indices.index_within_set(index);
 
-                  Assert(ghostidx+end-begin<(unsigned int)lsize, ExcInternalError());
+                  Assert(ghostidx+end-begin<(size_type)lsize, ExcInternalError());
                   value = *(ptr+ghostidx+end-begin);
                 }
 
@@ -123,8 +125,8 @@ namespace PETScWrappers
 
 
 
-          AssertThrow ((index >= static_cast<unsigned int>(begin)) &&
-                       (index < static_cast<unsigned int>(end)),
+          AssertThrow ((index >= static_cast<size_type>(begin)) &&
+                       (index < static_cast<size_type>(end)),
                        ExcAccessToNonlocalElement (index, begin, end-1));
 
           // old version which only work with
@@ -152,8 +154,8 @@ namespace PETScWrappers
     attained_ownership(true)
   {
     Assert( multithread_info.is_running_single_threaded(),
-        ExcMessage("PETSc does not support multi-threaded access, set "
-            "the thread limit to 1 in MPI_InitFinalize()."));
+            ExcMessage("PETSc does not support multi-threaded access, set "
+                       "the thread limit to 1 in MPI_InitFinalize()."));
   }
 
 
@@ -167,8 +169,8 @@ namespace PETScWrappers
     attained_ownership(true)
   {
     Assert( multithread_info.is_running_single_threaded(),
-        ExcMessage("PETSc does not support multi-threaded access, set "
-            "the thread limit to 1 in MPI_InitFinalize()."));
+            ExcMessage("PETSc does not support multi-threaded access, set "
+                       "the thread limit to 1 in MPI_InitFinalize()."));
 
     int ierr = VecDuplicate (v.vector, &vector);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
@@ -188,8 +190,8 @@ namespace PETScWrappers
     attained_ownership(false)
   {
     Assert( multithread_info.is_running_single_threaded(),
-        ExcMessage("PETSc does not support multi-threaded access, set "
-            "the thread limit to 1 in MPI_InitFinalize()."));
+            ExcMessage("PETSc does not support multi-threaded access, set "
+                       "the thread limit to 1 in MPI_InitFinalize()."));
   }
 
 
@@ -267,7 +269,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  VectorBase::size_type
   VectorBase::size () const
   {
     PetscInt sz;
@@ -279,7 +281,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  VectorBase::size_type
   VectorBase::local_size () const
   {
     PetscInt sz;
@@ -291,7 +293,7 @@ namespace PETScWrappers
 
 
 
-  std::pair<unsigned int, unsigned int>
+  std::pair<VectorBase::size_type, VectorBase::size_type>
   VectorBase::local_range () const
   {
     PetscInt begin, end;
@@ -305,7 +307,7 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::set (const std::vector<unsigned int> &indices,
+  VectorBase::set (const std::vector<size_type> &indices,
                    const std::vector<PetscScalar>  &values)
   {
     Assert (indices.size() == values.size(),
@@ -316,7 +318,7 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::add (const std::vector<unsigned int> &indices,
+  VectorBase::add (const std::vector<size_type> &indices,
                    const std::vector<PetscScalar>  &values)
   {
     Assert (indices.size() == values.size(),
@@ -327,7 +329,7 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::add (const std::vector<unsigned int>    &indices,
+  VectorBase::add (const std::vector<size_type>    &indices,
                    const ::dealii::Vector<PetscScalar> &values)
   {
     Assert (indices.size() == values.size(),
@@ -338,9 +340,9 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::add (const unsigned int  n_elements,
-                   const unsigned int *indices,
-                   const PetscScalar  *values)
+  VectorBase::add (const size_type    n_elements,
+                   const size_type   *indices,
+                   const PetscScalar *values)
   {
     do_set_add_operation(n_elements, indices, values, true);
   }
@@ -409,18 +411,20 @@ namespace PETScWrappers
     return d*d;
   }
 
-
-
+  // @todo does not build with PETSc complex scalar types.
+  // :425:25: error: no match for â€˜operator/’ in â€˜sum / dealii::PETScWrappers::VectorBase::size()’
   PetscScalar
   VectorBase::mean_value () const
   {
+#ifndef PETSC_USE_COMPLEX
     int ierr;
+
     // We can only use our more efficient
     // routine in the serial case.
     if (dynamic_cast<const PETScWrappers::MPI::Vector *>(this) != 0)
       {
         PetscScalar sum;
-        ierr = VecSum( vector, &sum);
+        ierr = VecSum(vector, &sum);
         AssertThrow (ierr == 0, ExcPETScError(ierr));
         return sum/size();
       }
@@ -463,8 +467,17 @@ namespace PETScWrappers
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
     return mean;
-  }
 
+#else // PETSC_USE_COMPLEX
+    Assert ((false),
+            ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                        "but this function is not defined for complex types."));
+
+    // Prevent compiler warning about no return value
+    PetscScalar dummy;
+    return dummy;
+#endif
+  }
 
 
   VectorBase::real_type
@@ -1034,10 +1047,10 @@ namespace PETScWrappers
       out.setf (std::ios::fixed, std::ios::floatfield);
 
     if (across)
-      for (unsigned int i=0; i<size(); ++i)
+      for (size_type i=0; i<size(); ++i)
         out << val[i] << ' ';
     else
-      for (unsigned int i=0; i<size(); ++i)
+      for (size_type i=0; i<size(); ++i)
         out << val[i] << std::endl;
     out << std::endl;
 
@@ -1093,10 +1106,10 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::do_set_add_operation (const unsigned int  n_elements,
-                                    const unsigned int *indices,
-                                    const PetscScalar  *values,
-                                    const bool          add_values)
+  VectorBase::do_set_add_operation (const size_type    n_elements,
+                                    const size_type   *indices,
+                                    const PetscScalar *values,
+                                    const bool         add_values)
   {
     ::dealii::VectorOperation::values action = (add_values ?
                                                 ::dealii::VectorOperation::add :
@@ -1117,7 +1130,7 @@ namespace PETScWrappers
       {
 #ifdef PETSC_USE_64BIT_INDICES
         std::vector<PetscInt> petsc_ind (n_elements);
-        for (unsigned int i=0; i<n_elements; ++i)
+        for (size_type i=0; i<n_elements; ++i)
           petsc_ind[i] = indices[i];
         const PetscInt *petsc_indices = &petsc_ind[0];
 #else
index 77960c01b1117e5842b8c40b750b9193881e9242..367558457611f3526f05285f1e647585b5d29c1d 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/precondition_block.templates.h>
 #include <deal.II/lac/sparse_matrix.h>
index 0f601bcfa6a5fd2283853b59c9265ef21b42a40a..e079184b97126000e25685994583cd61e4d078e3 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (S : REAL_SCALARS)
index 01987b49bf2be1ee6b627c7328861bcd09756986..d3dad0fedd8320f7c81e74d127e05aea387dea9b 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/precondition_block.templates.h>
 #include <deal.II/lac/sparse_matrix_ez.h>
index 153051f90e880091b48421508394942a12900bb8..c1133f9c5ea377491f8b42a42c83308eb6837192 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/relaxation_block.templates.h>
 #include <deal.II/lac/sparse_matrix.h>
index aea5d8324f6fedbb31ab14349773409f9f41a365..b16557a2d8be3dad75d94338a8dac2920e4255f4 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2011 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (S1, S2 : REAL_SCALARS)
index 4640a0e50c7abb5c56fbb420d48b75d44a35fb24..b821a61c7106352f05cb107340ab523f65653d38 100644 (file)
@@ -1,17 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
-//    Author: Toby D. Young, Polish Academy of Sciences, 2008-2013
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009-2013 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/slepc_solver.h>
 
@@ -109,8 +110,8 @@ namespace SLEPcWrappers
   }
 
   void
-  SolverBase::solve (const unsigned int  n_eigenpairs, 
-                    unsigned int       *n_converged)
+  SolverBase::solve (const size_type  n_eigenpairs,
+                     size_type *n_converged)
   {
     int ierr;
 
@@ -157,7 +158,7 @@ namespace SLEPcWrappers
     // set target eigenvalues to solve for
     ierr = EPSSetTarget (solver_data->eps, target_eigenvalue);
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
-    
+
     // set which portion of the eigenspectrum to solve for
     ierr = EPSSetWhichEigenpairs (solver_data->eps, set_which);
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
@@ -189,7 +190,7 @@ namespace SLEPcWrappers
                             reinterpret_cast<PetscInt *>(n_converged));
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
 
-    int n_iterations     = 0;
+    PetscInt n_iterations = 0;
     double residual_norm = 1e300;
 
     // @todo Investigate elaborating on some of this to act on the
@@ -218,19 +219,20 @@ namespace SLEPcWrappers
   }
 
   void
-  SolverBase::get_eigenpair (const unsigned int         index,
-                             double                    &eigenvalues,
+  SolverBase::get_eigenpair (const size_type            index,
+                             PetscScalar               &eigenvalues,
                              PETScWrappers::VectorBase &eigenvectors)
   {
     AssertThrow (solver_data.get() != 0, ExcSLEPcWrappersUsageError());
 
     // get converged eigenpair
     int ierr = EPSGetEigenpair (solver_data->eps, index,
-                                &eigenvalues, PETSC_NULL, 
-                               eigenvectors, PETSC_NULL);
+                                &eigenvalues, PETSC_NULL,
+                                eigenvectors, PETSC_NULL);
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
   }
 
+
   void
   SolverBase::get_eigenpair (const unsigned int         index,
                              double                    &real_eigenvalues,
@@ -238,15 +240,22 @@ namespace SLEPcWrappers
                              PETScWrappers::VectorBase &real_eigenvectors,
                              PETScWrappers::VectorBase &imag_eigenvectors)
   {
+#ifndef PETSC_USE_COMPLEX
     AssertThrow (solver_data.get() != 0, ExcSLEPcWrappersUsageError());
-    
+
     // get converged eigenpair
     int ierr = EPSGetEigenpair (solver_data->eps, index,
-                               &real_eigenvalues, &imag_eigenvalues, 
-                               real_eigenvectors, imag_eigenvectors);
+                                &real_eigenvalues, &imag_eigenvalues,
+                                real_eigenvectors, imag_eigenvectors);
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
+#else
+    Assert ((false),
+            ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                        "but this function is not defined for complex types."));
+#endif
   }
 
+
   void
   SolverBase::reset ()
   {
@@ -440,11 +449,11 @@ namespace SLEPcWrappers
                              this->solver_control.max_steps());
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
 #else
-    // Supress compiler warnings about unused paameters.
+    // Suppress compiler warnings about unused parameters.
     (void) eps;
 
     // PETSc/SLEPc version must be > 3.1.0.
-    Assert (false,
+    Assert ((false),
             ExcMessage ("Your SLEPc installation does not include a copy of the "
                         "Generalized Davidson solver. A SLEPc version > 3.1.0 is required."));
 #endif
@@ -473,7 +482,7 @@ namespace SLEPcWrappers
                              this->solver_control.max_steps());
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
 #else
-    // Supress compiler warnings about unused paameters.
+    // Suppress compiler warnings about unused parameters.
     (void) eps;
 
     // PETSc/SLEPc version must be > 3.1.0.
@@ -486,8 +495,8 @@ namespace SLEPcWrappers
 
   /* ---------------------- LAPACK ------------------------- */
   SolverLAPACK::SolverLAPACK (SolverControl        &cn,
-                             const MPI_Comm       &mpi_communicator,
-                             const AdditionalData &data)
+                              const MPI_Comm       &mpi_communicator,
+                              const AdditionalData &data)
     :
     SolverBase (cn, mpi_communicator),
     additional_data (data)
@@ -509,7 +518,7 @@ namespace SLEPcWrappers
                              this->solver_control.max_steps());
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
 #else
-    // Supress compiler warnings about unused paameters.
+    // Suppress compiler warnings about unused parameters.
     (void) eps;
 
     Assert ((false),
index 977e29876bf52997c882ff51b8d68d96e0fab424..ff64e5d87dad8fabf5dd9a61cf8926b975335185 100644 (file)
@@ -1,17 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
-//    Author: Toby D. Young, Polish Academy of Sciences, 2009
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/slepc_spectral_transformation.h>
 
index a5dd8a638467ebc3ad951cebd8bdf82529fa2987..145347c6cf879ecc36dade3311525bec98398bd9 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/solver.h>
 #include <deal.II/lac/vector_memory.h>
index f01301a37ecac12b36c0f8b774457921b9a15422..7e158b9d2af188b80285e01f27aae9a819531308 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2013 by the deal.II authors
+// Copyright (C) 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (S : SERIAL_VECTORS)
index 7308250b4e426da6ebcc7932650dc06d80fd6f3d..a6f1c61cb537e273d2bffef27e37662acad9dfe6 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/parameter_handler.h>
index e500e64a3519ad7965b1e47001887cdd81102dea..4ba8f1abc834ece22cf9fb51f432c763a59272b3 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
-//    Copyright (C) 2002, 2003, 2005, 2006, 2012 by the deal.II authors
-//    by the deal.II authors and Stephen "Cheffo" Kolaroff
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//---------------------------------------------------------------------------
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/sparse_decomposition.templates.h>
 
index 4df42981df271c4b41345fad50a704a0f7c1d3cb..ed801cea3135fbc444dc9771a2579fbc6891e325 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2001 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/sparse_direct.h>
 #include <deal.II/base/memory_consumption.h>
@@ -108,7 +110,7 @@ sort_arrays (const SparseMatrix<number> &matrix)
   // column index of the second entry in a row
   //
   // ignore rows with only one or no entry
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  for (size_type row=0; row<matrix.m(); ++row)
     {
       // we may have to move some elements that are left of the diagonal
       // but presently after the diagonal entry to the left, whereas the
@@ -140,7 +142,7 @@ SparseDirectUMFPACK::
 sort_arrays (const SparseMatrixEZ<number> &matrix)
 {
   //same thing for SparseMatrixEZ
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  for (size_type row=0; row<matrix.m(); ++row)
     {
       long int cursor = Ap[row];
       while ((cursor < Ap[row+1]-1) &&
@@ -165,10 +167,10 @@ sort_arrays (const BlockSparseMatrix<number> &matrix)
   // first. however, that means that there may be as many entries per row
   // in the wrong place as there are block columns. we can do the same
   // thing as above, but we have to do it multiple times
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  for (size_type row=0; row<matrix.m(); ++row)
     {
       long int cursor = Ap[row];
-      for (unsigned int block=0; block<matrix.n_block_cols(); ++block)
+      for (size_type block=0; block<matrix.n_block_cols(); ++block)
         {
           // find the next out-of-order element
           while ((cursor < Ap[row+1]-1) &&
@@ -204,7 +206,7 @@ factorize (const Matrix &matrix)
 
   clear ();
 
-  const unsigned int N = matrix.m();
+  const size_type N = matrix.m();
 
   // copy over the data from the matrix to the data structures UMFPACK
   // wants. note two things: first, UMFPACK wants compressed column storage
@@ -230,9 +232,9 @@ factorize (const Matrix &matrix)
 
   // first fill row lengths array
   Ap[0] = 0;
-  for (unsigned int row=1; row<=N; ++row)
+  for (size_type row=1; row<=N; ++row)
     Ap[row] = Ap[row-1] + matrix.get_row_length(row-1);
-  Assert (static_cast<unsigned int>(Ap.back()) == Ai.size(),
+  Assert (static_cast<size_type>(Ap.back()) == Ai.size(),
           ExcInternalError());
 
   // then copy over matrix elements. note that for sparse matrices,
@@ -246,10 +248,10 @@ factorize (const Matrix &matrix)
 
     // loop over the elements of the matrix row by row, as suggested in the
     // documentation of the sparse matrix iterator class
-    for (unsigned int row = 0; row < matrix.m(); ++row)
+    for (size_type row = 0; row < matrix.m(); ++row)
       {
         for (typename Matrix::const_iterator p=matrix.begin(row);
-            p!=matrix.end(row); ++p)
+             p!=matrix.end(row); ++p)
           {
             // write entry into the first free one for this row
             Ai[row_pointers[row]] = p->column();
@@ -261,7 +263,7 @@ factorize (const Matrix &matrix)
       }
 
     // at the end, we should have written all rows completely
-    for (unsigned int i=0; i<Ap.size()-1; ++i)
+    for (size_type i=0; i<Ap.size()-1; ++i)
       Assert (row_pointers[i] == Ap[i+1], ExcInternalError());
   }
 
@@ -291,7 +293,8 @@ factorize (const Matrix &matrix)
 
 
 void
-SparseDirectUMFPACK::solve (Vector<double> &rhs_and_solution) const
+SparseDirectUMFPACK::solve (Vector<double> &rhs_and_solution,
+                            bool            transpose /*=false*/) const
 {
   // make sure that some kind of factorize() call has happened before
   Assert (Ap.size() != 0, ExcNotInitialized());
@@ -304,8 +307,11 @@ SparseDirectUMFPACK::solve (Vector<double> &rhs_and_solution) const
   // solve the system. note that since UMFPACK wants compressed column
   // storage instead of the compressed row storage format we use in
   // deal.II's SparsityPattern classes, we solve for UMFPACK's A^T instead
+
+  // Conversely, if we solve for the transpose, we have to use UMFPACK_A
+  // instead.
   const int status
-    = umfpack_dl_solve (UMFPACK_At,
+    = umfpack_dl_solve (transpose ? UMFPACK_A : UMFPACK_At,
                         &Ap[0], &Ai[0], &Ax[0],
                         rhs_and_solution.begin(), rhs.begin(),
                         numeric_decomposition,
@@ -315,14 +321,15 @@ SparseDirectUMFPACK::solve (Vector<double> &rhs_and_solution) const
 
 
 void
-SparseDirectUMFPACK::solve (BlockVector<double> &rhs_and_solution) const
+SparseDirectUMFPACK::solve (BlockVector<double> &rhs_and_solution,
+                            bool                 transpose /*=false*/) const
 {
   // the UMFPACK functions want a contiguous array of elements, so
   // there is no way around copying data around. thus, just copy the
   // data into a regular vector and back
   Vector<double> tmp (rhs_and_solution.size());
   tmp = rhs_and_solution;
-  solve (tmp);
+  solve (tmp, transpose);
   rhs_and_solution = tmp;
 }
 
@@ -331,20 +338,22 @@ SparseDirectUMFPACK::solve (BlockVector<double> &rhs_and_solution) const
 template <class Matrix>
 void
 SparseDirectUMFPACK::solve (const Matrix   &matrix,
-                            Vector<double> &rhs_and_solution)
+                            Vector<double> &rhs_and_solution,
+                            bool            transpose /*=false*/)
 {
   factorize (matrix);
-  solve (rhs_and_solution);
+  solve (rhs_and_solution, transpose);
 }
 
 
 template <class Matrix>
 void
-SparseDirectUMFPACK::solve (const Matrix   &matrix,
-                            BlockVector<double> &rhs_and_solution)
+SparseDirectUMFPACK::solve (const Matrix        &matrix,
+                            BlockVector<double> &rhs_and_solution,
+                            bool                 transpose /*=false*/)
 {
   factorize (matrix);
-  solve (rhs_and_solution);
+  solve (rhs_and_solution, transpose);
 }
 
 
@@ -372,7 +381,7 @@ void SparseDirectUMFPACK::factorize (const Matrix &)
 
 
 void
-SparseDirectUMFPACK::solve (Vector<double> &) const
+SparseDirectUMFPACK::solve (Vector<double> &, bool) const
 {
   AssertThrow(false, ExcMessage("To call this function you need UMFPACK, but configured deal.II without passing the necessary switch to 'cmake'. Please consult the installation instructions in doc/readme.html."));
 }
@@ -380,7 +389,7 @@ SparseDirectUMFPACK::solve (Vector<double> &) const
 
 
 void
-SparseDirectUMFPACK::solve (BlockVector<double> &) const
+SparseDirectUMFPACK::solve (BlockVector<double> &, bool) const
 {
   AssertThrow(false, ExcMessage("To call this function you need UMFPACK, but configured deal.II without passing the necessary switch to 'cmake'. Please consult the installation instructions in doc/readme.html."));
 }
@@ -389,7 +398,8 @@ SparseDirectUMFPACK::solve (BlockVector<double> &) const
 template <class Matrix>
 void
 SparseDirectUMFPACK::solve (const Matrix &,
-                            Vector<double> &)
+                            Vector<double> &,
+                            bool)
 {
   AssertThrow(false, ExcMessage("To call this function you need UMFPACK, but configured deal.II without passing the necessary switch to 'cmake'. Please consult the installation instructions in doc/readme.html."));
 }
@@ -399,7 +409,8 @@ SparseDirectUMFPACK::solve (const Matrix &,
 template <class Matrix>
 void
 SparseDirectUMFPACK::solve (const Matrix &,
-                            BlockVector<double> &)
+                            BlockVector<double> &,
+                            bool)
 {
   AssertThrow(false, ExcMessage("To call this function you need UMFPACK, but configured deal.II without passing the necessary switch to 'cmake'. Please consult the installation instructions in doc/readme.html."));
 }
@@ -439,10 +450,22 @@ SparseDirectUMFPACK::vmult (
 
 void
 SparseDirectUMFPACK::Tvmult (
-  Vector<double> &,
-  const Vector<double> &) const
+  Vector<double> &dst,
+  const Vector<double> &src) const
 {
-  Assert(false, ExcNotImplemented());
+  dst = src;
+  this->solve(dst, /*transpose=*/ true);
+}
+
+
+
+void
+SparseDirectUMFPACK::Tvmult (
+  BlockVector<double>       &dst,
+  const BlockVector<double> &src) const
+{
+  dst = src;
+  this->solve(dst, /*transpose=*/ true);
 }
 
 
@@ -465,6 +488,7 @@ SparseDirectUMFPACK::Tvmult_add (
 
 
 
+
 #ifdef DEAL_II_WITH_MUMPS
 
 SparseDirectMUMPS::SparseDirectMUMPS ()
@@ -521,14 +545,14 @@ void SparseDirectMUMPS::initialize_matrix (const Matrix &matrix)
       irn = new int[nz];
       jcn = new int[nz];
 
-      unsigned int index = 0;
+      size_type index = 0;
 
       // loop over the elements of the matrix row by row, as suggested in
       // the documentation of the sparse matrix iterator class
-      for (unsigned int row = 0; row < matrix.m(); ++row)
+      for (size_type row = 0; row < matrix.m(); ++row)
         {
           for (typename Matrix::const_iterator ptr = matrix.begin (row);
-              ptr != matrix.end (row); ++ptr)
+               ptr != matrix.end (row); ++ptr)
             if (std::abs (ptr->value ()) > 0.0)
               {
                 a[index]   = ptr->value ();
@@ -567,7 +591,7 @@ void SparseDirectMUMPS::initialize (const Matrix &matrix,
       // Object denoting a MUMPS data structure
       rhs = new double[n];
 
-      for (unsigned int i = 0; i < n; ++i)
+      for (size_type i = 0; i < n; ++i)
         rhs[i] = vector (i);
 
       id.rhs = rhs;
@@ -579,7 +603,7 @@ void SparseDirectMUMPS::copy_solution (Vector<double> &vector)
   // Copy solution into the given vector
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
-      for (unsigned int i=0; i<n; ++i)
+      for (size_type i=0; i<n; ++i)
         vector(i) = rhs[i];
 
       delete[] rhs;
@@ -625,7 +649,7 @@ void SparseDirectMUMPS::vmult (Vector<double>       &dst,
       // Object denoting a MUMPS data structure:
       rhs = new double[n];
 
-      for (unsigned int i = 0; i < n; ++i)
+      for (size_type i = 0; i < n; ++i)
         rhs[i] = src (i);
 
       id.rhs = rhs;
@@ -641,17 +665,19 @@ void SparseDirectMUMPS::vmult (Vector<double>       &dst,
 
 
 // explicit instantiations for SparseMatrixUMFPACK
-#define InstantiateUMFPACK(MATRIX) \
-  template    \
-  void SparseDirectUMFPACK::factorize (const MATRIX &);    \
-  template    \
-  void SparseDirectUMFPACK::solve (const MATRIX   &,    \
-                                   Vector<double> &);    \
-  template    \
-  void SparseDirectUMFPACK::solve (const MATRIX   &,    \
-                                   BlockVector<double> &);    \
-  template    \
-  void SparseDirectUMFPACK::initialize (const MATRIX &,    \
+#define InstantiateUMFPACK(MATRIX)                        \
+  template                                                \
+  void SparseDirectUMFPACK::factorize (const MATRIX &);   \
+  template                                                \
+  void SparseDirectUMFPACK::solve (const MATRIX   &,      \
+                                   Vector<double> &,      \
+                                   bool);                 \
+  template                                                \
+  void SparseDirectUMFPACK::solve (const MATRIX   &,      \
+                                   BlockVector<double> &, \
+                                   bool);                 \
+  template                                                \
+  void SparseDirectUMFPACK::initialize (const MATRIX &,   \
                                         const AdditionalData);
 
 InstantiateUMFPACK(SparseMatrix<double>)
@@ -663,8 +689,8 @@ InstantiateUMFPACK(BlockSparseMatrix<float>)
 
 // explicit instantiations for SparseDirectMUMPS
 #ifdef DEAL_II_WITH_MUMPS
-#define InstantiateMUMPS(MATRIX) \
-  template \
+#define InstantiateMUMPS(MATRIX)                          \
+  template                                                \
   void SparseDirectMUMPS::initialize (const MATRIX &, const Vector<double> &);
 
 InstantiateMUMPS(SparseMatrix<double>)
index ef125efd333234b776f14b8a34dfabf422692a24..a163eb43af2b72367b717181ab57da756c3ba2b0 100644 (file)
@@ -1,13 +1,18 @@
-//---------------------------------------------------------------------------
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2012 by the deal.II authors
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//---------------------------------------------------------------------------
-
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/sparse_ilu.templates.h>
 
index c088dfef3609d58994213fad303e25d9d1b9be32..09cceabf25e43441819757b3e0f18e6d6a6abbbf 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/sparse_matrix.templates.h>
 #include <deal.II/lac/block_vector.h>
index a958f2342405cedde3b40b0173bd6c55daf24de7..8905a992092ebe9e4d12d930b59ba5cc5ba144f6 100644 (file)
@@ -1,15 +1,19 @@
-//----------------------------  sparse_matrix.inst.in  ---------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007, 2009, 2011 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  sparse_matrix.inst.in  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 // real instantiations
@@ -32,16 +36,16 @@ for (S1, S2 : REAL_SCALARS)
     template void SparseMatrix<S1>::add<S2> (const S1,
                                             const SparseMatrix<S2> &);
 
-    template void SparseMatrix<S1>::add<S2> (const unsigned int,
-                                            const unsigned int,
-                                            const unsigned int *,
+    template void SparseMatrix<S1>::add<S2> (const size_type,
+                                            const size_type,
+                                            const size_type *,
                                             const S2 *,
                                             const bool,
                                             const bool);
 
-    template void SparseMatrix<S1>::set<S2> (const unsigned int,
-                                            const unsigned int,
-                                            const unsigned int *,
+    template void SparseMatrix<S1>::set<S2> (const size_type,
+                                            const size_type,
+                                            const size_type *,
                                             const S2 *,
                                             const bool);
   }
@@ -95,13 +99,13 @@ for (S1, S2 : REAL_SCALARS)
                const S1) const;
     template void SparseMatrix<S1>::
       PSOR<S2> (Vector<S2> &,
-               const std::vector<unsigned int>&,
-               const std::vector<unsigned int>&,
+               const std::vector<size_type>&,
+               const std::vector<size_type>&,
                const S1) const;
     template void SparseMatrix<S1>::
       TPSOR<S2> (Vector<S2> &,
-                const std::vector<unsigned int>&,
-                const std::vector<unsigned int>&,
+                const std::vector<size_type>&,
+                const std::vector<size_type>&,
                 const S1) const;
     template void SparseMatrix<S1>::
       Jacobi_step<S2> (Vector<S2> &,
@@ -215,13 +219,13 @@ for (S1, S2, S3: REAL_SCALARS)
 //             const S1) const;
 //     template void SparseMatrix<S1>::
 //       PSOR<S2> (Vector<S2> &,
-//             const std::vector<unsigned int>&,
-//             const std::vector<unsigned int>&,
+//             const std::vector<size_type>&,
+//             const std::vector<size_type>&,
 //             const S1) const;
 //     template void SparseMatrix<S1>::
 //       TPSOR<S2> (Vector<S2> &,
-//              const std::vector<unsigned int>&,
-//              const std::vector<unsigned int>&,
+//              const std::vector<size_type>&,
+//              const std::vector<size_type>&,
 //              const S1) const;
 //     template void SparseMatrix<S1>::
 //       SOR_step<S2> (Vector<S2> &,
index 9ad33b16db3e5ccd830b236f7932252e8145494a..d248429bb083e6c67922416da1365a3c290fc59e 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/sparse_matrix_ez.templates.h>
 #include <deal.II/lac/block_vector.h>
index 1747bc210b7063c8721c5ecd4a6f562fd86f6159..e0c33c4102cfdae2c9d247ec0ff711cb7c1dc1bb 100644 (file)
@@ -1,15 +1,19 @@
-//----------------------------  sparse_matrix_ez.inst.in  ---------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2002, 2003, 2006, 2007 by the deal.II authors
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//----------------------------  sparse_matrix_ez.inst.in  ---------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (S : REAL_SCALARS)
index 51a40f531a509a36129585c42279d9b19b6888c8..8761138f0a85b602ae6aaf5281693113f8a06c50 100644 (file)
@@ -1,13 +1,19 @@
-//---------------------------------------------------------------------------
-//    Copyright (C) 2002, 2003, 2005, 2006, 2012 by the deal.II authors
-//    by the deal.II authors and Stephen "Cheffo" Kolaroff
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// Copyright (C) 2002 - 2013 by the deal.II authors
 //
-//---------------------------------------------------------------------------
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/sparse_mic.templates.h>
 
index 47fbdd4498f4ce6d7f532e4ddf0b67bb7a580c4c..94815867d7ac85f5e18613460c96e262758ed3b6 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/sparse_vanka.templates.h>
 
index 5fa9044356189860a66d367043ca2cbbaed87fa5..18f2c1b0de777fd14dcc87c734eb9b9e5fcbf45c 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/vector_slice.h>
 #include <deal.II/base/utilities.h>
@@ -32,7 +36,7 @@ DEAL_II_NAMESPACE_OPEN
 #ifdef DEAL_II_MSVC
 __declspec(selectany) // Weak extern binding due to multiple link error
 #endif
-const unsigned int SparsityPattern::invalid_entry;
+const SparsityPattern::size_type SparsityPattern::invalid_entry;
 
 
 
@@ -70,8 +74,8 @@ SparsityPattern::SparsityPattern (const SparsityPattern &s)
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int m,
-                                  const unsigned int n,
+SparsityPattern::SparsityPattern (const size_type m,
+                                  const size_type n,
                                   const unsigned int max_per_row,
                                   const bool)
   :
@@ -87,8 +91,8 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int m,
-                                  const unsigned int n,
+SparsityPattern::SparsityPattern (const size_type m,
+                                  const size_type n,
                                   const unsigned int max_per_row)
   :
   max_dim(0),
@@ -103,8 +107,8 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int m,
-                                  const unsigned int n,
+SparsityPattern::SparsityPattern (const size_type m,
+                                  const size_type n,
                                   const std::vector<unsigned int> &row_lengths,
                                   const bool)
   :
@@ -118,8 +122,8 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 }
 
 
-SparsityPattern::SparsityPattern (const unsigned int m,
-                                  const unsigned int n,
+SparsityPattern::SparsityPattern (const size_type m,
+                                  const size_type n,
                                   const std::vector<unsigned int> &row_lengths)
   :
   max_dim(0),
@@ -133,7 +137,7 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int n,
+SparsityPattern::SparsityPattern (const size_type n,
                                   const unsigned int max_per_row)
   :
   max_dim(0),
@@ -146,7 +150,7 @@ SparsityPattern::SparsityPattern (const unsigned int n,
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int               m,
+SparsityPattern::SparsityPattern (const size_type               m,
                                   const std::vector<unsigned int> &row_lengths,
                                   const bool)
   :
@@ -159,7 +163,7 @@ SparsityPattern::SparsityPattern (const unsigned int               m,
 }
 
 
-SparsityPattern::SparsityPattern (const unsigned int               m,
+SparsityPattern::SparsityPattern (const size_type               m,
                                   const std::vector<unsigned int> &row_lengths)
   :
   max_dim(0),
@@ -173,8 +177,8 @@ SparsityPattern::SparsityPattern (const unsigned int               m,
 
 
 SparsityPattern::SparsityPattern (const SparsityPattern &original,
-                                  const unsigned int     max_per_row,
-                                  const unsigned int     extra_off_diagonals)
+                                  const unsigned int        max_per_row,
+                                  const size_type        extra_off_diagonals)
   :
   max_dim(0),
   max_vec_len(0),
@@ -188,7 +192,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
 
   // now copy the entries from
   // the other object
-  for (unsigned int row=0; row<original.rows; ++row)
+  for (size_type row=0; row<original.rows; ++row)
     {
       // copy the elements of this row
       // of the other object
@@ -207,12 +211,12 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
       // the rest from that element onwards
       // which is not a side-diagonal any
       // more.
-      const unsigned int *const
+      const size_type *const
       original_row_start = &original.colnums[original.rowstart[row]] + 1;
       // the following requires that
       // @p{original} be compressed since
       // otherwise there might be invalid_entry's
-      const unsigned int *const
+      const size_type *const
       original_row_end   = &original.colnums[original.rowstart[row+1]];
 
       // find pointers before and
@@ -222,7 +226,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
       // these pointers such that no
       // copying is necessary (see
       // the @p{copy} commands)
-      const unsigned int *const
+      const size_type *const
       original_last_before_side_diagonals
         = (row > extra_off_diagonals ?
            Utilities::lower_bound (original_row_start,
@@ -230,7 +234,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
                                    row-extra_off_diagonals) :
            original_row_start);
 
-      const unsigned int *const
+      const size_type *const
       original_first_after_side_diagonals
         = (row < rows-extra_off_diagonals-1 ?
            std::upper_bound (original_row_start,
@@ -241,7 +245,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
       // find first free slot. the
       // first slot in each row is
       // the diagonal element
-      unsigned int *next_free_slot = &colnums[rowstart[row]] + 1;
+      size_type *next_free_slot = &colnums[rowstart[row]] + 1;
 
       // copy elements before side-diagonals
       next_free_slot = std::copy (original_row_start,
@@ -249,10 +253,10 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
                                   next_free_slot);
 
       // insert left and right side-diagonals
-      for (unsigned int i=1; i<=std::min(row,extra_off_diagonals);
+      for (size_type i=1; i<=std::min(row,extra_off_diagonals);
            ++i, ++next_free_slot)
         *next_free_slot = row-i;
-      for (unsigned int i=1; i<=std::min(extra_off_diagonals, rows-row-1);
+      for (size_type i=1; i<=std::min(extra_off_diagonals, rows-row-1);
            ++i, ++next_free_slot)
         *next_free_slot = row+i;
 
@@ -301,8 +305,8 @@ SparsityPattern::operator = (const SparsityPattern &s)
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
+SparsityPattern::reinit (const size_type m,
+                         const size_type n,
                          const unsigned int max_per_row,
                          const bool)
 {
@@ -315,8 +319,8 @@ SparsityPattern::reinit (const unsigned int m,
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
+SparsityPattern::reinit (const size_type m,
+                         const size_type n,
                          const unsigned int max_per_row)
 {
   // simply map this function to the
@@ -328,8 +332,8 @@ SparsityPattern::reinit (const unsigned int m,
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
+SparsityPattern::reinit (const size_type m,
+                         const size_type n,
                          const VectorSlice<const std::vector<unsigned int> > &row_lengths,
                          const bool)
 {
@@ -339,8 +343,8 @@ SparsityPattern::reinit (const unsigned int m,
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
+SparsityPattern::reinit (const size_type m,
+                         const size_type n,
                          const VectorSlice<const std::vector<unsigned int> > &row_lengths)
 {
   AssertDimension (row_lengths.size(), m);
@@ -381,11 +385,12 @@ SparsityPattern::reinit (const unsigned int m,
   // note that the number of elements
   // per row is bounded by the number
   // of columns
+  //
   std::size_t vec_len = 0;
-  for (unsigned int i=0; i<m; ++i)
-    vec_len += std::min((store_diagonal_first_in_row ?
-                         std::max(row_lengths[i], 1U) :
-                         row_lengths[i]),
+  for (size_type i=0; i<m; ++i)
+    vec_len += std::min(static_cast<size_type>(store_diagonal_first_in_row ?
+                                               std::max(row_lengths[i], 1U) :
+                                               row_lengths[i]),
                         n);
 
   // sometimes, no entries are
@@ -405,13 +410,13 @@ SparsityPattern::reinit (const unsigned int m,
         }
 
       max_vec_len = vec_len;
-      colnums = new unsigned int[max_vec_len];
+      colnums = new size_type[max_vec_len];
     }
 
   max_row_length = (row_lengths.size() == 0 ?
                     0 :
-                    std::min (*std::max_element(row_lengths.begin(),
-                                                row_lengths.end()),
+                    std::min (static_cast<size_type>(*std::max_element(row_lengths.begin(),
+                                                     row_lengths.end())),
                               n));
 
   if (store_diagonal_first_in_row && (max_row_length==0) && (m!=0))
@@ -454,16 +459,17 @@ SparsityPattern::reinit (const unsigned int m,
         }
 
       max_vec_len = vec_len;
-      colnums = new unsigned int[max_vec_len];
+      colnums = new size_type[max_vec_len];
     }
 
   // set the rowstart array
   rowstart[0] = 0;
-  for (unsigned int i=1; i<=rows; ++i)
+  for (size_type i=1; i<=rows; ++i)
     rowstart[i] = rowstart[i-1] +
                   (store_diagonal_first_in_row ?
-                   std::max(std::min(row_lengths[i-1],n),1U) :
-                   std::min(row_lengths[i-1],n));
+                   std::max(std::min(static_cast<size_type>(row_lengths[i-1]),n),
+                            static_cast<size_type> (1U)) :
+                   std::min(static_cast<size_type>(row_lengths[i-1]),n));
   Assert ((rowstart[rows]==vec_len)
           ||
           ((vec_len == 1) && (rowstart[rows] == 0)),
@@ -478,7 +484,7 @@ SparsityPattern::reinit (const unsigned int m,
   // special: let the first entry in
   // each row be the diagonal value
   if (store_diagonal_first_in_row)
-    for (unsigned int i=0; i<rows; i++)
+    for (size_type i=0; i<rows; i++)
       colnums[rowstart[i]] = i;
 
   compressed = false;
@@ -495,9 +501,9 @@ SparsityPattern::compress ()
   if (compressed)
     return;
 
-  unsigned int next_free_entry = 0,
-               next_row_start  = 0,
-               row_length      = 0;
+  size_type next_free_entry = 0,
+            next_row_start  = 0,
+            row_length      = 0;
 
   // first find out how many non-zero
   // elements there are, in order to
@@ -506,22 +512,22 @@ SparsityPattern::compress ()
   const std::size_t nonzero_elements
     = std::count_if (&colnums[rowstart[0]],
                      &colnums[rowstart[rows]],
-                     std::bind2nd(std::not_equal_to<unsigned int>(), invalid_entry));
+                     std::bind2nd(std::not_equal_to<size_type>(), invalid_entry));
   // now allocate the respective memory
-  unsigned int *new_colnums = new unsigned int[nonzero_elements];
+  size_type *new_colnums = new size_type[nonzero_elements];
 
 
   // reserve temporary storage to
   // store the entries of one row
-  std::vector<unsigned int> tmp_entries (max_row_length);
+  std::vector<size_type> tmp_entries (max_row_length);
 
   // Traverse all rows
-  for (unsigned int line=0; line<rows; ++line)
+  for (size_type line=0; line<rows; ++line)
     {
       // copy used entries, break if
       // first unused entry is reached
       row_length = 0;
-      for (unsigned int j=rowstart[line]; j<rowstart[line+1]; ++j,++row_length)
+      for (size_type j=rowstart[line]; j<rowstart[line+1]; ++j,++row_length)
         if (colnums[j] != invalid_entry)
           tmp_entries[row_length] = colnums[j];
         else
@@ -545,7 +551,7 @@ SparsityPattern::compress ()
 
       // insert column numbers
       // into the new field
-      for (unsigned int j=0; j<row_length; ++j)
+      for (size_type j=0; j<row_length; ++j)
         new_colnums[next_free_entry++] = tmp_entries[j];
 
       // note new start of this and
@@ -638,7 +644,7 @@ SparsityPattern::copy_from (const CSP &csp)
   // row or not
   const bool do_diag_optimize = (csp.n_rows() == csp.n_cols());
   std::vector<unsigned int> row_lengths (csp.n_rows());
-  for (unsigned int i=0; i<csp.n_rows(); ++i)
+  for (size_type i=0; i<csp.n_rows(); ++i)
     {
       row_lengths[i] = csp.row_length(i);
       if (do_diag_optimize && !csp.exists(i,i))
@@ -653,15 +659,15 @@ SparsityPattern::copy_from (const CSP &csp)
   // the diagonal element
   // preallocated
   if (n_rows() != 0 && n_cols() != 0)
-    for (unsigned int row = 0; row<csp.n_rows(); ++row)
+    for (size_type row = 0; row<csp.n_rows(); ++row)
       {
-        unsigned int *cols = &colnums[rowstart[row]] + (do_diag_optimize ? 1 : 0);
+        size_type *cols = &colnums[rowstart[row]] + (do_diag_optimize ? 1 : 0);
         typename CSP::row_iterator col_num = csp.row_begin (row),
                                    end_row = csp.row_end (row);
 
         for (; col_num != end_row; ++col_num)
           {
-            const unsigned int col = *col_num;
+            const size_type col = *col_num;
             if ((col!=row) || !do_diag_optimize)
               *cols++ = col;
           }
@@ -694,9 +700,9 @@ void SparsityPattern::copy_from (const FullMatrix<number> &matrix)
   // diagonal entry, unless we have already
   // counted it
   std::vector<unsigned int> entries_per_row (matrix.m(), 0);
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  for (size_type row=0; row<matrix.m(); ++row)
     {
-      for (unsigned int col=0; col<matrix.n(); ++col)
+      for (size_type col=0; col<matrix.n(); ++col)
         if (matrix(row,col) != 0)
           ++entries_per_row[row];
       if ((matrix.m() == matrix.n())
@@ -710,8 +716,8 @@ void SparsityPattern::copy_from (const FullMatrix<number> &matrix)
   reinit (matrix.m(), matrix.n(), entries_per_row);
 
   // now set entries
-  for (unsigned int row=0; row<matrix.m(); ++row)
-    for (unsigned int col=0; col<matrix.n(); ++col)
+  for (size_type row=0; row<matrix.m(); ++row)
+    for (size_type col=0; col<matrix.n(); ++col)
       if (matrix(row,col) != 0)
         add (row,col);
 
@@ -721,8 +727,8 @@ void SparsityPattern::copy_from (const FullMatrix<number> &matrix)
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
+SparsityPattern::reinit (const size_type               m,
+                         const size_type               n,
                          const std::vector<unsigned int> &row_lengths,
                          const bool)
 {
@@ -732,8 +738,8 @@ SparsityPattern::reinit (const unsigned int m,
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
+SparsityPattern::reinit (const size_type               m,
+                         const size_type               n,
                          const std::vector<unsigned int> &row_lengths)
 {
   reinit(m, n, make_slice(row_lengths));
@@ -769,7 +775,7 @@ SparsityPattern::empty () const
 
 
 
-unsigned int
+SparsityPattern::size_type
 SparsityPattern::max_entries_per_row () const
 {
   // if compress() has not yet been
@@ -782,18 +788,18 @@ SparsityPattern::max_entries_per_row () const
   // if compress() was called, we
   // use a better algorithm which
   // gives us a sharp bound
-  unsigned int m = 0;
-  for (unsigned int i=1; i<rows; ++i)
-    m = std::max (m, static_cast<unsigned int>(rowstart[i]-rowstart[i-1]));
+  size_type m = 0;
+  for (size_type i=1; i<rows; ++i)
+    m = std::max (m, static_cast<size_type>(rowstart[i]-rowstart[i-1]));
 
   return m;
 }
 
 
 
-unsigned int
-SparsityPattern::operator () (const unsigned int i,
-                              const unsigned int j) const
+SparsityPattern::size_type
+SparsityPattern::operator () (const size_type i,
+                              const size_type j) const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
   Assert (i<rows, ExcIndexRange(i,0,rows));
@@ -824,13 +830,13 @@ SparsityPattern::operator () (const unsigned int i,
   // top of this function, so it may
   // not be called for noncompressed
   // structures.
-  const unsigned int *sorted_region_start = (store_diagonal_first_in_row ?
-                                             &colnums[rowstart[i]+1] :
-                                             &colnums[rowstart[i]]);
-  const unsigned int *const p
-    = Utilities::lower_bound<const unsigned int *> (sorted_region_start,
-                                                    &colnums[rowstart[i+1]],
-                                                    j);
+  const size_type *sorted_region_start = (store_diagonal_first_in_row ?
+                                          &colnums[rowstart[i]+1] :
+                                          &colnums[rowstart[i]]);
+  const size_type *const p
+    = Utilities::lower_bound<const size_type *> (sorted_region_start,
+                                                 &colnums[rowstart[i+1]],
+                                                 j);
   if ((p != &colnums[rowstart[i+1]])  &&  (*p == j))
     return (p - &colnums[0]);
   else
@@ -840,8 +846,8 @@ SparsityPattern::operator () (const unsigned int i,
 
 
 void
-SparsityPattern::add (const unsigned int i,
-                      const unsigned int j)
+SparsityPattern::add (const size_type i,
+                      const size_type j)
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
   Assert (i<rows, ExcIndexRange(i,0,rows));
@@ -869,10 +875,10 @@ SparsityPattern::add (const unsigned int i,
 
 template <typename ForwardIterator>
 void
-SparsityPattern::add_entries (const unsigned int row,
-                              ForwardIterator    begin,
-                              ForwardIterator    end,
-                              const bool         indices_are_sorted)
+SparsityPattern::add_entries (const size_type row,
+                              ForwardIterator begin,
+                              ForwardIterator end,
+                              const bool      indices_are_sorted)
 {
   if (indices_are_sorted == true)
     {
@@ -913,13 +919,13 @@ SparsityPattern::add_entries (const unsigned int row,
 
 
 bool
-SparsityPattern::exists (const unsigned int i, const unsigned int j) const
+SparsityPattern::exists (const size_type i, const size_type j) const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
   Assert (i<rows, ExcIndexRange(i,0,rows));
   Assert (j<cols, ExcIndexRange(j,0,cols));
 
-  for (unsigned int k=rowstart[i]; k<rowstart[i+1]; k++)
+  for (size_type k=rowstart[i]; k<rowstart[i+1]; k++)
     {
       // entry already exists
       if (colnums[k] == j) return true;
@@ -929,25 +935,25 @@ SparsityPattern::exists (const unsigned int i, const unsigned int j) const
 
 
 
-unsigned int
-SparsityPattern::row_position (const unsigned int i, const unsigned int j) const
+SparsityPattern::size_type
+SparsityPattern::row_position (const size_type i, const size_type j) const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
   Assert (i<rows, ExcIndexRange(i,0,rows));
   Assert (j<cols, ExcIndexRange(j,0,cols));
 
-  for (unsigned int k=rowstart[i]; k<rowstart[i+1]; k++)
+  for (size_type k=rowstart[i]; k<rowstart[i+1]; k++)
     {
       // entry exists
       if (colnums[k] == j) return k-rowstart[i];
     }
-  return numbers::invalid_unsigned_int;
+  return numbers::invalid_size_type;
 }
 
 
 
-std::pair<unsigned int, unsigned int>
-SparsityPattern::matrix_position (const unsigned int global_index) const
+std::pair<SparsityPattern::size_type, SparsityPattern::size_type>
+SparsityPattern::matrix_position (const size_type global_index) const
 {
   Assert (compressed == true, ExcNotCompressed());
   Assert (global_index < n_nonzero_elements(),
@@ -962,14 +968,14 @@ SparsityPattern::matrix_position (const unsigned int global_index) const
   // for the one-past-last row, we
   // can simply use a bisection
   // search on it
-  const unsigned int row
+  const size_type row
     = (std::upper_bound (&rowstart[0], &rowstart[rows], global_index)
        - &rowstart[0] - 1);
 
   // now, the column index is simple
   // since that is what the colnums
   // array stores:
-  const unsigned int col = colnums[global_index];
+  const size_type col = colnums[global_index];
 
   // so return the respective pair
   return std::make_pair (row,col);
@@ -998,8 +1004,8 @@ SparsityPattern::symmetrize ()
   // 2. that the @p{add} function can
   // be called on elements that
   // already exist without any harm
-  for (unsigned int row=0; row<rows; ++row)
-    for (unsigned int k=rowstart[row]; k<rowstart[row+1]; k++)
+  for (size_type row=0; row<rows; ++row)
+    for (size_type k=rowstart[row]; k<rowstart[row+1]; k++)
       {
         // check whether we are at
         // the end of the entries of
@@ -1027,10 +1033,10 @@ SparsityPattern::print (std::ostream &out) const
 
   AssertThrow (out, ExcIO());
 
-  for (unsigned int i=0; i<rows; ++i)
+  for (size_type i=0; i<rows; ++i)
     {
       out << '[' << i;
-      for (unsigned int j=rowstart[i]; j<rowstart[i+1]; ++j)
+      for (size_type j=rowstart[i]; j<rowstart[i+1]; ++j)
         if (colnums[j] != invalid_entry)
           out << ',' << colnums[j];
       out << ']' << std::endl;
@@ -1048,8 +1054,8 @@ SparsityPattern::print_gnuplot (std::ostream &out) const
 
   AssertThrow (out, ExcIO());
 
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=rowstart[i]; j<rowstart[i+1]; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=rowstart[i]; j<rowstart[i+1]; ++j)
       if (colnums[j] != invalid_entry)
         // while matrix entries are
         // usually written (i,j),
@@ -1065,16 +1071,16 @@ SparsityPattern::print_gnuplot (std::ostream &out) const
 
 
 
-unsigned int
+SparsityPattern::size_type
 SparsityPattern::bandwidth () const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
-  unsigned int b=0;
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=rowstart[i]; j<rowstart[i+1]; ++j)
+  size_type b=0;
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=rowstart[i]; j<rowstart[i+1]; ++j)
       if (colnums[j] != invalid_entry)
         {
-          if (static_cast<unsigned int>(std::abs(static_cast<int>(i-colnums[j]))) > b)
+          if (static_cast<size_type>(std::abs(static_cast<int>(i-colnums[j]))) > b)
             b = std::abs(static_cast<signed int>(i-colnums[j]));
         }
       else
@@ -1144,7 +1150,7 @@ SparsityPattern::block_read (std::istream &in)
     delete[] colnums;
 
   rowstart = new std::size_t[max_dim+1];
-  colnums  = new unsigned int[max_vec_len];
+  colnums  = new size_type[max_vec_len];
 
   // then read data
   in.read (reinterpret_cast<char *>(&rowstart[0]),
@@ -1166,9 +1172,9 @@ SparsityPattern::block_read (std::istream &in)
 std::size_t
 SparsityPattern::memory_consumption () const
 {
-  return (max_dim * sizeof(unsigned int) +
+  return (max_dim * sizeof(size_type) +
           sizeof(*this) +
-          max_vec_len * sizeof(unsigned int));
+          max_vec_len * sizeof(size_type));
 }
 
 
@@ -1195,21 +1201,21 @@ template void SparsityPattern::copy_from<CompressedSimpleSparsityPattern> (const
 template void SparsityPattern::copy_from<float> (const FullMatrix<float> &);
 template void SparsityPattern::copy_from<double> (const FullMatrix<double> &);
 
-template void SparsityPattern::add_entries<const unsigned int *> (const unsigned int,
-    const unsigned int *,
-    const unsigned int *,
+template void SparsityPattern::add_entries<const SparsityPattern::size_type *> (const size_type ,
+    const size_type *,
+    const size_type *,
     const bool);
 #ifndef DEAL_II_VECTOR_ITERATOR_IS_POINTER
-template void SparsityPattern::add_entries<std::vector<unsigned int>::const_iterator>
-(const unsigned int,
- std::vector<unsigned int>::const_iterator,
- std::vector<unsigned int>::const_iterator,
+template void SparsityPattern::add_entries<std::vector<SparsityPattern::size_type>::const_iterator>
+(const size_type,
+ std::vector<size_type>::const_iterator,
+ std::vector<size_type>::const_iterator,
  const bool);
 #endif
-template void SparsityPattern::add_entries<std::vector<unsigned int>::iterator>
-(const unsigned int,
- std::vector<unsigned int>::iterator,
- std::vector<unsigned int>::iterator,
+template void SparsityPattern::add_entries<std::vector<SparsityPattern::size_type>::iterator>
+(const size_type,
+ std::vector<size_type>::iterator,
+ std::vector<size_type>::iterator,
  const bool);
 
 DEAL_II_NAMESPACE_CLOSE
index 218f348d8ed0a70d81dc84a60cbaa76e3ff33c8f..f88015c32b643b517b66d1653ab0b957f5415012 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/exceptions.h>
 #include <deal.II/lac/exceptions.h>
@@ -89,7 +93,7 @@ namespace SparsityTools
     int_rowstart.reserve(sparsity_pattern.n_rows()+1);
     std::vector<idx_t> int_colnums;
     int_colnums.reserve(sparsity_pattern.n_nonzero_elements());
-    for (unsigned int row=0; row<sparsity_pattern.n_rows(); ++row)
+    for (size_type row=0; row<sparsity_pattern.n_rows(); ++row)
       {
         for (SparsityPattern::iterator col=sparsity_pattern.begin(row);
              col < sparsity_pattern.end(row); ++col)
@@ -139,19 +143,19 @@ namespace SparsityTools
   {
     /**
      * Given a connectivity graph and a list of indices (where
-     * invalid_unsigned_int indicates that a node has not been numbered yet),
+     * invalid_size_type indicates that a node has not been numbered yet),
      * pick a valid starting index among the as-yet unnumbered one.
      */
-    unsigned int
+    size_type
     find_unnumbered_starting_index (const SparsityPattern     &sparsity,
-                                    const std::vector<unsigned int> &new_indices)
+                                    const std::vector<size_type> &new_indices)
     {
       {
-        unsigned int starting_point   = numbers::invalid_unsigned_int;
-        unsigned int min_coordination = sparsity.n_rows();
-        for (unsigned int row=0; row<sparsity.n_rows(); ++row)
+        size_type starting_point   = numbers::invalid_size_type;
+        size_type min_coordination = sparsity.n_rows();
+        for (size_type row=0; row<sparsity.n_rows(); ++row)
           // look over all as-yet unnumbered indices
-          if (new_indices[row] == numbers::invalid_unsigned_int)
+          if (new_indices[row] == numbers::invalid_size_type)
             {
               SparsityPattern::iterator j = sparsity.begin(row);
 
@@ -161,7 +165,7 @@ namespace SparsityTools
                   break;
               // post-condition after loop: coordination, i.e. the number of
               // entries in this row is now j-rowstart[row]
-              if (static_cast<unsigned int>(j-sparsity.begin(row)) <
+              if (static_cast<size_type>(j-sparsity.begin(row)) <
                   min_coordination)
                 {
                   min_coordination = j-sparsity.begin(row);
@@ -176,16 +180,16 @@ namespace SparsityTools
         //
         // if that should be the case, we can chose an arbitrary dof as
         // starting point, e.g. the first unnumbered one
-        if (starting_point == numbers::invalid_unsigned_int)
+        if (starting_point == numbers::invalid_size_type)
           {
-            for (unsigned int i=0; i<new_indices.size(); ++i)
-              if (new_indices[i] == numbers::invalid_unsigned_int)
+            for (size_type i=0; i<new_indices.size(); ++i)
+              if (new_indices[i] == numbers::invalid_size_type)
                 {
                   starting_point = i;
                   break;
                 }
 
-            Assert (starting_point != numbers::invalid_unsigned_int,
+            Assert (starting_point != numbers::invalid_size_type,
                     ExcInternalError());
           }
 
@@ -197,8 +201,8 @@ namespace SparsityTools
 
   void
   reorder_Cuthill_McKee (const SparsityPattern     &sparsity,
-                         std::vector<unsigned int> &new_indices,
-                         const std::vector<unsigned int> &starting_indices)
+                         std::vector<size_type> &new_indices,
+                         const std::vector<size_type> &starting_indices)
   {
     Assert (sparsity.n_rows() == sparsity.n_cols(),
             ExcDimensionMismatch (sparsity.n_rows(), sparsity.n_cols()));
@@ -206,27 +210,27 @@ namespace SparsityTools
             ExcDimensionMismatch (sparsity.n_rows(), new_indices.size()));
     Assert (starting_indices.size() <= sparsity.n_rows(),
             ExcMessage ("You can't specify more starting indices than there are rows"));
-    for (unsigned int i=0; i<starting_indices.size(); ++i)
+    for (size_type i=0; i<starting_indices.size(); ++i)
       Assert (starting_indices[i] < sparsity.n_rows(),
               ExcMessage ("Invalid starting index"));
 
     // store the indices of the dofs renumbered in the last round. Default to
     // starting points
-    std::vector<unsigned int> last_round_dofs (starting_indices);
+    std::vector<size_type> last_round_dofs (starting_indices);
 
     // initialize the new_indices array with invalid values
     std::fill (new_indices.begin(), new_indices.end(),
-               numbers::invalid_unsigned_int);
+               numbers::invalid_size_type);
 
     // delete disallowed elements
-    for (unsigned int i=0; i<last_round_dofs.size(); ++i)
-      if ((last_round_dofs[i]==numbers::invalid_unsigned_int) ||
+    for (size_type i=0; i<last_round_dofs.size(); ++i)
+      if ((last_round_dofs[i]==numbers::invalid_size_type) ||
           (last_round_dofs[i]>=sparsity.n_rows()))
-        last_round_dofs[i] = numbers::invalid_unsigned_int;
+        last_round_dofs[i] = numbers::invalid_size_type;
 
     std::remove_if (last_round_dofs.begin(), last_round_dofs.end(),
-                    std::bind2nd(std::equal_to<unsigned int>(),
-                                 numbers::invalid_unsigned_int));
+                    std::bind2nd(std::equal_to<size_type>(),
+                                 numbers::invalid_size_type));
 
     // now if no valid points remain: find dof with lowest coordination number
     if (last_round_dofs.empty())
@@ -235,10 +239,10 @@ namespace SparsityTools
                                                             new_indices));
 
     // store next free dof index
-    unsigned int next_free_number = 0;
+    size_type next_free_number = 0;
 
     // enumerate the first round dofs
-    for (unsigned int i=0; i!=last_round_dofs.size(); ++i)
+    for (size_type i=0; i!=last_round_dofs.size(); ++i)
       new_indices[last_round_dofs[i]] = next_free_number++;
 
     // now do as many steps as needed to
@@ -247,12 +251,12 @@ namespace SparsityTools
       {
         // store the indices of the dofs to be
         // renumbered in the next round
-        std::vector<unsigned int> next_round_dofs;
+        std::vector<size_type> next_round_dofs;
 
         // find all neighbors of the
         // dofs numbered in the last
         // round
-        for (unsigned int i=0; i<last_round_dofs.size(); ++i)
+        for (size_type i=0; i<last_round_dofs.size(); ++i)
           for (SparsityPattern::iterator j=sparsity.begin(last_round_dofs[i]);
                j<sparsity.end(last_round_dofs[i]); ++j)
             if (j->is_valid_entry() == false)
@@ -264,14 +268,14 @@ namespace SparsityTools
         std::sort (next_round_dofs.begin(), next_round_dofs.end());
 
         // delete multiple entries
-        std::vector<unsigned int>::iterator end_sorted;
+        std::vector<size_type>::iterator end_sorted;
         end_sorted = std::unique (next_round_dofs.begin(), next_round_dofs.end());
         next_round_dofs.erase (end_sorted, next_round_dofs.end());
 
         // eliminate dofs which are
         // already numbered
         for (int s=next_round_dofs.size()-1; s>=0; --s)
-          if (new_indices[next_round_dofs[s]] != numbers::invalid_unsigned_int)
+          if (new_indices[next_round_dofs[s]] != numbers::invalid_size_type)
             next_round_dofs.erase (next_round_dofs.begin() + s);
 
         // check whether there are
@@ -288,7 +292,7 @@ namespace SparsityTools
         if (next_round_dofs.empty())
           {
             if (std::find (new_indices.begin(), new_indices.end(),
-                           numbers::invalid_unsigned_int)
+                           numbers::invalid_size_type)
                 ==
                 new_indices.end())
               // no unnumbered
@@ -327,14 +331,14 @@ namespace SparsityTools
         // store for each coordination
         // number the dofs with these
         // coordination number
-        std::multimap<unsigned int, int> dofs_by_coordination;
+        std::multimap<size_type, int> dofs_by_coordination;
 
         // find coordination number for
         // each of these dofs
-        for (std::vector<unsigned int>::iterator s=next_round_dofs.begin();
+        for (std::vector<size_type>::iterator s=next_round_dofs.begin();
              s!=next_round_dofs.end(); ++s)
           {
-            unsigned int coordination = 0;
+            size_type coordination = 0;
             for (SparsityPattern::iterator j=sparsity.begin(*s);
                  j<sparsity.end(*s); ++j)
               if (j->is_valid_entry() == false)
@@ -344,14 +348,14 @@ namespace SparsityTools
 
             // insert this dof at its
             // coordination number
-            const std::pair<const unsigned int, int> new_entry (coordination, *s);
+            const std::pair<const size_type, int> new_entry (coordination, *s);
             dofs_by_coordination.insert (new_entry);
           }
 
         // assign new DoF numbers to
         // the elements of the present
         // front:
-        std::multimap<unsigned int, int>::iterator i;
+        std::multimap<size_type, int>::iterator i;
         for (i = dofs_by_coordination.begin(); i!=dofs_by_coordination.end(); ++i)
           new_indices[i->second] = next_free_number++;
 
@@ -366,7 +370,7 @@ namespace SparsityTools
     // front-marching-algorithm (which
     // Cuthill-McKee actually is) has
     // reached all points.
-    Assert ((std::find (new_indices.begin(), new_indices.end(), numbers::invalid_unsigned_int)
+    Assert ((std::find (new_indices.begin(), new_indices.end(), numbers::invalid_size_type)
              ==
              new_indices.end())
             &&
@@ -377,27 +381,27 @@ namespace SparsityTools
 #ifdef DEAL_II_WITH_MPI
   template <class CSP_t>
   void distribute_sparsity_pattern(CSP_t &csp,
-                                   const std::vector<unsigned int> &rows_per_cpu,
+                                   const std::vector<size_type> &rows_per_cpu,
                                    const MPI_Comm &mpi_comm,
                                    const IndexSet &myrange)
   {
-    unsigned int myid = Utilities::MPI::this_mpi_process(mpi_comm);
-    std::vector<unsigned int> start_index(rows_per_cpu.size()+1);
+    size_type myid = Utilities::MPI::this_mpi_process(mpi_comm);
+    std::vector<size_type> start_index(rows_per_cpu.size()+1);
     start_index[0]=0;
-    for (unsigned int i=0; i<rows_per_cpu.size(); ++i)
+    for (size_type i=0; i<rows_per_cpu.size(); ++i)
       start_index[i+1]=start_index[i]+rows_per_cpu[i];
 
-    typedef std::map<unsigned int, std::vector<unsigned int> > map_vec_t;
+    typedef std::map<size_type, std::vector<size_type> > map_vec_t;
 
     map_vec_t send_data;
 
     {
       unsigned int dest_cpu=0;
 
-      unsigned int n_local_rel_rows = myrange.n_elements();
-      for (unsigned int row_idx=0; row_idx<n_local_rel_rows; ++row_idx)
+      size_type n_local_rel_rows = myrange.n_elements();
+      for (size_type row_idx=0; row_idx<n_local_rel_rows; ++row_idx)
         {
-          unsigned int row=myrange.nth_index_in_set(row_idx);
+          size_type row=myrange.nth_index_in_set(row_idx);
 
           //calculate destination CPU
           while (row>=start_index[dest_cpu+1])
@@ -410,21 +414,21 @@ namespace SparsityTools
               continue;
             }
 
-          unsigned int rlen = csp.row_length(row);
+          size_type rlen = csp.row_length(row);
 
           //skip empty lines
           if (!rlen)
             continue;
 
           //save entries
-          std::vector<unsigned int> &dst = send_data[dest_cpu];
+          std::vector<size_type> &dst = send_data[dest_cpu];
 
           dst.push_back(rlen); // number of entries
           dst.push_back(row); // row index
-          for (unsigned int c=0; c<rlen; ++c)
+          for (size_type c=0; c<rlen; ++c)
             {
               //columns
-              unsigned int column = csp.column_number(row, c);
+              size_type column = csp.column_number(row, c);
               dst.push_back(column);
             }
         }
@@ -452,16 +456,19 @@ namespace SparsityTools
       for (map_vec_t::iterator it=send_data.begin(); it!=send_data.end(); ++it, ++idx)
         MPI_Isend(&(it->second[0]),
                   it->second.size(),
-                  MPI_INT,
+                  DEAL_II_DOF_INDEX_MPI_TYPE,
                   it->first,
                   124,
                   mpi_comm,
                   &requests[idx]);
     }
 
+//TODO: In the following, we read individual bytes and then reinterpret them
+//    as size_type objects. this is error prone. use properly typed reads that
+//    match the write above
     {
       //receive
-      std::vector<unsigned int> recv_buf;
+      std::vector<size_type> recv_buf;
       for (unsigned int index=0; index<num_receive; ++index)
         {
           MPI_Status status;
@@ -472,17 +479,17 @@ namespace SparsityTools
           MPI_Get_count(&status, MPI_BYTE, &len);
           Assert( len%sizeof(unsigned int)==0, ExcInternalError());
 
-          recv_buf.resize(len/sizeof(unsigned int));
+          recv_buf.resize(len/sizeof(size_type));
 
           MPI_Recv(&recv_buf[0], len, MPI_BYTE, status.MPI_SOURCE,
                    status.MPI_TAG, mpi_comm, &status);
 
-          std::vector<unsigned int>::const_iterator ptr = recv_buf.begin();
-          std::vector<unsigned int>::const_iterator end = recv_buf.end();
+          std::vector<size_type>::const_iterator ptr = recv_buf.begin();
+          std::vector<size_type>::const_iterator end = recv_buf.end();
           while (ptr+1<end)
             {
-              unsigned int num=*(ptr++);
-              unsigned int row=*(ptr++);
+              size_type num=*(ptr++);
+              size_type row=*(ptr++);
               for (unsigned int c=0; c<num; ++c)
                 {
                   csp.add(row, *ptr);
@@ -490,7 +497,6 @@ namespace SparsityTools
                 }
             }
           Assert(ptr==end, ExcInternalError());
-
         }
     }
 
@@ -507,7 +513,7 @@ namespace SparsityTools
 
 #define SPARSITY_FUNCTIONS(SparsityType) \
   template void SparsityTools::distribute_sparsity_pattern<SparsityType> (SparsityType & csp, \
-      const std::vector<unsigned int> & rows_per_cpu,\
+      const std::vector<size_type> & rows_per_cpu,\
       const MPI_Comm & mpi_comm,\
       const IndexSet & myrange)
 
index 172fbcc863a23956d726583b959b62063ecde928..8b69a06923dac2c6679300ab12f2940937416e1f 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/swappable_vector.templates.h>
 
index ede29f74c54edcd13c9c5b26c04fc733c067c6d0..06087be6454ab92263c3caad383277cc592dda6d 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2005, 2006, 2012 by the deal.II authors
+// Copyright (C) 2005 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/tridiagonal_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -21,7 +25,7 @@ using namespace LAPACKSupport;
 
 template<typename number>
 TridiagonalMatrix<number>::TridiagonalMatrix(
-  unsigned int size,
+  size_type size,
   bool symmetric)
   :
   diagonal(size, 0.),
@@ -35,7 +39,7 @@ TridiagonalMatrix<number>::TridiagonalMatrix(
 template<typename number>
 void
 TridiagonalMatrix<number>::reinit(
-  unsigned int size,
+  size_type size,
   bool symmetric)
 {
   is_symmetric = symmetric;
@@ -86,7 +90,7 @@ TridiagonalMatrix<number>::vmult (
 
   // The actual loop skips the first
   // and last row
-  const unsigned int e=n()-1;
+  const size_type e=n()-1;
   // Let iterators point to the first
   // entry of each diagonal
   typename std::vector<number>::const_iterator d = diagonal.begin();
@@ -107,7 +111,7 @@ TridiagonalMatrix<number>::vmult (
       ++d;
       ++r;
       // All rows with three entries
-      for (unsigned int i=1; i<e; ++i,++d,++r,++l)
+      for (size_type i=1; i<e; ++i,++d,++r,++l)
         w(i) += (*l) * v(i-1) + (*d) * v(i) + (*r) * v(i+1);
       // Last row is special again
       w(e) += (*l) * v(e-1) + (*d) * v(e);
@@ -117,7 +121,7 @@ TridiagonalMatrix<number>::vmult (
       w(0) = (*d) * v(0) + (*r) * v(1);
       ++d;
       ++r;
-      for (unsigned int i=1; i<e; ++i,++d,++r,++l)
+      for (size_type i=1; i<e; ++i,++d,++r,++l)
         w(i) = (*l) * v(i-1) + (*d) * v(i) + (*r) * v(i+1);
       w(e) = (*l) * v(e-1) + (*d) * v(e);
     }
@@ -148,7 +152,7 @@ TridiagonalMatrix<number>::Tvmult (
 
   if (n()==0) return;
 
-  const unsigned int e=n()-1;
+  const size_type e=n()-1;
   typename std::vector<number>::const_iterator d = diagonal.begin();
   typename std::vector<number>::const_iterator r = right.begin();
   typename std::vector<number>::const_iterator l = left.begin();
@@ -162,7 +166,7 @@ TridiagonalMatrix<number>::Tvmult (
       w(0) += (*d) * v(0) + (*l) * v(1);
       ++d;
       ++l;
-      for (unsigned int i=1; i<e; ++i,++d,++r,++l)
+      for (size_type i=1; i<e; ++i,++d,++r,++l)
         w(i) += (*l) * v(i+1) + (*d) * v(i) + (*r) * v(i-1);
       w(e) += (*d) * v(e) + (*r) * v(e-1);
     }
@@ -171,7 +175,7 @@ TridiagonalMatrix<number>::Tvmult (
       w(0) = (*d) * v(0) + (*l) * v(1);
       ++d;
       ++l;
-      for (unsigned int i=1; i<e; ++i,++d,++r,++l)
+      for (size_type i=1; i<e; ++i,++d,++r,++l)
         w(i) = (*l) * v(i+1) + (*d) * v(i) + (*r) * v(i-1);
       w(e) = (*d) * v(e) + (*r) * v(e-1);
     }
@@ -196,7 +200,7 @@ TridiagonalMatrix<number>::matrix_scalar_product(
 {
   Assert(state == matrix, ExcState(state));
 
-  const unsigned int e=n()-1;
+  const size_type e=n()-1;
   typename std::vector<number>::const_iterator d = diagonal.begin();
   typename std::vector<number>::const_iterator r = right.begin();
   typename std::vector<number>::const_iterator l = left.begin();
@@ -208,7 +212,7 @@ TridiagonalMatrix<number>::matrix_scalar_product(
   number result = w(0) * ((*d) * v(0) + (*r) * v(1));
   ++d;
   ++r;
-  for (unsigned int i=1; i<e; ++i,++d,++r,++l)
+  for (size_type i=1; i<e; ++i,++d,++r,++l)
     result += w(i) * ((*l) * v(i-1)+ (*d) * v(i)+ (*r) * v(i+1));
   result += w(e) * ((*l) * v(e-1) + (*d) * v(e));
   return result;
@@ -246,7 +250,7 @@ TridiagonalMatrix<double>::compute_eigenvalues()
 
 template<typename number>
 number
-TridiagonalMatrix<number>::eigenvalue(const unsigned int i) const
+TridiagonalMatrix<number>::eigenvalue(const size_type i) const
 {
   Assert(state == eigenvalues, ExcState(state));
   Assert(i<n(), ExcIndexRange(i,0,n()));
index 9c5cffcac36a19f4d614ffdbe6c838b0c1036b18..b338de4186fdcb5ec95ab9e7c3cc7ecf6248e788 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/trilinos_block_sparse_matrix.h>
 
@@ -49,8 +51,8 @@ namespace TrilinosWrappers
 
   void
   BlockSparseMatrix::
-  reinit (const unsigned int n_block_rows,
-          const unsigned int n_block_columns)
+  reinit (const size_type n_block_rows,
+          const size_type n_block_columns)
   {
     // first delete previous content of
     // the subobjects array
@@ -65,8 +67,8 @@ namespace TrilinosWrappers
     this->column_block_indices.reinit (n_block_columns, 0);
 
     // and reinitialize the blocks
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         {
           BlockType *p = new BlockType();
 
@@ -91,7 +93,7 @@ namespace TrilinosWrappers
             ExcDimensionMismatch (parallel_partitioning.size(),
                                   block_sparsity_pattern.n_block_cols()));
 
-    const unsigned int n_block_rows = parallel_partitioning.size();
+    const size_type n_block_rows = parallel_partitioning.size();
 
     Assert (n_block_rows == block_sparsity_pattern.n_block_rows(),
             ExcDimensionMismatch (n_block_rows,
@@ -111,8 +113,8 @@ namespace TrilinosWrappers
 
     // ... and then assign the correct
     // data to the blocks.
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         {
           this->sub_objects[r][c]->reinit (parallel_partitioning[r],
                                            parallel_partitioning[c],
@@ -130,7 +132,7 @@ namespace TrilinosWrappers
           const MPI_Comm              &communicator)
   {
     std::vector<Epetra_Map> epetra_maps;
-    for (unsigned int i=0; i<block_sparsity_pattern.n_block_rows(); ++i)
+    for (size_type i=0; i<block_sparsity_pattern.n_block_rows(); ++i)
       epetra_maps.push_back
       (parallel_partitioning[i].make_trilinos_map(communicator, false));
 
@@ -146,9 +148,9 @@ namespace TrilinosWrappers
   reinit (const BlockSparsityType &block_sparsity_pattern)
   {
     std::vector<Epetra_Map> parallel_partitioning;
-    for (unsigned int i=0; i<block_sparsity_pattern.n_block_rows(); ++i)
+    for (size_type i=0; i<block_sparsity_pattern.n_block_rows(); ++i)
       parallel_partitioning.push_back
-      (Epetra_Map(static_cast<int>(block_sparsity_pattern.block(i,0).n_rows()),
+      (Epetra_Map(static_cast<TrilinosWrappers::types::int_type>(block_sparsity_pattern.block(i,0).n_rows()),
                   0,
                   Utilities::Trilinos::comm_self()));
 
@@ -173,8 +175,8 @@ namespace TrilinosWrappers
 
     // ... and then assign the correct
     // data to the blocks.
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         {
           this->sub_objects[r][c]->reinit (block_sparsity_pattern.block(r,c));
         }
@@ -188,7 +190,7 @@ namespace TrilinosWrappers
           const ::dealii::BlockSparseMatrix<double> &dealii_block_sparse_matrix,
           const double                               drop_tolerance)
   {
-    const unsigned int n_block_rows = parallel_partitioning.size();
+    const size_type n_block_rows = parallel_partitioning.size();
 
     Assert (n_block_rows == dealii_block_sparse_matrix.n_block_rows(),
             ExcDimensionMismatch (n_block_rows,
@@ -202,8 +204,8 @@ namespace TrilinosWrappers
 
     // ... and then assign the correct
     // data to the blocks.
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         {
           this->sub_objects[r][c]->reinit(parallel_partitioning[r],
                                           parallel_partitioning[c],
@@ -239,8 +241,8 @@ namespace TrilinosWrappers
 #endif
 
     std::vector<Epetra_Map> parallel_partitioning;
-    for (unsigned int i=0; i<dealii_block_sparse_matrix.n_block_rows(); ++i)
-      parallel_partitioning.push_back (Epetra_Map(static_cast<int>(dealii_block_sparse_matrix.block(i,0).m()),
+    for (size_type i=0; i<dealii_block_sparse_matrix.n_block_rows(); ++i)
+      parallel_partitioning.push_back (Epetra_Map(static_cast<TrilinosWrappers::types::int_type>(dealii_block_sparse_matrix.block(i,0).m()),
                                                   0,
                                                   trilinos_communicator));
 
@@ -260,12 +262,12 @@ namespace TrilinosWrappers
 
 
 
-  unsigned int
+  BlockSparseMatrix::size_type
   BlockSparseMatrix::n_nonzero_elements () const
   {
-    unsigned int n_nonzero = 0;
-    for (unsigned int rows = 0; rows<this->n_block_rows(); ++rows)
-      for (unsigned int cols = 0; cols<this->n_block_cols(); ++cols)
+    size_type n_nonzero = 0;
+    for (size_type rows = 0; rows<this->n_block_rows(); ++rows)
+      for (size_type cols = 0; cols<this->n_block_cols(); ++cols)
         n_nonzero += this->block(rows,cols).n_nonzero_elements();
 
     return n_nonzero;
@@ -402,6 +404,11 @@ namespace TrilinosWrappers
   BlockSparseMatrix::reinit (const std::vector<Epetra_Map> &,
                              const dealii::BlockCompressedSimpleSparsityPattern &);
 
+  template void
+  BlockSparseMatrix::reinit (const std::vector<IndexSet> &,
+                             const dealii::BlockCompressedSimpleSparsityPattern &,
+                             const MPI_Comm &);
+
 }
 
 
index 2d2b8cf7461251262015d6f3714cf65663bd67dc..b09660c23687e21e1fccd75363a4eab775f42346 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/trilinos_block_vector.h>
 
@@ -23,6 +25,26 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace TrilinosWrappers
 {
+  namespace
+  {
+    // define a helper function that queries the size of an Epetra_Map object
+    // by calling either the 32- or 64-bit function necessary, and returns the
+    // result in the correct data type so that we can use it in calling other
+    // Epetra member functions that are overloaded by index type
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    int n_global_elements (const Epetra_BlockMap &map)
+    {
+      return map.NumGlobalElements();
+    }
+#else
+    long long int n_global_elements (const Epetra_BlockMap &map)
+    {
+      return map.NumGlobalElements64();
+    }
+#endif
+  }
+
+
   namespace MPI
   {
     BlockVector &
@@ -40,7 +62,7 @@ namespace TrilinosWrappers
       if (this->n_blocks() != v.n_blocks())
         reinit(v.n_blocks());
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         this->components[i] = v.block(i);
 
       collect_sizes();
@@ -56,7 +78,7 @@ namespace TrilinosWrappers
       Assert (n_blocks() == v.n_blocks(),
               ExcDimensionMismatch(n_blocks(),v.n_blocks()));
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         this->components[i] = v.block(i);
 
       return *this;
@@ -73,19 +95,19 @@ namespace TrilinosWrappers
     BlockVector::reinit (const std::vector<Epetra_Map> &input_maps,
                          const bool                     fast)
     {
-      const unsigned int no_blocks = input_maps.size();
-      std::vector<unsigned int> block_sizes (no_blocks);
+      const size_type no_blocks = input_maps.size();
+      std::vector<size_type> block_sizes (no_blocks);
 
-      for (unsigned int i=0; i<no_blocks; ++i)
+      for (size_type i=0; i<no_blocks; ++i)
         {
-          block_sizes[i] = input_maps[i].NumGlobalElements();
+          block_sizes[i] = n_global_elements(input_maps[i]);
         }
 
       this->block_indices.reinit (block_sizes);
       if (components.size() != n_blocks())
         components.resize(n_blocks());
 
-      for (unsigned int i=0; i<n_blocks(); ++i)
+      for (size_type i=0; i<n_blocks(); ++i)
         components[i].reinit(input_maps[i], fast);
 
       collect_sizes();
@@ -98,10 +120,10 @@ namespace TrilinosWrappers
                          const MPI_Comm              &communicator,
                          const bool                   fast)
     {
-      const unsigned int no_blocks = parallel_partitioning.size();
-      std::vector<unsigned int> block_sizes (no_blocks);
+      const size_type no_blocks = parallel_partitioning.size();
+      std::vector<size_type> block_sizes (no_blocks);
 
-      for (unsigned int i=0; i<no_blocks; ++i)
+      for (size_type i=0; i<no_blocks; ++i)
         {
           block_sizes[i] = parallel_partitioning[i].size();
         }
@@ -110,12 +132,34 @@ namespace TrilinosWrappers
       if (components.size() != n_blocks())
         components.resize(n_blocks());
 
-      for (unsigned int i=0; i<n_blocks(); ++i)
+      for (size_type i=0; i<n_blocks(); ++i)
         components[i].reinit(parallel_partitioning[i], communicator, fast);
 
       collect_sizes();
     }
 
+    void
+    BlockVector::reinit (const std::vector<IndexSet> &parallel_partitioning,
+                         const std::vector<IndexSet> &ghost_values,
+                         const MPI_Comm              &communicator)
+    {
+      const size_type no_blocks = parallel_partitioning.size();
+      std::vector<size_type> block_sizes (no_blocks);
+
+      for (size_type i=0; i<no_blocks; ++i)
+        {
+          block_sizes[i] = parallel_partitioning[i].size();
+        }
+
+      this->block_indices.reinit (block_sizes);
+      if (components.size() != n_blocks())
+        components.resize(n_blocks());
+
+      for (size_type i=0; i<n_blocks(); ++i)
+        components[i].reinit(parallel_partitioning[i], ghost_values[i], communicator);
+
+      collect_sizes();
+    }
 
 
     void
@@ -126,7 +170,7 @@ namespace TrilinosWrappers
       if (components.size() != n_blocks())
         components.resize(n_blocks());
 
-      for (unsigned int i=0; i<n_blocks(); ++i)
+      for (size_type i=0; i<n_blocks(); ++i)
         components[i].reinit(v.block(i), fast, false);
 
       collect_sizes();
@@ -135,14 +179,14 @@ namespace TrilinosWrappers
 
 
     void
-    BlockVector::reinit (const unsigned int num_blocks)
+    BlockVector::reinit (const size_type num_blocks)
     {
-      std::vector<unsigned int> block_sizes (num_blocks, 0);
+      std::vector<size_type> block_sizes (num_blocks, 0);
       this->block_indices.reinit (block_sizes);
       if (this->components.size() != this->n_blocks())
         this->components.resize(this->n_blocks());
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         components[i].clear();
 
       collect_sizes();
@@ -166,7 +210,7 @@ namespace TrilinosWrappers
           components.resize(v.n_blocks());
         }
 
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         components[i].import_nonlocal_data_for_fe(m.block(i,i), v.block(i));
 
       collect_sizes();
@@ -179,7 +223,7 @@ namespace TrilinosWrappers
                              const bool          scientific,
                              const bool          across) const
     {
-      for (unsigned int i=0; i<this->n_blocks(); ++i)
+      for (size_type i=0; i<this->n_blocks(); ++i)
         {
           if (across)
             out << 'C' << i << ':';
@@ -209,18 +253,18 @@ namespace TrilinosWrappers
   BlockVector::reinit (const std::vector<Epetra_Map> &input_maps,
                        const bool                     fast)
   {
-    unsigned int no_blocks = input_maps.size();
-    std::vector<unsigned int> block_sizes (no_blocks);
+    size_type no_blocks = input_maps.size();
+    std::vector<size_type> block_sizes (no_blocks);
 
-    for (unsigned int i=0; i<no_blocks; ++i)
-      block_sizes[i] = input_maps[i].NumGlobalElements();
+    for (size_type i=0; i<no_blocks; ++i)
+      block_sizes[i] = n_global_elements(input_maps[i]);
 
 
     this->block_indices.reinit (block_sizes);
     if (components.size() != n_blocks())
       components.resize(n_blocks());
 
-    for (unsigned int i=0; i<n_blocks(); ++i)
+    for (size_type i=0; i<n_blocks(); ++i)
       components[i].reinit(input_maps[i], fast);
 
     collect_sizes();
@@ -233,10 +277,10 @@ namespace TrilinosWrappers
                        const MPI_Comm              &communicator,
                        const bool                   fast)
   {
-    unsigned int no_blocks = partitioning.size();
-    std::vector<unsigned int> block_sizes (no_blocks);
+    size_type no_blocks = partitioning.size();
+    std::vector<size_type> block_sizes (no_blocks);
 
-    for (unsigned int i=0; i<no_blocks; ++i)
+    for (size_type i=0; i<no_blocks; ++i)
       block_sizes[i] = partitioning[i].size();
 
 
@@ -244,7 +288,7 @@ namespace TrilinosWrappers
     if (components.size() != n_blocks())
       components.resize(n_blocks());
 
-    for (unsigned int i=0; i<n_blocks(); ++i)
+    for (size_type i=0; i<n_blocks(); ++i)
       components[i].reinit(partitioning[i], communicator, fast);
 
     collect_sizes();
@@ -253,14 +297,14 @@ namespace TrilinosWrappers
 
 
   void
-  BlockVector::reinit (const std::vector<unsigned int> &block_sizes,
-                       const bool                       fast)
+  BlockVector::reinit (const std::vector<size_type> &block_sizes,
+                       const bool                    fast)
   {
     this->block_indices.reinit (block_sizes);
     if (components.size() != n_blocks())
       components.resize(n_blocks());
 
-    for (unsigned int i=0; i<n_blocks(); ++i)
+    for (size_type i=0; i<n_blocks(); ++i)
       components[i].reinit(block_sizes[i], fast);
 
     collect_sizes();
@@ -275,21 +319,21 @@ namespace TrilinosWrappers
     if (components.size() != n_blocks())
       components.resize(n_blocks());
 
-    for (unsigned int i=0; i<n_blocks(); ++i)
+    for (size_type i=0; i<n_blocks(); ++i)
       components[i] = v.block(i);
   }
 
 
 
   void
-  BlockVector::reinit (const unsigned int num_blocks)
+  BlockVector::reinit (const size_type num_blocks)
   {
-    std::vector<unsigned int> block_sizes (num_blocks, 0);
+    std::vector<size_type> block_sizes (num_blocks, 0);
     block_indices.reinit (block_sizes);
     if (components.size() != n_blocks())
       components.resize(n_blocks());
 
-    for (unsigned int i=0; i<n_blocks(); ++i)
+    for (size_type i=0; i<n_blocks(); ++i)
       block(i).clear();
 
     collect_sizes();
@@ -305,7 +349,7 @@ namespace TrilinosWrappers
     if (components.size() != n_blocks())
       components.resize(n_blocks());
 
-    for (unsigned int i=0; i<n_blocks(); ++i)
+    for (size_type i=0; i<n_blocks(); ++i)
       components[i].reinit(v.block(i), fast);
 
     collect_sizes();
@@ -328,13 +372,13 @@ namespace TrilinosWrappers
   {
     if (n_blocks() != v.n_blocks())
       {
-        std::vector<unsigned int> block_sizes (v.n_blocks(), 0);
+        std::vector<size_type> block_sizes (v.n_blocks(), 0);
         block_indices.reinit (block_sizes);
         if (components.size() != n_blocks())
           components.resize(n_blocks());
       }
 
-    for (unsigned int i=0; i<this->n_blocks(); ++i)
+    for (size_type i=0; i<this->n_blocks(); ++i)
       this->components[i] = v.block(i);
 
     collect_sizes();
@@ -349,7 +393,7 @@ namespace TrilinosWrappers
                            const bool          scientific,
                            const bool          across) const
   {
-    for (unsigned int i=0; i<this->n_blocks(); ++i)
+    for (size_type i=0; i<this->n_blocks(); ++i)
       {
         if (across)
           out << 'C' << i << ':';
index e812285533dec9edd88bed91b1322522c9eac998..d8342f04d2e7bd9153996b4e68cea27baacfded5 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/trilinos_precondition.h>
 
@@ -32,6 +34,30 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace TrilinosWrappers
 {
+  namespace
+  {
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    int global_length (const Epetra_MultiVector &vector)
+    {
+      return vector.GlobalLength();
+    }
+
+    int gid(const Epetra_Map &map, unsigned int i)
+    {
+      return map.GID(i);
+    }
+#else
+    long long int global_length (const Epetra_MultiVector &vector)
+    {
+      return vector.GlobalLength64();
+    }
+
+    long long int gid(const Epetra_Map &map, dealii::types::global_dof_index i)
+    {
+      return map.GID64(i);
+    }
+#endif
+  }
 
   PreconditionBase::PreconditionBase()
 #ifdef DEAL_II_WITH_MPI
@@ -509,7 +535,7 @@ namespace TrilinosWrappers
   PreconditionAMG:: initialize (const SparseMatrix   &matrix,
                                 const AdditionalData &additional_data)
   {
-    const unsigned int n_rows = matrix.m();
+    const size_type n_rows = matrix.m();
 
     // Build the AMG preconditioner.
     Teuchos::ParameterList parameter_list;
@@ -575,7 +601,7 @@ namespace TrilinosWrappers
 
     const Epetra_Map &domain_map = matrix.domain_partitioner();
 
-    const unsigned int constant_modes_dimension =
+    const size_type constant_modes_dimension =
       additional_data.constant_modes.size();
     Epetra_MultiVector distributed_constant_modes (domain_map,
                                                    constant_modes_dimension);
@@ -585,25 +611,26 @@ namespace TrilinosWrappers
       {
         const bool constant_modes_are_global =
           additional_data.constant_modes[0].size() == n_rows;
-        const unsigned int n_relevant_rows =
+        const size_type n_relevant_rows =
           constant_modes_are_global ? n_rows : additional_data.constant_modes[0].size();
-        const unsigned int my_size = domain_map.NumMyElements();
+        const size_type my_size = domain_map.NumMyElements();
         if (constant_modes_are_global == false)
           Assert (n_relevant_rows == my_size,
                   ExcDimensionMismatch(n_relevant_rows, my_size));
         Assert (n_rows ==
-                static_cast<unsigned int>(distributed_constant_modes.GlobalLength()),
+                static_cast<size_type>(global_length(distributed_constant_modes)),
                 ExcDimensionMismatch(n_rows,
-                                     distributed_constant_modes.GlobalLength()));
+                                     global_length(distributed_constant_modes)));
 
         // Reshape null space as a
         // contiguous vector of
         // doubles so that Trilinos
         // can read from it.
-        for (unsigned int d=0; d<constant_modes_dimension; ++d)
-          for (unsigned int row=0; row<my_size; ++row)
+        for (size_type d=0; d<constant_modes_dimension; ++d)
+          for (size_type row=0; row<my_size; ++row)
             {
-              int global_row_id = constant_modes_are_global ? domain_map.GID(row) : row;
+              TrilinosWrappers::types::int_type global_row_id =
+                constant_modes_are_global ? gid(domain_map,row) : row;
               distributed_constant_modes[d][row] =
                 additional_data.constant_modes[d][global_row_id];
             }
@@ -657,13 +684,14 @@ namespace TrilinosWrappers
               const ::dealii::SparsityPattern      *use_this_sparsity)
   {
     preconditioner.reset();
-    const unsigned int n_rows = deal_ii_sparse_matrix.m();
+    const size_type n_rows = deal_ii_sparse_matrix.m();
 
     // Init Epetra Matrix using an
     // equidistributed map; avoid
     // storing the nonzero
     // elements.
-    vector_distributor.reset (new Epetra_Map(static_cast<int>(n_rows), 0, communicator));
+    vector_distributor.reset (new Epetra_Map(static_cast<TrilinosWrappers::types::int_type>(n_rows),
+                                             0, communicator));
 
     if (trilinos_matrix.get() == 0)
       trilinos_matrix.reset (new SparseMatrix());
@@ -694,7 +722,7 @@ namespace TrilinosWrappers
 
 
 
-  std::size_t
+  PreconditionAMG::size_type
   PreconditionAMG::memory_consumption() const
   {
     unsigned int memory = sizeof(this);
index 60ae66c5de613c98378c27bfa10f9e96c3183073..f04ca39f85986d85602ee4d8ad41d2f9ffd9a8f8 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/trilinos_solver.h>
 
@@ -73,8 +75,6 @@ namespace TrilinosWrappers
                      const VectorBase       &b,
                      const PreconditionBase &preconditioner)
   {
-    int ierr;
-
     linear_problem.reset();
 
     // We need an
@@ -87,86 +87,30 @@ namespace TrilinosWrappers
                               &x.trilinos_vector(),
                               const_cast<Epetra_MultiVector *>(&b.trilinos_vector())));
 
-    // Next we can allocate the
-    // AztecOO solver...
-    solver.SetProblem(*linear_problem);
-
-    // ... and we can specify the
-    // solver to be used.
-    switch (solver_name)
-      {
-      case cg:
-        solver.SetAztecOption(AZ_solver, AZ_cg);
-        break;
-      case cgs:
-        solver.SetAztecOption(AZ_solver, AZ_cgs);
-        break;
-      case gmres:
-        solver.SetAztecOption(AZ_solver, AZ_gmres);
-        solver.SetAztecOption(AZ_kspace, additional_data.gmres_restart_parameter);
-        break;
-      case bicgstab:
-        solver.SetAztecOption(AZ_solver, AZ_bicgstab);
-        break;
-      case tfqmr:
-        solver.SetAztecOption(AZ_solver, AZ_tfqmr);
-        break;
-      default:
-        Assert (false, ExcNotImplemented());
-      }
-
-    // Introduce the
-    // preconditioner, ...
-    ierr = solver.SetPrecOperator (const_cast<Epetra_Operator *>
-                                   (preconditioner.preconditioner.get()));
-    AssertThrow (ierr == 0, ExcTrilinosError(ierr));
+    execute_solve(preconditioner);
+  }
 
-    // ... set some options, ...
-    solver.SetAztecOption (AZ_output, additional_data.output_solver_details ?
-                           AZ_all : AZ_none);
-    solver.SetAztecOption (AZ_conv, AZ_noscaled);
 
-    // ... and then solve!
-    ierr = solver.Iterate (solver_control.max_steps(),
-                           solver_control.tolerance());
 
-    // report errors in more detail
-    // than just by checking whether
-    // the return status is zero or
-    // greater. the error strings are
-    // taken from the implementation
-    // of the AztecOO::Iterate
-    // function
-    switch (ierr)
-      {
-      case -1:
-        AssertThrow (false, ExcMessage("AztecOO::Iterate error code -1: "
-                                       "option not implemented"));
-      case -2:
-        AssertThrow (false, ExcMessage("AztecOO::Iterate error code -2: "
-                                       "numerical breakdown"));
-      case -3:
-        AssertThrow (false, ExcMessage("AztecOO::Iterate error code -3: "
-                                       "loss of precision"));
-      case -4:
-        AssertThrow (false, ExcMessage("AztecOO::Iterate error code -4: "
-                                       "GMRES hessenberg ill-conditioned"));
-      default:
-        AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
-      }
+  void
+  SolverBase::solve (Epetra_Operator        &A,
+                     VectorBase             &x,
+                     const VectorBase       &b,
+                     const PreconditionBase &preconditioner)
+  {
+    linear_problem.reset();
 
-    // Finally, let the deal.II
-    // SolverControl object know
-    // what has happened. If the
-    // solve succeeded, the status
-    // of the solver control will
-    // turn into
-    // SolverControl::success.
-    solver_control.check (solver.NumIters(), solver.TrueResidual());
+    // We need an
+    // Epetra_LinearProblem object
+    // to let the AztecOO solver
+    // know about the matrix and
+    // vectors.
+    linear_problem.reset
+    (new Epetra_LinearProblem(&A,
+                              &x.trilinos_vector(),
+                              const_cast<Epetra_MultiVector *>(&b.trilinos_vector())));
 
-    if (solver_control.last_check() != SolverControl::success)
-      throw SolverControl::NoConvergence (solver_control.last_step(),
-                                          solver_control.last_value());
+    execute_solve(preconditioner);
   }
 
 
@@ -177,8 +121,6 @@ namespace TrilinosWrappers
                      const dealii::Vector<double> &b,
                      const PreconditionBase       &preconditioner)
   {
-    int ierr;
-
     linear_problem.reset();
 
     // In case we call the solver with
@@ -205,6 +147,39 @@ namespace TrilinosWrappers
                           (const_cast<Epetra_CrsMatrix *>(&A.trilinos_matrix()),
                            &ep_x, &ep_b));
 
+    execute_solve(preconditioner);
+  }
+
+
+
+  void
+  SolverBase::solve (Epetra_Operator              &A,
+                     dealii::Vector<double>       &x,
+                     const dealii::Vector<double> &b,
+                     const PreconditionBase       &preconditioner)
+  {
+    linear_problem.reset();
+
+    Epetra_Vector ep_x (View, A.OperatorDomainMap(), x.begin());
+    Epetra_Vector ep_b (View, A.OperatorRangeMap(), const_cast<double *>(b.begin()));
+
+    // We need an
+    // Epetra_LinearProblem object
+    // to let the AztecOO solver
+    // know about the matrix and
+    // vectors.
+    linear_problem.reset (new Epetra_LinearProblem(&A,&ep_x, &ep_b));
+
+    execute_solve(preconditioner);
+  }
+
+
+
+  void
+  SolverBase::execute_solve(const PreconditionBase &preconditioner)
+  {
+    int ierr;
+
     // Next we can allocate the
     // AztecOO solver...
     solver.SetProblem(*linear_problem);
@@ -247,7 +222,31 @@ namespace TrilinosWrappers
     // ... and then solve!
     ierr = solver.Iterate (solver_control.max_steps(),
                            solver_control.tolerance());
-    AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
+
+    // report errors in more detail
+    // than just by checking whether
+    // the return status is zero or
+    // greater. the error strings are
+    // taken from the implementation
+    // of the AztecOO::Iterate
+    // function
+    switch (ierr)
+      {
+      case -1:
+        AssertThrow (false, ExcMessage("AztecOO::Iterate error code -1: "
+                                       "option not implemented"));
+      case -2:
+        AssertThrow (false, ExcMessage("AztecOO::Iterate error code -2: "
+                                       "numerical breakdown"));
+      case -3:
+        AssertThrow (false, ExcMessage("AztecOO::Iterate error code -3: "
+                                       "loss of precision"));
+      case -4:
+        AssertThrow (false, ExcMessage("AztecOO::Iterate error code -4: "
+                                       "GMRES hessenberg ill-conditioned"));
+      default:
+        AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
+      }
 
     // Finally, let the deal.II
     // SolverControl object know
index f79572e34360e4b780125f8ac0dcf17b98250b20..dddb391a86683dec5c13d7e9450fb091d6abd180 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 
@@ -32,6 +34,80 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace TrilinosWrappers
 {
+  namespace
+  {
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    // define a helper function that queries the size of an Epetra_Map object
+    // by calling either the 32- or 64-bit function necessary, and returns the
+    // result in the correct data type so that we can use it in calling other
+    // Epetra member functions that are overloaded by index type
+    int n_global_elements (const Epetra_BlockMap &map)
+    {
+      return map.NumGlobalElements();
+    }
+
+    int min_my_gid(const Epetra_BlockMap &map)
+    {
+      return map.MinMyGID();
+    }
+
+    int max_my_gid(const Epetra_BlockMap &map)
+    {
+      return map.MaxMyGID();
+    }
+
+    int n_global_cols(const Epetra_CrsGraph &graph)
+    {
+      return graph.NumGlobalCols();
+    }
+
+    int global_column_index(const Epetra_CrsMatrix &matrix, int i)
+    {
+      return matrix.GCID(i);
+    }
+
+    int global_row_index(const Epetra_CrsMatrix &matrix, int i)
+    {
+      return matrix.GRID(i);
+    }
+#else
+    // define a helper function that queries the size of an Epetra_Map object
+    // by calling either the 32- or 64-bit function necessary, and returns the
+    // result in the correct data type so that we can use it in calling other
+    // Epetra member functions that are overloaded by index type
+    long long int n_global_elements (const Epetra_BlockMap &map)
+    {
+      return map.NumGlobalElements64();
+    }
+
+    long long int min_my_gid(const Epetra_BlockMap &map)
+    {
+      return map.MinMyGID64();
+    }
+
+    long long int max_my_gid(const Epetra_BlockMap &map)
+    {
+      return map.MaxMyGID64();
+    }
+
+    long long int n_global_cols(const Epetra_CrsGraph &graph)
+    {
+      return graph.NumGlobalCols64();
+    }
+
+    long long int global_column_index(const Epetra_CrsMatrix &matrix, int i)
+    {
+      return matrix.GCID64(i);
+    }
+
+    long long int global_row_index(const Epetra_CrsMatrix &matrix, int i)
+    {
+      return matrix.GRID64(i);
+    }
+#endif
+  }
+
+
   namespace SparseMatrixIterators
   {
     void
@@ -55,11 +131,11 @@ namespace TrilinosWrappers
       // get a representation of the present
       // row
       int ncols;
-      int colnums = matrix->n();
+      TrilinosWrappers::types::int_type colnums = matrix->n();
       if (value_cache.get() == 0)
         {
           value_cache.reset (new std::vector<TrilinosScalar> (matrix->n()));
-          colnum_cache.reset (new std::vector<unsigned int> (matrix->n()));
+          colnum_cache.reset (new std::vector<size_type> (matrix->n()));
         }
       else
         {
@@ -68,10 +144,10 @@ namespace TrilinosWrappers
         }
 
       int ierr = matrix->trilinos_matrix().
-                 ExtractGlobalRowCopy((int)this->a_row,
+                 ExtractGlobalRowCopy((TrilinosWrappers::types::int_type)this->a_row,
                                       colnums,
                                       ncols, &((*value_cache)[0]),
-                                      reinterpret_cast<int *>(&((*colnum_cache)[0])));
+                                      reinterpret_cast<TrilinosWrappers::types::int_type *>(&((*colnum_cache)[0])));
       value_cache->resize (ncols);
       colnum_cache->resize (ncols);
       AssertThrow (ierr == 0, ExcTrilinosError(ierr));
@@ -112,11 +188,11 @@ namespace TrilinosWrappers
 
 
   SparseMatrix::SparseMatrix (const Epetra_Map  &input_map,
-                              const unsigned int n_max_entries_per_row)
+                              const size_type n_max_entries_per_row)
     :
     column_space_map (new Epetra_Map (input_map)),
     matrix (new Epetra_FECrsMatrix(Copy, *column_space_map,
-                                   int(n_max_entries_per_row), false)),
+                                   TrilinosWrappers::types::int_type(n_max_entries_per_row), false)),
     last_action (Zero),
     compressed (false)
   {}
@@ -139,11 +215,11 @@ namespace TrilinosWrappers
 
   SparseMatrix::SparseMatrix (const Epetra_Map  &input_row_map,
                               const Epetra_Map  &input_col_map,
-                              const unsigned int n_max_entries_per_row)
+                              const size_type n_max_entries_per_row)
     :
     column_space_map (new Epetra_Map (input_col_map)),
     matrix (new Epetra_FECrsMatrix(Copy, input_row_map,
-                                   int(n_max_entries_per_row), false)),
+                                   TrilinosWrappers::types::int_type(n_max_entries_per_row), false)),
     last_action (Zero),
     compressed (false)
   {}
@@ -164,11 +240,11 @@ namespace TrilinosWrappers
 
 
 
-  SparseMatrix::SparseMatrix (const unsigned int m,
-                              const unsigned int n,
+  SparseMatrix::SparseMatrix (const size_type m,
+                              const size_type n,
                               const unsigned int n_max_entries_per_row)
     :
-    column_space_map (new Epetra_Map (static_cast<int>(n), 0,
+    column_space_map (new Epetra_Map (static_cast<TrilinosWrappers::types::int_type>(n), 0,
                                       Utilities::Trilinos::comm_self())),
 
     // on one processor only, we know how the
@@ -180,7 +256,7 @@ namespace TrilinosWrappers
     // information from columns is only
     // available when entries have been added
     matrix (new Epetra_FECrsMatrix(Copy,
-                                   Epetra_Map (static_cast<int>(m), 0,
+                                   Epetra_Map (static_cast<TrilinosWrappers::types::int_type>(m), 0,
                                                Utilities::Trilinos::comm_self()),
                                    *column_space_map,
                                    n_max_entries_per_row,
@@ -191,14 +267,14 @@ namespace TrilinosWrappers
 
 
 
-  SparseMatrix::SparseMatrix (const unsigned int               m,
-                              const unsigned int               n,
+  SparseMatrix::SparseMatrix (const size_type                  m,
+                              const size_type                  n,
                               const std::vector<unsigned int> &n_entries_per_row)
     :
-    column_space_map (new Epetra_Map (static_cast<int>(n), 0,
+    column_space_map (new Epetra_Map (static_cast<TrilinosWrappers::types::int_type>(n), 0,
                                       Utilities::Trilinos::comm_self())),
     matrix (new Epetra_FECrsMatrix(Copy,
-                                   Epetra_Map (static_cast<int>(m), 0,
+                                   Epetra_Map (static_cast<TrilinosWrappers::types::int_type>(m), 0,
                                                Utilities::Trilinos::comm_self()),
                                    *column_space_map,
                                    (int *)const_cast<unsigned int *>(&(n_entries_per_row[0])),
@@ -211,7 +287,7 @@ namespace TrilinosWrappers
 
   SparseMatrix::SparseMatrix (const IndexSet     &parallel_partitioning,
                               const MPI_Comm     &communicator,
-                              const unsigned int n_max_entries_per_row)
+                              const unsigned int  n_max_entries_per_row)
     :
     column_space_map (new Epetra_Map(parallel_partitioning.
                                      make_trilinos_map(communicator, false))),
@@ -225,8 +301,8 @@ namespace TrilinosWrappers
 
 
 
-  SparseMatrix::SparseMatrix (const IndexSet     &parallel_partitioning,
-                              const MPI_Comm     &communicator,
+  SparseMatrix::SparseMatrix (const IndexSet                  &parallel_partitioning,
+                              const MPI_Comm                  &communicator,
                               const std::vector<unsigned int> &n_entries_per_row)
     :
     column_space_map (new Epetra_Map(parallel_partitioning.
@@ -241,10 +317,10 @@ namespace TrilinosWrappers
 
 
 
-  SparseMatrix::SparseMatrix (const IndexSet     &row_parallel_partitioning,
-                              const IndexSet     &col_parallel_partitioning,
-                              const MPI_Comm     &communicator,
-                              const unsigned int n_max_entries_per_row)
+  SparseMatrix::SparseMatrix (const IndexSet  &row_parallel_partitioning,
+                              const IndexSet  &col_parallel_partitioning,
+                              const MPI_Comm  &communicator,
+                              const size_type  n_max_entries_per_row)
     :
     column_space_map (new Epetra_Map(col_parallel_partitioning.
                                      make_trilinos_map(communicator, false))),
@@ -259,9 +335,9 @@ namespace TrilinosWrappers
 
 
 
-  SparseMatrix::SparseMatrix (const IndexSet     &row_parallel_partitioning,
-                              const IndexSet     &col_parallel_partitioning,
-                              const MPI_Comm     &communicator,
+  SparseMatrix::SparseMatrix (const IndexSet                  &row_parallel_partitioning,
+                              const IndexSet                  &col_parallel_partitioning,
+                              const MPI_Comm                  &communicator,
                               const std::vector<unsigned int> &n_entries_per_row)
     :
     column_space_map (new Epetra_Map(col_parallel_partitioning.
@@ -337,10 +413,10 @@ namespace TrilinosWrappers
   void
   SparseMatrix::reinit (const SparsityType &sparsity_pattern)
   {
-    const Epetra_Map rows (static_cast<int>(sparsity_pattern.n_rows()),
+    const Epetra_Map rows (static_cast<TrilinosWrappers::types::int_type>(sparsity_pattern.n_rows()),
                            0,
                            Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (static_cast<int>(sparsity_pattern.n_cols()),
+    const Epetra_Map columns (static_cast<TrilinosWrappers::types::int_type>(sparsity_pattern.n_cols()),
                               0,
                               Utilities::Trilinos::comm_self());
 
@@ -364,24 +440,24 @@ namespace TrilinosWrappers
   {
     namespace
     {
-    // distinguish between compressed sparsity types that define row_begin()
-    // and SparsityPattern that uses begin() as iterator type
+      // distinguish between compressed sparsity types that define row_begin()
+      // and SparsityPattern that uses begin() as iterator type
       template <typename Sparsity>
-      void copy_row (const Sparsity     &csp,
-                     const unsigned int  row,
-                     std::vector<int>   &row_indices)
+      void copy_row (const Sparsity        &csp,
+                     const size_type        row,
+                     std::vector<TrilinosWrappers::types::int_type> &row_indices)
       {
         typename Sparsity::row_iterator col_num = csp.row_begin (row);
-        for (unsigned int col=0; col_num != csp.row_end (row); ++col_num, ++col)
+        for (size_type col=0; col_num != csp.row_end (row); ++col_num, ++col)
           row_indices[col] = *col_num;
       }
 
       void copy_row (const dealii::SparsityPattern &csp,
-                     const unsigned int             row,
-                     std::vector<int>              &row_indices)
+                     const size_type                row,
+                     std::vector<TrilinosWrappers::types::int_type> &row_indices)
       {
         dealii::SparsityPattern::iterator col_num = csp.begin (row);
-        for (unsigned int col=0; col_num != csp.end (row); ++col_num, ++col)
+        for (size_type col=0; col_num != csp.end (row); ++col_num, ++col)
           row_indices[col] = col_num->column();
       }
     }
@@ -417,18 +493,18 @@ namespace TrilinosWrappers
     if (input_row_map.Comm().MyPID() == 0)
       {
         AssertDimension (sparsity_pattern.n_rows(),
-                         static_cast<unsigned int>(input_row_map.NumGlobalElements()));
+                         static_cast<size_type>(n_global_elements(input_row_map)));
         AssertDimension (sparsity_pattern.n_cols(),
-                         static_cast<unsigned int>(input_col_map.NumGlobalElements()));
+                         static_cast<size_type>(n_global_elements(input_col_map)));
       }
 
     column_space_map.reset (new Epetra_Map (input_col_map));
 
-    const unsigned int first_row = input_row_map.MinMyGID(),
-                       last_row = input_row_map.MaxMyGID()+1;
+    const size_type first_row = min_my_gid(input_row_map),
+                    last_row = max_my_gid(input_row_map)+1;
     std::vector<int> n_entries_per_row(last_row-first_row);
 
-    for (unsigned int row=first_row; row<last_row; ++row)
+    for (size_type row=first_row; row<last_row; ++row)
       n_entries_per_row[row-first_row] = sparsity_pattern.row_length(row);
 
     // The deal.II notation of a Sparsity pattern corresponds to the Epetra
@@ -457,9 +533,9 @@ namespace TrilinosWrappers
     // distributed.
 
     // now insert the indices
-    std::vector<int>   row_indices;
+    std::vector<TrilinosWrappers::types::int_type>   row_indices;
 
-    for (unsigned int row=first_row; row<last_row; ++row)
+    for (size_type row=first_row; row<last_row; ++row)
       {
         const int row_length = sparsity_pattern.row_length(row);
         if (row_length == 0)
@@ -472,13 +548,15 @@ namespace TrilinosWrappers
       }
 
     // Eventually, optimize the graph structure (sort indices, make memory
-    // contiguous, etc).
+    // contiguous, etc). note that the documentation of the function indeed
+    // states that we first need to provide the column (domain) map and then
+    // the row (range) map
     graph->FillComplete(input_col_map, input_row_map);
     graph->OptimizeStorage();
 
     // check whether we got the number of columns right.
-    AssertDimension (sparsity_pattern.n_cols(),
-                     static_cast<unsigned int>(graph->NumGlobalCols()));
+    AssertDimension (sparsity_pattern.n_cols(),static_cast<size_type>(
+                       n_global_cols(*graph)));
 
     // And now finally generate the matrix.
     matrix.reset (new Epetra_FECrsMatrix(Copy, *graph, false));
@@ -527,10 +605,10 @@ namespace TrilinosWrappers
                         const bool                            copy_values,
                         const ::dealii::SparsityPattern      *use_this_sparsity)
   {
-    const Epetra_Map rows (static_cast<int>(dealii_sparse_matrix.m()),
+    const Epetra_Map rows (static_cast<TrilinosWrappers::types::int_type>(dealii_sparse_matrix.m()),
                            0,
                            Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (static_cast<int>(dealii_sparse_matrix.n()),
+    const Epetra_Map columns (static_cast<TrilinosWrappers::types::int_type>(dealii_sparse_matrix.n()),
                               0,
                               Utilities::Trilinos::comm_self());
     reinit (rows, columns, dealii_sparse_matrix, drop_tolerance,
@@ -575,13 +653,16 @@ namespace TrilinosWrappers
         return;
       }
 
-    const unsigned int n_rows = dealii_sparse_matrix.m();
+    const size_type n_rows = dealii_sparse_matrix.m();
 
-    Assert (input_row_map.NumGlobalElements() == (int)n_rows,
-            ExcDimensionMismatch (input_row_map.NumGlobalElements(),
+    Assert (static_cast<size_type>(n_global_elements(input_row_map)) == n_rows,
+            ExcDimensionMismatch (n_global_elements(input_row_map),
+                                  n_rows));
+    Assert (n_global_elements(input_row_map) == (TrilinosWrappers::types::int_type)n_rows,
+            ExcDimensionMismatch (n_global_elements(input_row_map),
                                   n_rows));
-    Assert (input_col_map.NumGlobalElements() == (int)dealii_sparse_matrix.n(),
-            ExcDimensionMismatch (input_col_map.NumGlobalElements(),
+    Assert (n_global_elements(input_col_map) == (TrilinosWrappers::types::int_type)dealii_sparse_matrix.n(),
+            ExcDimensionMismatch (n_global_elements(input_col_map),
                                   dealii_sparse_matrix.n()));
 
     const ::dealii::SparsityPattern &sparsity_pattern =
@@ -602,19 +683,19 @@ namespace TrilinosWrappers
     // and the specified sparsity pattern might be different, need to go
     // through the row for both these sparsity structures simultaneously in
     // order to really set the correct values.
-    unsigned int maximum_row_length = matrix->MaxNumEntries();
-    std::vector<unsigned int> row_indices (maximum_row_length);
+    size_type maximum_row_length = matrix->MaxNumEntries();
+    std::vector<size_type> row_indices (maximum_row_length);
     std::vector<TrilinosScalar> values (maximum_row_length);
 
-    for (unsigned int row=0; row<n_rows; ++row)
+    for (size_type row=0; row<n_rows; ++row)
       // see if the row is locally stored on this processor
-      if (input_row_map.MyGID(static_cast<int>(row)) == true)
+      if (input_row_map.MyGID(static_cast<TrilinosWrappers::types::int_type>(row)) == true)
         {
           ::dealii::SparsityPattern::iterator select_index =
             sparsity_pattern.begin(row);
           typename ::dealii::SparseMatrix<number>::const_iterator it =
             dealii_sparse_matrix.begin(row);
-          unsigned int col = 0;
+          size_type col = 0;
           if (sparsity_pattern.n_rows() == sparsity_pattern.n_cols())
             {
               // optimized diagonal
@@ -648,7 +729,7 @@ namespace TrilinosWrappers
               ++select_index;
               ++it;
             }
-          set (row, col, reinterpret_cast<unsigned int *>(&row_indices[0]),
+          set (row, col, reinterpret_cast<size_type *>(&row_indices[0]),
                &values[0], false);
         }
 
@@ -679,7 +760,7 @@ namespace TrilinosWrappers
         // matrices and copy the content
         const TrilinosScalar *in_values = input_matrix[0];
         TrilinosScalar *values = (*matrix)[0];
-        const unsigned int my_nonzeros = input_matrix.NumMyNonzeros();
+        const size_type my_nonzeros = input_matrix.NumMyNonzeros();
         std::memcpy (&values[0], &in_values[0],
                      my_nonzeros*sizeof (TrilinosScalar));
       }
@@ -707,14 +788,15 @@ namespace TrilinosWrappers
 
 
   void
-  SparseMatrix::clear_row (const unsigned int   row,
+  SparseMatrix::clear_row (const size_type      row,
                            const TrilinosScalar new_diag_value)
   {
     Assert (matrix->Filled()==true, ExcMatrixNotCompressed());
 
     // Only do this on the rows owned
     // locally on this processor.
-    int local_row = matrix->LRID(static_cast<int>(row));
+    int local_row =
+      matrix->LRID(static_cast<TrilinosWrappers::types::int_type>(row));
     if (local_row >= 0)
       {
         TrilinosScalar *values;
@@ -726,11 +808,10 @@ namespace TrilinosWrappers
         Assert (ierr == 0,
                 ExcTrilinosError(ierr));
 
-        int *diag_find = std::find(col_indices,col_indices+num_entries,
-                                   local_row);
+        int *diag_find = std::find(col_indices,col_indices+num_entries,local_row);
         int diag_index = (int)(diag_find - col_indices);
 
-        for (int j=0; j<num_entries; ++j)
+        for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
           if (diag_index != j || new_diag_value == 0)
             values[j] = 0.;
 
@@ -743,11 +824,11 @@ namespace TrilinosWrappers
 
 
   void
-  SparseMatrix::clear_rows (const std::vector<unsigned int> &rows,
-                            const TrilinosScalar             new_diag_value)
+  SparseMatrix::clear_rows (const std::vector<size_type> &rows,
+                            const TrilinosScalar          new_diag_value)
   {
     compress();
-    for (unsigned int row=0; row<rows.size(); ++row)
+    for (size_type row=0; row<rows.size(); ++row)
       clear_row(rows[row], new_diag_value);
 
     // This function needs to be called
@@ -761,13 +842,13 @@ namespace TrilinosWrappers
 
 
   TrilinosScalar
-  SparseMatrix::operator() (const unsigned int i,
-                            const unsigned int j) const
+  SparseMatrix::operator() (const size_type i,
+                            const size_type j) const
   {
     // Extract local indices in
     // the matrix.
-    int trilinos_i = matrix->LRID(static_cast<int>(i)),
-        trilinos_j = matrix->LCID(static_cast<int>(j));
+    int trilinos_i = matrix->LRID(static_cast<TrilinosWrappers::types::int_type>(i)),
+        trilinos_j = matrix->LCID(static_cast<TrilinosWrappers::types::int_type>(j));
     TrilinosScalar value = 0.;
 
     // If the data is not on the
@@ -798,6 +879,7 @@ namespace TrilinosWrappers
         // Generate the view and make
         // sure that we have not generated
         // an error.
+        // TODO Check that col_indices are int and not long long
         int ierr = matrix->ExtractMyRowView(trilinos_i, nnz_extracted,
                                             values, col_indices);
         Assert (ierr==0, ExcTrilinosError(ierr));
@@ -809,8 +891,7 @@ namespace TrilinosWrappers
         // look for the value, and then
         // finally get it.
 
-        int *el_find = std::find(col_indices, col_indices + nnz_present,
-                                 trilinos_j);
+        int *el_find = std::find(col_indices, col_indices + nnz_present, trilinos_j);
 
         int local_col_index = (int)(el_find - col_indices);
 
@@ -836,12 +917,13 @@ namespace TrilinosWrappers
 
 
   TrilinosScalar
-  SparseMatrix::el (const unsigned int i,
-                    const unsigned int j) const
+  SparseMatrix::el (const size_type i,
+                    const size_type j) const
   {
     // Extract local indices in
     // the matrix.
-    int trilinos_i = matrix->LRID(static_cast<int>(i)), trilinos_j = matrix->LCID(static_cast<int>(j));
+    int trilinos_i = matrix->LRID(static_cast<TrilinosWrappers::types::int_type>(i)),
+        trilinos_j = matrix->LCID(static_cast<TrilinosWrappers::types::int_type>(j));
     TrilinosScalar value = 0.;
 
     // If the data is not on the
@@ -880,8 +962,7 @@ namespace TrilinosWrappers
         // Search the index where we
         // look for the value, and then
         // finally get it.
-        int *el_find = std::find(col_indices, col_indices + nnz_present,
-                                 trilinos_j);
+        int *el_find = std::find(col_indices, col_indices + nnz_present, trilinos_j);
 
         int local_col_index = (int)(el_find - col_indices);
 
@@ -905,7 +986,7 @@ namespace TrilinosWrappers
 
 
   TrilinosScalar
-  SparseMatrix::diag_element (const unsigned int i) const
+  SparseMatrix::diag_element (const size_type i) const
   {
     Assert (m() == n(), ExcNotQuadratic());
 
@@ -926,14 +1007,14 @@ namespace TrilinosWrappers
 
 
   unsigned int
-  SparseMatrix::row_length (const unsigned int row) const
+  SparseMatrix::row_length (const size_type row) const
   {
     Assert (row < m(), ExcInternalError());
 
     // get a representation of the
     // present row
     int ncols = -1;
-    int local_row = matrix->LRID(static_cast<int>(row));
+    int local_row = matrix->LRID(static_cast<TrilinosWrappers::types::int_type>(row));
 
     // on the processor who owns this
     // row, we'll have a non-negative
@@ -951,6 +1032,8 @@ namespace TrilinosWrappers
 
   namespace internals
   {
+    typedef dealii::types::global_dof_index size_type;
+
     void perform_mmult (const SparseMatrix &inputleft,
                         const SparseMatrix &inputright,
                         SparseMatrix       &result,
@@ -1007,7 +1090,7 @@ namespace TrilinosWrappers
               mod_B->ExtractMyRowView (i, N_entries, new_data);
               inputright.trilinos_matrix().ExtractMyRowView (i, N_entries, B_data);
               double value = V.trilinos_vector()[0][i];
-              for (int j=0; j<N_entries; ++j)
+              for (TrilinosWrappers::types::int_type j=0; j<N_entries; ++j)
                 new_data[j] = value * B_data[j];
             }
         }
@@ -1046,10 +1129,17 @@ namespace TrilinosWrappers
               inputleft.trilinos_sparsity_pattern().ExtractMyRowView(i, num_entries,
                                                                      indices);
               Assert (num_entries >= 0, ExcInternalError());
-              const unsigned int GID = inputleft.row_partitioner().GID(i);
-              for (int j=0; j<num_entries; ++j)
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+              const size_type GID = inputleft.row_partitioner().GID(i);
+              for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
                 sparsity_transposed.add (inputleft.col_partitioner().GID(indices[j]),
                                          GID);
+#else
+              const size_type GID = inputleft.row_partitioner().GID64(i);
+              for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
+                sparsity_transposed.add (inputleft.col_partitioner().GID64(indices[j]),
+                                         GID);
+#endif
             }
 
           sparsity_transposed.compress();
@@ -1061,10 +1151,17 @@ namespace TrilinosWrappers
               inputleft.trilinos_matrix().ExtractMyRowView(i, num_entries,
                                                            values, indices);
               Assert (num_entries >= 0, ExcInternalError());
-              const unsigned int GID = inputleft.row_partitioner().GID(i);
-              for (int j=0; j<num_entries; ++j)
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+              const size_type GID = inputleft.row_partitioner().GID(i);
+              for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
                 transposed_mat.set (inputleft.col_partitioner().GID(indices[j]),
                                     GID, values[j]);
+#else
+              const size_type GID = inputleft.row_partitioner().GID64(i);
+              for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
+                transposed_mat.set (inputleft.col_partitioner().GID64(indices[j]),
+                                    GID, values[j]);
+#endif
             }
           transposed_mat.compress();
           ML_Operator_WrapEpetraCrsMatrix
@@ -1084,11 +1181,11 @@ namespace TrilinosWrappers
       ML_Operator *Btmp, *Ctmp, *Ctmp2, *tptr;
       ML_CommInfoOP *getrow_comm;
       int max_per_proc;
-      int N_input_vector = B_->invec_leng;
+      TrilinosWrappers::types::int_type N_input_vector = B_->invec_leng;
       getrow_comm = B_->getrow->pre_comm;
       if ( getrow_comm != NULL)
-        for (int i = 0; i < getrow_comm->N_neighbors; i++)
-          for (int j = 0; j < getrow_comm->neighbors[i].N_send; j++)
+        for (TrilinosWrappers::types::int_type i = 0; i < getrow_comm->N_neighbors; i++)
+          for (TrilinosWrappers::types::int_type j = 0; j < getrow_comm->neighbors[i].N_send; j++)
             AssertThrow (getrow_comm->neighbors[i].send_list[j] < N_input_vector,
                          ExcInternalError());
 
@@ -1179,7 +1276,7 @@ namespace TrilinosWrappers
     Assert (rhs.m() == m(), ExcDimensionMismatch (rhs.m(), m()));
     Assert (rhs.n() == n(), ExcDimensionMismatch (rhs.n(), n()));
 
-    const std::pair<unsigned int, unsigned int>
+    const std::pair<size_type, size_type>
     local_range = rhs.local_range();
 
     int ierr;
@@ -1199,7 +1296,7 @@ namespace TrilinosWrappers
         rhs.matrix->Filled() == true &&
         this->local_range() == local_range &&
         matrix->NumMyNonzeros() == rhs.matrix->NumMyNonzeros())
-      for (unsigned int row=local_range.first;
+      for (size_type row=local_range.first;
            row < local_range.second; ++row)
         {
           Assert (matrix->NumGlobalEntries(row) ==
@@ -1207,7 +1304,8 @@ namespace TrilinosWrappers
                   ExcDimensionMismatch(matrix->NumGlobalEntries(row),
                                        rhs.matrix->NumGlobalEntries(row)));
 
-          const int row_local = matrix->RowMap().LID(static_cast<int>(row));
+          const TrilinosWrappers::types::int_type row_local =
+            matrix->RowMap().LID(static_cast<TrilinosWrappers::types::int_type>(row));
           int n_entries, rhs_n_entries;
           TrilinosScalar *value_ptr, *rhs_value_ptr;
 
@@ -1236,7 +1334,7 @@ namespace TrilinosWrappers
           AssertThrow (n_entries == rhs_n_entries,
                        ExcDimensionMismatch (n_entries, rhs_n_entries));
 
-          for (int i=0; i<n_entries; ++i)
+          for (TrilinosWrappers::types::int_type i=0; i<n_entries; ++i)
             {
               *value_ptr++ += *rhs_value_ptr++ * factor;
 #ifdef DEBUG
@@ -1254,22 +1352,22 @@ namespace TrilinosWrappers
     // respective add() function.
     else
       {
-        unsigned int max_row_length = 0;
-        for (unsigned int row=local_range.first;
+        int max_row_length = 0;
+        for (size_type row=local_range.first;
              row < local_range.second; ++row)
           max_row_length
-            = std::max (max_row_length,
-                        static_cast<unsigned int>(rhs.matrix->NumGlobalEntries(row)));
+            = std::max (max_row_length,rhs.matrix->NumGlobalEntries(row));
 
-        std::vector<int>            column_indices (max_row_length);
         std::vector<TrilinosScalar> values (max_row_length);
 
         if (matrix->Filled() == true && rhs.matrix->Filled() == true &&
             this->local_range() == local_range)
-          for (unsigned int row=local_range.first;
+          for (size_type row=local_range.first;
                row < local_range.second; ++row)
             {
-              const int row_local = matrix->RowMap().LID(static_cast<int>(row));
+              std::vector<int> column_indices (max_row_length);
+              const int row_local =
+                matrix->RowMap().LID(static_cast<TrilinosWrappers::types::int_type>(row));
               int n_entries;
 
               ierr = rhs.matrix->ExtractMyRowCopy (row_local, max_row_length,
@@ -1278,7 +1376,7 @@ namespace TrilinosWrappers
                                                    &column_indices[0]);
               Assert (ierr == 0, ExcTrilinosError(ierr));
 
-              for (int i=0; i<n_entries; ++i)
+              for (TrilinosWrappers::types::int_type i=0; i<n_entries; ++i)
                 values[i] *= factor;
 
               TrilinosScalar *value_ptr = &values[0];
@@ -1289,19 +1387,25 @@ namespace TrilinosWrappers
             }
         else
           {
-            for (unsigned int row=local_range.first;
+            //TODO check that is normal that column_indices in the if is an
+            //int while the column_indices in the else is a
+            //TrilinosWrappers::types::int_type
+            std::vector<TrilinosWrappers::types::int_type> column_indices (max_row_length);
+            for (size_type row=local_range.first;
                  row < local_range.second; ++row)
               {
                 int n_entries;
                 ierr = rhs.matrix->Epetra_CrsMatrix::ExtractGlobalRowCopy
-                       ((int)row, max_row_length, n_entries, &values[0], &column_indices[0]);
+                       ((TrilinosWrappers::types::int_type)row, max_row_length,
+                        n_entries, &values[0], &column_indices[0]);
                 Assert (ierr == 0, ExcTrilinosError(ierr));
 
-                for (int i=0; i<n_entries; ++i)
+                for (TrilinosWrappers::types::int_type i=0; i<n_entries; ++i)
                   values[i] *= factor;
 
                 ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues
-                       ((int)row, n_entries, &values[0], &column_indices[0]);
+                       ((TrilinosWrappers::types::int_type)row, n_entries,
+                        &values[0], &column_indices[0]);
                 Assert (ierr == 0, ExcTrilinosError(ierr));
               }
             compress ();
@@ -1362,8 +1466,9 @@ namespace TrilinosWrappers
         for (int i=0; i<matrix->NumMyRows(); ++i)
           {
             matrix->ExtractMyRowView (i, num_entries, values, indices);
-            for (int j=0; j<num_entries; ++j)
-              out << "(" << matrix->GRID(i) << "," << matrix->GCID(indices[j]) << ") "
+            for (TrilinosWrappers::types::int_type j=0; j<num_entries; ++j)
+              out << "(" << global_row_index(*matrix,i) << ","
+                  << global_column_index(*matrix,indices[j]) << ") "
                   << values[j] << std::endl;
           }
       }
@@ -1373,14 +1478,13 @@ namespace TrilinosWrappers
 
 
 
-  std::size_t
+  SparseMatrix::size_type
   SparseMatrix::memory_consumption () const
   {
-    unsigned int static_memory = sizeof(this) + sizeof (*matrix)
-                                 + sizeof(*matrix->Graph().DataPtr());
-    return ((sizeof(TrilinosScalar)+sizeof(int))*matrix->NumMyNonzeros() +
-            sizeof(int)*local_size() +
-            static_memory);
+    size_type static_memory = sizeof(this) + sizeof (*matrix)
+                              + sizeof(*matrix->Graph().DataPtr());
+    return ((sizeof(TrilinosScalar)+sizeof(TrilinosWrappers::types::int_type))*
+            matrix->NumMyNonzeros() + sizeof(int)*local_size() + static_memory);
   }
 }
 
index 32fc182ad8e5469681f7f5b7de0bdc31c8e64767..c145556104893545e3c76bf7e63a94087ab9a51b 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2013 by the deal.II authors
+// Copyright (C) 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (S : REAL_SCALARS)
index f1d858b8d231fc6426014a08ecf143ba5479e3b6..92d0789b741383b8678f617d46c39232b38737e2 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/trilinos_sparsity_pattern.h>
 
@@ -26,6 +28,85 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace TrilinosWrappers
 {
+  namespace
+  {
+    // define a helper function that queries the size of an Epetra_Map object
+    // by calling either the 32- or 64-bit function necessary, and returns the
+    // result in the correct data type so that we can use it in calling other
+    // Epetra member functions that are overloaded by index type
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    int n_global_elements (const Epetra_BlockMap &map)
+    {
+      return map.NumGlobalElements();
+    }
+
+    int min_my_gid(const Epetra_BlockMap &map)
+    {
+      return map.MinMyGID();
+    }
+
+    int max_my_gid(const Epetra_BlockMap &map)
+    {
+      return map.MaxMyGID();
+    }
+
+    int n_global_rows(const Epetra_CrsGraph &graph)
+    {
+      return graph.NumGlobalRows();
+    }
+
+    int n_global_cols(const Epetra_CrsGraph &graph)
+    {
+      return graph.NumGlobalCols();
+    }
+
+    int n_global_entries(const Epetra_CrsGraph &graph)
+    {
+      return graph.NumGlobalEntries();
+    }
+
+    int global_row_index(const Epetra_CrsGraph &graph, int i)
+    {
+      return graph.GRID(i);
+    }
+#else
+    long long int n_global_elements (const Epetra_BlockMap &map)
+    {
+      return map.NumGlobalElements64();
+    }
+
+    long long int min_my_gid(const Epetra_BlockMap &map)
+    {
+      return map.MinMyGID64();
+    }
+
+    long long int max_my_gid(const Epetra_BlockMap &map)
+    {
+      return map.MaxMyGID64();
+    }
+
+    long long int n_global_rows(const Epetra_CrsGraph &graph)
+    {
+      return graph.NumGlobalRows64();
+    }
+
+    long long int n_global_cols(const Epetra_CrsGraph &graph)
+    {
+      return graph.NumGlobalCols64();
+    }
+
+    long long int n_global_entries(const Epetra_CrsGraph &graph)
+    {
+      return graph.NumGlobalEntries64();
+    }
+
+    long long int global_row_index(const Epetra_CrsGraph &graph, int i)
+    {
+      return graph.GRID64(i);
+    }
+#endif
+  }
+
   namespace SparsityPatternIterators
   {
     void
@@ -49,13 +130,14 @@ namespace TrilinosWrappers
       // get a representation of the present
       // row
       int ncols;
+      // TODO: casting a size_type to an int, could be a problem
       int colnums = sparsity_pattern->n_cols();
 
       int ierr;
-      ierr = sparsity_pattern->graph->ExtractGlobalRowCopy((int)this->a_row,
+      ierr = sparsity_pattern->graph->ExtractGlobalRowCopy((TrilinosWrappers::types::int_type)this->a_row,
                                                            colnums,
                                                            ncols,
-                                                           (int *)&(*colnum_cache)[0]);
+                                                           (TrilinosWrappers::types::int_type *)&(*colnum_cache)[0]);
       AssertThrow (ierr == 0, ExcTrilinosError(ierr));
 
       // copy it into our caches if the
@@ -65,8 +147,8 @@ namespace TrilinosWrappers
       // iterator for an empty line (what
       // would it point to?)
       Assert (ncols != 0, ExcInternalError());
-      colnum_cache.reset (new std::vector<unsigned int> (colnums,
-                                                         colnums+ncols));
+      colnum_cache.reset (new std::vector<size_type> (colnums,
+                                                      colnums+ncols));
     }
   }
 
@@ -86,22 +168,27 @@ namespace TrilinosWrappers
     :
     compressed (true)
   {
-    column_space_map.reset(new Epetra_Map (0, 0, Utilities::Trilinos::comm_self()));
-    graph.reset (new Epetra_FECrsGraph(View, *column_space_map, *column_space_map, 0));
+    column_space_map.reset(new Epetra_Map (TrilinosWrappers::types::int_type(0),
+                                           TrilinosWrappers::types::int_type(0),
+                                           Utilities::Trilinos::comm_self()));
+    graph.reset (new Epetra_FECrsGraph(View,
+                                       *column_space_map,
+                                       *column_space_map,
+                                       0));
     graph->FillComplete();
   }
 
 
   SparsityPattern::SparsityPattern (const Epetra_Map  &input_map,
-                                    const unsigned int n_entries_per_row)
+                                    const size_type n_entries_per_row)
   {
     reinit (input_map, input_map, n_entries_per_row);
   }
 
 
 
-  SparsityPattern::SparsityPattern (const Epetra_Map                &input_map,
-                                    const std::vector<unsigned int> &n_entries_per_row)
+  SparsityPattern::SparsityPattern (const Epetra_Map             &input_map,
+                                    const std::vector<size_type> &n_entries_per_row)
   {
     reinit (input_map, input_map, n_entries_per_row);
   }
@@ -110,7 +197,7 @@ namespace TrilinosWrappers
 
   SparsityPattern::SparsityPattern (const Epetra_Map  &input_row_map,
                                     const Epetra_Map  &input_col_map,
-                                    const unsigned int n_entries_per_row)
+                                    const size_type n_entries_per_row)
   {
     reinit (input_row_map, input_col_map, n_entries_per_row);
   }
@@ -119,25 +206,25 @@ namespace TrilinosWrappers
 
   SparsityPattern::SparsityPattern (const Epetra_Map                &input_row_map,
                                     const Epetra_Map                &input_col_map,
-                                    const std::vector<unsigned int> &n_entries_per_row)
+                                    const std::vector<size_type> &n_entries_per_row)
   {
     reinit (input_row_map, input_col_map, n_entries_per_row);
   }
 
 
 
-  SparsityPattern::SparsityPattern (const unsigned int m,
-                                    const unsigned int n,
-                                    const unsigned int n_entries_per_row)
+  SparsityPattern::SparsityPattern (const size_type m,
+                                    const size_type n,
+                                    const size_type n_entries_per_row)
   {
     reinit (m, n, n_entries_per_row);
   }
 
 
 
-  SparsityPattern::SparsityPattern (const unsigned int               m,
-                                    const unsigned int               n,
-                                    const std::vector<unsigned int> &n_entries_per_row)
+  SparsityPattern::SparsityPattern (const size_type               m,
+                                    const size_type               n,
+                                    const std::vector<size_type> &n_entries_per_row)
   {
     reinit (m, n, n_entries_per_row);
   }
@@ -148,10 +235,14 @@ namespace TrilinosWrappers
   SparsityPattern::SparsityPattern (const SparsityPattern &input_sparsity)
     :
     Subscriptor(),
-    column_space_map (new Epetra_Map(0, 0, Utilities::Trilinos::comm_self())),
+    column_space_map (new Epetra_Map(TrilinosWrappers::types::int_type(0),
+                                     TrilinosWrappers::types::int_type(0),
+                                     Utilities::Trilinos::comm_self())),
     compressed (false),
-    graph (new Epetra_FECrsGraph(View, *column_space_map,
-                                 *column_space_map, 0))
+    graph (new Epetra_FECrsGraph(View,
+                                 *column_space_map,
+                                 *column_space_map,
+                                 0))
   {
     Assert (input_sparsity.n_rows() == 0,
             ExcMessage ("Copy constructor only works for empty sparsity patterns."));
@@ -165,29 +256,31 @@ namespace TrilinosWrappers
 
 
   void
-  SparsityPattern::reinit (const Epetra_Map   &input_map,
-                           const unsigned int  n_entries_per_row)
+  SparsityPattern::reinit (const Epetra_Map  &input_map,
+                           const size_type    n_entries_per_row)
   {
     reinit (input_map, input_map, n_entries_per_row);
   }
 
 
   void
-  SparsityPattern::reinit (const unsigned int  m,
-                           const unsigned int  n,
-                           const unsigned int  n_entries_per_row)
+  SparsityPattern::reinit (const size_type  m,
+                           const size_type  n,
+                           const size_type  n_entries_per_row)
   {
-    const Epetra_Map rows (static_cast<int>(m), 0, Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (static_cast<int>(n), 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map rows (TrilinosWrappers::types::int_type(m), 0,
+                           Utilities::Trilinos::comm_self());
+    const Epetra_Map columns (TrilinosWrappers::types::int_type(n), 0,
+                              Utilities::Trilinos::comm_self());
 
     reinit (rows, columns, n_entries_per_row);
   }
 
 
   void
-  SparsityPattern::reinit (const Epetra_Map   &input_row_map,
-                           const Epetra_Map   &input_col_map,
-                           const unsigned int  n_entries_per_row)
+  SparsityPattern::reinit (const Epetra_Map  &input_row_map,
+                           const Epetra_Map  &input_col_map,
+                           const size_type    n_entries_per_row)
   {
     graph.reset ();
     column_space_map.reset (new Epetra_Map (input_col_map));
@@ -215,7 +308,7 @@ namespace TrilinosWrappers
 
   void
   SparsityPattern::reinit (const Epetra_Map   &input_map,
-                           const std::vector<unsigned int> &n_entries_per_row)
+                           const std::vector<size_type> &n_entries_per_row)
   {
     reinit (input_map, input_map, n_entries_per_row);
   }
@@ -223,12 +316,14 @@ namespace TrilinosWrappers
 
 
   void
-  SparsityPattern::reinit (const unsigned int  m,
-                           const unsigned int  n,
-                           const std::vector<unsigned int> &n_entries_per_row)
+  SparsityPattern::reinit (const size_type  m,
+                           const size_type  n,
+                           const std::vector<size_type> &n_entries_per_row)
   {
-    const Epetra_Map rows (static_cast<int>(m), 0, Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (static_cast<int>(n), 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map rows (TrilinosWrappers::types::int_type(m), 0,
+                           Utilities::Trilinos::comm_self());
+    const Epetra_Map columns (TrilinosWrappers::types::int_type(n), 0,
+                              Utilities::Trilinos::comm_self());
 
     reinit (rows, columns, n_entries_per_row);
   }
@@ -238,23 +333,23 @@ namespace TrilinosWrappers
   void
   SparsityPattern::reinit (const Epetra_Map   &input_row_map,
                            const Epetra_Map   &input_col_map,
-                           const std::vector<unsigned int> &n_entries_per_row)
+                           const std::vector<size_type> &n_entries_per_row)
   {
     // release memory before reallocation
     graph.reset ();
     AssertDimension (n_entries_per_row.size(),
-                     static_cast<unsigned int>(input_row_map.NumGlobalElements()));
+                     static_cast<size_type>(n_global_elements(input_row_map)));
 
     column_space_map.reset (new Epetra_Map (input_col_map));
     compressed = false;
 
     if (input_row_map.Comm().NumProc() > 1)
       graph.reset(new Epetra_FECrsGraph(Copy, input_row_map,
-                                        n_entries_per_row[input_row_map.MinMyGID()],
+                                        n_entries_per_row[min_my_gid(input_row_map)],
                                         false));
     else
       graph.reset(new Epetra_FECrsGraph(Copy, input_row_map, input_col_map,
-                                        n_entries_per_row[input_row_map.MinMyGID()],
+                                        n_entries_per_row[max_my_gid(input_row_map)],
                                         false));
   }
 
@@ -275,24 +370,25 @@ namespace TrilinosWrappers
   {
     namespace
     {
-    // distinguish between compressed sparsity types that define row_begin()
-    // and SparsityPattern that uses begin() as iterator type
+      typedef dealii::types::global_dof_index size_type;
+      // distinguish between compressed sparsity types that define row_begin()
+      // and SparsityPattern that uses begin() as iterator type
       template <typename Sparsity>
       void copy_row (const Sparsity     &csp,
-                     const unsigned int  row,
-                     std::vector<int>   &row_indices)
+                     const size_type     row,
+                     std::vector<TrilinosWrappers::types::int_type>   &row_indices)
       {
         typename Sparsity::row_iterator col_num = csp.row_begin (row);
-        for (unsigned int col=0; col_num != csp.row_end (row); ++col_num, ++col)
+        for (size_type col=0; col_num != csp.row_end (row); ++col_num, ++col)
           row_indices[col] = *col_num;
       }
 
       void copy_row (const dealii::SparsityPattern &csp,
-                     const unsigned int             row,
-                     std::vector<int>              &row_indices)
+                     const size_type                row,
+                     std::vector<TrilinosWrappers::types::int_type>          &row_indices)
       {
         dealii::SparsityPattern::iterator col_num = csp.begin (row);
-        for (unsigned int col=0; col_num != csp.end (row); ++col_num, ++col)
+        for (size_type col=0; col_num != csp.end (row); ++col_num, ++col)
           row_indices[col] = col_num->column();
       }
     }
@@ -310,9 +406,9 @@ namespace TrilinosWrappers
     graph.reset ();
 
     AssertDimension (sp.n_rows(),
-                     static_cast<unsigned int>(input_row_map.NumGlobalElements()));
+                     static_cast<size_type>(n_global_elements(input_row_map)));
     AssertDimension (sp.n_cols(),
-                     static_cast<unsigned int>(input_col_map.NumGlobalElements()));
+                     static_cast<size_type>(n_global_elements(input_col_map)));
 
     column_space_map.reset (new Epetra_Map (input_col_map));
     compressed = false;
@@ -320,12 +416,14 @@ namespace TrilinosWrappers
     Assert (input_row_map.LinearMap() == true,
             ExcMessage ("This function is not efficient if the map is not contiguous."));
 
-    const unsigned int first_row = input_row_map.MinMyGID(),
-                       last_row = input_row_map.MaxMyGID()+1;
+    const size_type first_row = min_my_gid(input_row_map),
+                    last_row = max_my_gid(input_row_map)+1;
     std::vector<int> n_entries_per_row(last_row - first_row);
 
-    for (unsigned int row=first_row; row<last_row; ++row)
-      n_entries_per_row[row-first_row] = sp.row_length(row);
+    // Trilinos wants the row length as an int
+    // this is hopefully never going to be a problem.
+    for (size_type row=first_row; row<last_row; ++row)
+      n_entries_per_row[row-first_row] = static_cast<int>(sp.row_length(row));
 
     if (input_row_map.Comm().NumProc() > 1)
       graph.reset(new Epetra_FECrsGraph(Copy, input_row_map,
@@ -337,17 +435,17 @@ namespace TrilinosWrappers
                                          false));
 
     AssertDimension (sp.n_rows(),
-                     static_cast<unsigned int>(graph->NumGlobalRows()));
+                     static_cast<size_type>(n_global_rows(*graph)));
 
-    std::vector<int> row_indices;
+    std::vector<TrilinosWrappers::types::int_type> row_indices;
 
     // Include possibility to exchange data
     // since CompressedSimpleSparsityPattern is
     // able to do so
     if (exchange_data==false)
-      for (unsigned int row=first_row; row<last_row; ++row)
+      for (size_type row=first_row; row<last_row; ++row)
         {
-          const int row_length = sp.row_length(row);
+          const TrilinosWrappers::types::int_type row_length = sp.row_length(row);
           if (row_length == 0)
             continue;
 
@@ -357,15 +455,16 @@ namespace TrilinosWrappers
                                                        &row_indices[0]);
         }
     else
-      for (unsigned int row=0; row<sp.n_rows(); ++row)
+      for (size_type row=0; row<sp.n_rows(); ++row)
         {
-          const int row_length = sp.row_length(row);
+          const TrilinosWrappers::types::int_type row_length = sp.row_length(row);
           if (row_length == 0)
             continue;
 
           row_indices.resize (row_length, -1);
           internal::copy_row(sp, row, row_indices);
-          graph->InsertGlobalIndices (1, reinterpret_cast<int *>(&row),
+          graph->InsertGlobalIndices (1,
+                                      reinterpret_cast<TrilinosWrappers::types::int_type *>(&row),
                                       row_length, &row_indices[0]);
         }
 
@@ -387,8 +486,10 @@ namespace TrilinosWrappers
   void
   SparsityPattern::copy_from (const SparsityType &sp)
   {
-    const Epetra_Map rows (static_cast<int>(sp.n_rows()), 0, Utilities::Trilinos::comm_self());
-    const Epetra_Map columns (static_cast<int>(sp.n_cols()), 0, Utilities::Trilinos::comm_self());
+    const Epetra_Map rows (TrilinosWrappers::types::int_type(sp.n_rows()), 0,
+                           Utilities::Trilinos::comm_self());
+    const Epetra_Map columns (TrilinosWrappers::types::int_type(sp.n_cols()), 0,
+                              Utilities::Trilinos::comm_self());
 
     reinit (rows, columns, sp);
   }
@@ -401,7 +502,9 @@ namespace TrilinosWrappers
     // When we clear the matrix, reset
     // the pointer and generate an
     // empty sparsity pattern.
-    column_space_map.reset (new Epetra_Map (0, 0, Utilities::Trilinos::comm_self()));
+    column_space_map.reset (new Epetra_Map (TrilinosWrappers::types::int_type(0),
+                                            TrilinosWrappers::types::int_type(0),
+                                            Utilities::Trilinos::comm_self()));
     graph.reset (new Epetra_FECrsGraph(View, *column_space_map,
                                        *column_space_map, 0));
     graph->FillComplete();
@@ -431,12 +534,13 @@ namespace TrilinosWrappers
 
 
   bool
-  SparsityPattern::exists (const unsigned int i,
-                           const unsigned int j) const
+  SparsityPattern::exists (const size_type i,
+                           const size_type j) const
   {
     // Extract local indices in
     // the matrix.
-    int trilinos_i = graph->LRID(static_cast<int>(i)), trilinos_j = graph->LCID(static_cast<int>(j));
+    int trilinos_i = graph->LRID(static_cast<TrilinosWrappers::types::int_type>(i)),
+        trilinos_j = graph->LCID(static_cast<TrilinosWrappers::types::int_type>(j));
 
     // If the data is not on the
     // present processor, we throw
@@ -457,22 +561,27 @@ namespace TrilinosWrappers
           {
             int nnz_present = graph->NumGlobalIndices(i);
             int nnz_extracted;
-            int *col_indices;
+            TrilinosWrappers::types::int_type *col_indices;
 
             // Generate the view and make
             // sure that we have not generated
             // an error.
-            int ierr = graph->ExtractGlobalRowView(trilinos_i, nnz_extracted,
-                                                   col_indices);
+            // TODO: trilinos_i is the local row index -> it is an int but
+            // ExtractGlobalRowView requires trilinos_i to be the global row
+            // index and thus it should be a long long int
+            int ierr = graph->ExtractGlobalRowView(
+                         static_cast<TrilinosWrappers::types::int_type>(trilinos_i),
+                         nnz_extracted, col_indices);
             Assert (ierr==0, ExcTrilinosError(ierr));
             Assert (nnz_present == nnz_extracted,
                     ExcDimensionMismatch(nnz_present, nnz_extracted));
 
             // Search the index
-            int *el_find = std::find(col_indices, col_indices + nnz_present,
-                                     trilinos_j);
+            TrilinosWrappers::types::int_type *el_find =
+              std::find(col_indices, col_indices + nnz_present, trilinos_j);
 
-            int local_col_index = (int)(el_find - col_indices);
+            TrilinosWrappers::types::int_type local_col_index =
+              (TrilinosWrappers::types::int_type)(el_find - col_indices);
 
             if (local_col_index == nnz_present)
               return false;
@@ -481,15 +590,16 @@ namespace TrilinosWrappers
           {
             // Prepare pointers for extraction
             // of a view of the row.
-            int nnz_present = graph->NumGlobalIndices(i);
+            int nnz_present = graph->NumGlobalIndices(
+                                static_cast<TrilinosWrappers::types::int_type>(i));
             int nnz_extracted;
             int *col_indices;
 
             // Generate the view and make
             // sure that we have not generated
             // an error.
-            int ierr = graph->ExtractMyRowView(trilinos_i, nnz_extracted,
-                                               col_indices);
+            int ierr = graph->ExtractMyRowView(trilinos_i,
+                                               nnz_extracted, col_indices);
             Assert (ierr==0, ExcTrilinosError(ierr));
 
             Assert (nnz_present == nnz_extracted,
@@ -497,7 +607,7 @@ namespace TrilinosWrappers
 
             // Search the index
             int *el_find = std::find(col_indices, col_indices + nnz_present,
-                                     trilinos_j);
+                                     static_cast<int>(trilinos_j));
 
             int local_col_index = (int)(el_find - col_indices);
 
@@ -511,45 +621,45 @@ namespace TrilinosWrappers
 
 
 
-  unsigned int
+  SparsityPattern::size_type
   SparsityPattern::bandwidth () const
   {
-    unsigned int local_b=0;
-    int global_b=0;
-    for (unsigned int i=0; i<local_size(); ++i)
+    size_type local_b=0;
+    TrilinosWrappers::types::int_type global_b=0;
+    for (int i=0; i<(int)local_size(); ++i)
       {
         int *indices;
         int num_entries;
         graph->ExtractMyRowView(i, num_entries, indices);
         for (unsigned int j=0; j<(unsigned int)num_entries; ++j)
           {
-            if (static_cast<unsigned int>(std::abs(static_cast<int>(i-indices[j]))) > local_b)
-              local_b = std::abs(static_cast<signed int>(i-indices[j]));
+            if (static_cast<size_type>(std::abs(static_cast<TrilinosWrappers::types::int_type>(i-indices[j]))) > local_b)
+              local_b = std::abs(static_cast<TrilinosWrappers::types::int_type>(i-indices[j]));
           }
       }
-    graph->Comm().MaxAll((int *)&local_b, &global_b, 1);
-    return static_cast<unsigned int>(global_b);
+    graph->Comm().MaxAll((TrilinosWrappers::types::int_type *)&local_b, &global_b, 1);
+    return static_cast<size_type>(global_b);
   }
 
 
 
-  unsigned int
+  SparsityPattern::size_type
   SparsityPattern::n_rows () const
   {
-    const int n_rows = graph -> NumGlobalRows();
+    const TrilinosWrappers::types::int_type n_rows = n_global_rows(*graph);
     return n_rows;
   }
 
 
 
-  unsigned int
+  SparsityPattern::size_type
   SparsityPattern::n_cols () const
   {
-    int n_cols;
+    TrilinosWrappers::types::int_type n_cols;
     if (graph->Filled() == true)
-      n_cols = graph -> NumGlobalCols();
+      n_cols = n_global_cols(*graph);
     else
-      n_cols = column_space_map->NumGlobalElements();
+      n_cols = n_global_elements(*column_space_map);
 
     return n_cols;
   }
@@ -566,24 +676,24 @@ namespace TrilinosWrappers
 
 
 
-  std::pair<unsigned int, unsigned int>
+  std::pair<SparsityPattern::size_type, SparsityPattern::size_type>
   SparsityPattern::local_range () const
   {
-    unsigned int begin, end;
-    begin = graph -> RowMap().MinMyGID();
-    end = graph -> RowMap().MaxMyGID()+1;
+    size_type begin, end;
+    begin =  min_my_gid(graph->RowMap());
+    end = max_my_gid(graph->RowMap())+1;
 
     return std::make_pair (begin, end);
   }
 
 
 
-  unsigned int
+  SparsityPattern::size_type
   SparsityPattern::n_nonzero_elements () const
   {
-    int nnz = graph->NumGlobalEntries();
+    TrilinosWrappers::types::int_type nnz = n_global_entries(*graph);
 
-    return static_cast<unsigned int>(nnz);
+    return static_cast<size_type>(nnz);
   }
 
 
@@ -598,15 +708,16 @@ namespace TrilinosWrappers
 
 
 
-  unsigned int
-  SparsityPattern::row_length (const unsigned int row) const
+  SparsityPattern::size_type
+  SparsityPattern::row_length (const size_type row) const
   {
     Assert (row < n_rows(), ExcInternalError());
 
     // get a representation of the
     // present row
-    int ncols = -1;
-    int local_row = graph->LRID(static_cast<int>(row));
+    TrilinosWrappers::types::int_type ncols = -1;
+    TrilinosWrappers::types::int_type local_row =
+      graph->LRID(static_cast<TrilinosWrappers::types::int_type>(row));
 
     // on the processor who owns this
     // row, we'll have a non-negative
@@ -614,7 +725,7 @@ namespace TrilinosWrappers
     if (local_row >= 0)
       ncols = graph->NumMyIndices (local_row);
 
-    return static_cast<unsigned int>(ncols);
+    return static_cast<size_type>(ncols);
   }
 
 
@@ -645,7 +756,7 @@ namespace TrilinosWrappers
           {
             graph->ExtractMyRowView (i, num_entries, indices);
             for (int j=0; j<num_entries; ++j)
-              out << "(" << i << "," << indices[graph->GRID(j)] << ") "
+              out << "(" << i << "," << indices[global_row_index(*graph,j)] << ") "
                   << std::endl;
           }
       }
@@ -661,7 +772,7 @@ namespace TrilinosWrappers
     Assert (graph->Filled() == true, ExcInternalError());
     for (unsigned int row=0; row<local_size(); ++row)
       {
-        signed int *indices;
+        int *indices;
         int num_entries;
         graph->ExtractMyRowView (row, num_entries, indices);
 
@@ -671,8 +782,8 @@ namespace TrilinosWrappers
           // j horizontal, gnuplot output is
           // x-y, that is we have to exchange
           // the order of output
-          out << indices[graph->GRID(static_cast<int>(j))] << " " << -static_cast<signed int>(row)
-              << std::endl;
+          out << indices[global_row_index(*graph,static_cast<int>(j))]
+              << " " << -static_cast<signed int>(row) << std::endl;
       }
 
     AssertThrow (out, ExcIO());
index badd19f289fa200a215dafbaf079543502c1f7da..a8b026528742bb80f75cbf29cdcaaeb0c01a5fd5 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/trilinos_vector.h>
 
@@ -28,6 +30,61 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace TrilinosWrappers
 {
+  namespace
+  {
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    // define a helper function that queries the size of an Epetra_BlockMap object
+    // by calling either the 32- or 64-bit function necessary, and returns the
+    // result in the correct data type so that we can use it in calling other
+    // Epetra member functions that are overloaded by index type
+    int n_global_elements (const Epetra_BlockMap &map)
+    {
+      return map.NumGlobalElements();
+    }
+    // define a helper function that queries the pointer to internal array
+    // containing list of global IDs assigned to the calling processor
+    // by calling either the 32- or 64-bit function necessary, and returns the
+    // result in the correct data type so that we can use it in calling other
+    // Epetra member functions that are overloaded by index type
+    int *my_global_elements(const Epetra_BlockMap &map)
+    {
+      return map.MyGlobalElements();
+    }
+    // define a helper function that queries the global vector length of an
+    // Epetra_FEVector object  by calling either the 32- or 64-bit
+    // function necessary.
+    int global_length(const Epetra_FEVector &vector)
+    {
+      return vector.GlobalLength();
+    }
+#else
+    // define a helper function that queries the size of an Epetra_BlockMap object
+    // by calling either the 32- or 64-bit function necessary, and returns the
+    // result in the correct data type so that we can use it in calling other
+    // Epetra member functions that are overloaded by index type
+    long long int n_global_elements (const Epetra_BlockMap &map)
+    {
+      return map.NumGlobalElements64();
+    }
+    // define a helper function that queries the pointer to internal array
+    // containing list of global IDs assigned to the calling processor
+    // by calling either the 32- or 64-bit function necessary, and returns the
+    // result in the correct data type so that we can use it in calling other
+    // Epetra member functions that are overloaded by index type
+    long long int *my_global_elements(const Epetra_BlockMap &map)
+    {
+      return map.MyGlobalElements64();
+    }
+    // define a helper function that queries the global vector length of an
+    // Epetra_FEVector object  by calling either the 32- or 64-bit
+    // function necessary.
+    long long int global_length(const Epetra_FEVector &vector)
+    {
+      return vector.GlobalLength64();
+    }
+#endif
+  }
+
   namespace MPI
   {
 
@@ -71,9 +128,9 @@ namespace TrilinosWrappers
       :
       VectorBase()
     {
-      AssertThrow (input_map.NumGlobalElements() == v.vector->Map().NumGlobalElements(),
-                   ExcDimensionMismatch (input_map.NumGlobalElements(),
-                                         v.vector->Map().NumGlobalElements()));
+      AssertThrow (n_global_elements(input_map) == n_global_elements(v.vector->Map()),
+                   ExcDimensionMismatch (n_global_elements(input_map),
+                                         n_global_elements(v.vector->Map())));
 
       last_action = Zero;
 
@@ -94,9 +151,10 @@ namespace TrilinosWrappers
       :
       VectorBase()
     {
-      AssertThrow ((int)parallel_partitioner.size() == v.vector->Map().NumGlobalElements(),
+      AssertThrow (parallel_partitioner.size() ==
+                   static_cast<size_type>(n_global_elements(v.vector->Map())),
                    ExcDimensionMismatch (parallel_partitioner.size(),
-                                         v.vector->Map().NumGlobalElements()));
+                                         n_global_elements(v.vector->Map())));
 
       last_action = Zero;
 
@@ -106,6 +164,17 @@ namespace TrilinosWrappers
       reinit (v, false, true);
     }
 
+    Vector::Vector (const IndexSet &local,
+                    const IndexSet &ghost,
+                    const MPI_Comm &communicator)
+      :
+      VectorBase()
+    {
+      IndexSet parallel_partitioning = local;
+      parallel_partitioning.add_indices(ghost);
+      reinit(parallel_partitioning, communicator);
+    }
+
 
 
     Vector::~Vector ()
@@ -228,14 +297,15 @@ namespace TrilinosWrappers
       // create a vector that holds all the elements
       // contained in the block vector. need to
       // manually create an Epetra_Map.
-      unsigned int n_elements = 0, added_elements = 0, block_offset = 0;
-      for (unsigned int block=0; block<v.n_blocks(); ++block)
+      size_type n_elements = 0, added_elements = 0, block_offset = 0;
+      for (size_type block=0; block<v.n_blocks(); ++block)
         n_elements += v.block(block).local_size();
-      std::vector<int> global_ids (n_elements, -1);
-      for (unsigned int block=0; block<v.n_blocks(); ++block)
+      std::vector<TrilinosWrappers::types::int_type> global_ids (n_elements, -1);
+      for (size_type block=0; block<v.n_blocks(); ++block)
         {
-          int *glob_elements = v.block(block).vector_partitioner().MyGlobalElements();
-          for (unsigned int i=0; i<v.block(block).local_size(); ++i)
+          TrilinosWrappers::types::int_type *glob_elements =
+            my_global_elements(v.block(block).vector_partitioner());
+          for (size_type i=0; i<v.block(block).local_size(); ++i)
             global_ids[added_elements++] = glob_elements[i] + block_offset;
           block_offset += v.block(block).size();
         }
@@ -255,7 +325,7 @@ namespace TrilinosWrappers
 
       TrilinosScalar *entries = (*actual_vec)[0];
       block_offset = 0;
-      for (unsigned int block=0; block<v.n_blocks(); ++block)
+      for (size_type block=0; block<v.n_blocks(); ++block)
         {
           v.block(block).trilinos_vector().ExtractCopy (entries, 0);
           entries += v.block(block).local_size();
@@ -263,9 +333,9 @@ namespace TrilinosWrappers
 
       if (import_data == true)
         {
-          AssertThrow (static_cast<unsigned int>(actual_vec->GlobalLength())
+          AssertThrow (static_cast<size_type>(global_length(*actual_vec))
                        == v.size(),
-                       ExcDimensionMismatch (actual_vec->GlobalLength(),
+                       ExcDimensionMismatch (global_length(*actual_vec),
                                              v.size()));
 
           Epetra_Import data_exchange (vector->Map(), actual_vec->Map());
@@ -279,6 +349,13 @@ namespace TrilinosWrappers
     }
 
 
+    void Vector::reinit(const IndexSet &local, const IndexSet &ghost, const MPI_Comm &communicator)
+    {
+      IndexSet parallel_partitioning = local;
+      parallel_partitioning.add_indices(ghost);
+      reinit(parallel_partitioning, communicator);
+    }
+
 
     Vector &
     Vector::operator = (const Vector &v)
@@ -373,10 +450,10 @@ namespace TrilinosWrappers
 
 
 
-  Vector::Vector (const unsigned int n)
+  Vector::Vector (const size_type n)
   {
     last_action = Zero;
-    Epetra_LocalMap map ((int)n, 0, Utilities::Trilinos::comm_self());
+    Epetra_LocalMap map ((TrilinosWrappers::types::int_type)n, 0, Utilities::Trilinos::comm_self());
     vector.reset (new Epetra_FEVector (map));
   }
 
@@ -385,7 +462,7 @@ namespace TrilinosWrappers
   Vector::Vector (const Epetra_Map &input_map)
   {
     last_action = Zero;
-    Epetra_LocalMap map (input_map.NumGlobalElements(),
+    Epetra_LocalMap map (n_global_elements(input_map),
                          input_map.IndexBase(),
                          input_map.Comm());
     vector.reset (new Epetra_FEVector(map));
@@ -397,7 +474,7 @@ namespace TrilinosWrappers
                   const MPI_Comm &communicator)
   {
     last_action = Zero;
-    Epetra_LocalMap map (static_cast<int>(partitioning.size()),
+    Epetra_LocalMap map (static_cast<TrilinosWrappers::types::int_type>(partitioning.size()),
                          0,
 #ifdef DEAL_II_WITH_MPI
                          Epetra_MpiComm(communicator));
@@ -413,7 +490,7 @@ namespace TrilinosWrappers
   Vector::Vector (const VectorBase &v)
   {
     last_action = Zero;
-    Epetra_LocalMap map (v.vector->Map().NumGlobalElements(),
+    Epetra_LocalMap map (n_global_elements(v.vector->Map()),
                          v.vector->Map().IndexBase(),
                          v.vector->Map().Comm());
     vector.reset (new Epetra_FEVector(map));
@@ -431,12 +508,12 @@ namespace TrilinosWrappers
 
 
   void
-  Vector::reinit (const unsigned int n,
-                  const bool         fast)
+  Vector::reinit (const size_type n,
+                  const bool      fast)
   {
     if (size() != n)
       {
-        Epetra_LocalMap map ((int)n, 0,
+        Epetra_LocalMap map ((TrilinosWrappers::types::int_type)n, 0,
                              Utilities::Trilinos::comm_self());
         vector.reset (new Epetra_FEVector (map));
       }
@@ -459,9 +536,9 @@ namespace TrilinosWrappers
   Vector::reinit (const Epetra_Map &input_map,
                   const bool        fast)
   {
-    if (vector->Map().NumGlobalElements() != input_map.NumGlobalElements())
+    if (n_global_elements(vector->Map()) != n_global_elements(input_map))
       {
-        Epetra_LocalMap map (input_map.NumGlobalElements(),
+        Epetra_LocalMap map (n_global_elements(input_map),
                              input_map.IndexBase(),
                              input_map.Comm());
         vector.reset (new Epetra_FEVector (map));
@@ -486,10 +563,10 @@ namespace TrilinosWrappers
                   const MPI_Comm &communicator,
                   const bool      fast)
   {
-    if (vector->Map().NumGlobalElements() !=
-        static_cast<int>(partitioning.size()))
+    if (n_global_elements(vector->Map()) !=
+        static_cast<TrilinosWrappers::types::int_type>(partitioning.size()))
       {
-        Epetra_LocalMap map (static_cast<int>(partitioning.size()),
+        Epetra_LocalMap map (static_cast<TrilinosWrappers::types::int_type>(partitioning.size()),
                              0,
 #ifdef DEAL_II_WITH_MPI
                              Epetra_MpiComm(communicator));
@@ -530,7 +607,7 @@ namespace TrilinosWrappers
       {
         if (local_range() != v.local_range())
           {
-            Epetra_LocalMap map (v.vector->GlobalLength(),
+            Epetra_LocalMap map (global_length(*(v.vector)),
                                  v.vector->Map().IndexBase(),
                                  v.vector->Comm());
             vector.reset (new Epetra_FEVector(map));
@@ -585,7 +662,7 @@ namespace TrilinosWrappers
   {
     if (size() != v.size())
       {
-        Epetra_LocalMap map (v.vector->Map().NumGlobalElements(),
+        Epetra_LocalMap map (n_global_elements(v.vector->Map()),
                              v.vector->Map().IndexBase(),
                              v.vector->Comm());
         vector.reset (new Epetra_FEVector(map));
@@ -602,7 +679,7 @@ namespace TrilinosWrappers
   {
     if (size() != v.size())
       {
-        Epetra_LocalMap map (v.vector->Map().NumGlobalElements(),
+        Epetra_LocalMap map (n_global_elements(v.vector->Map()),
                              v.vector->Map().IndexBase(),
                              v.vector->Comm());
         vector.reset (new Epetra_FEVector(map));
index 9f52cb200f4e51a733cdf97e09f0c27e26a75662..a04d816612af0f0fa549b30d1a36cf7664d98b04 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/lac/trilinos_vector_base.h>
@@ -25,6 +27,27 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace TrilinosWrappers
 {
+  namespace
+  {
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
+    // define a helper function that queries the global vector length of an
+    // Epetra_FEVector object  by calling either the 32- or 64-bit
+    // function necessary.
+    int global_length(const Epetra_FEVector &vector)
+    {
+      return vector.GlobalLength();
+    }
+#else
+    // define a helper function that queries the global vector length of an
+    // Epetra_FEVector object  by calling either the 32- or 64-bit
+    // function necessary.
+    long long int global_length(const Epetra_FEVector &vector)
+    {
+      return vector.GlobalLength64();
+    }
+#endif
+  }
+
   namespace internal
   {
     VectorReference::operator TrilinosScalar () const
@@ -40,7 +63,8 @@ namespace TrilinosWrappers
       // we can use []. Note that we
       // can only get local values.
 
-      const int local_index = vector.vector->Map().LID(static_cast<int>(index));
+      const TrilinosWrappers::types::int_type local_index =
+        vector.vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(index));
       Assert (local_index >= 0,
               ExcAccessToNonLocalElement (index,
                                           vector.vector->Map().MinMyGID(),
@@ -152,9 +176,9 @@ namespace TrilinosWrappers
     //
     // let's hope this isn't a
     // particularly frequent operation
-    std::pair<unsigned int, unsigned int>
+    std::pair<size_type, size_type>
     local_range = this->local_range ();
-    for (unsigned int i=local_range.first; i<local_range.second; ++i)
+    for (size_type i=local_range.first; i<local_range.second; ++i)
       (*vector)[0][i-local_range.first] = v(i);
 
     return *this;
@@ -163,11 +187,12 @@ namespace TrilinosWrappers
 
 
   TrilinosScalar
-  VectorBase::el (const unsigned int index) const
+  VectorBase::el (const size_type index) const
   {
     // Extract local indices in
     // the vector.
-    int trilinos_i = vector->Map().LID(static_cast<int>(index));
+    TrilinosWrappers::types::int_type trilinos_i =
+      vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(index));
     TrilinosScalar value = 0.;
 
     // If the element is not
@@ -191,11 +216,12 @@ namespace TrilinosWrappers
 
 
   TrilinosScalar
-  VectorBase::operator () (const unsigned int index) const
+  VectorBase::operator () (const size_type index) const
   {
     // Extract local indices in
     // the vector.
-    int trilinos_i = vector->Map().LID(static_cast<int>(index));
+    TrilinosWrappers::types::int_type trilinos_i =
+      vector->Map().LID(static_cast<TrilinosWrappers::types::int_type>(index));
     TrilinosScalar value = 0.;
 
     // If the element is not present
@@ -246,7 +272,7 @@ namespace TrilinosWrappers
     if (local_size() != v.local_size())
       return false;
 
-    unsigned int i;
+    size_type i;
     for (i=0; i<local_size(); i++)
       if ((*(v.vector))[0][i]!=(*vector)[0][i]) return false;
 
@@ -347,9 +373,9 @@ namespace TrilinosWrappers
   void
   VectorBase::print (const char *format) const
   {
-    Assert (vector->GlobalLength()!=0, ExcEmptyObject());
+    Assert (global_length(*vector)!=0, ExcEmptyObject());
 
-    for (unsigned int j=0; j<size(); ++j)
+    for (size_type j=0; j<size(); ++j)
       {
         double t = (*vector)[0][j];
 
@@ -389,10 +415,10 @@ namespace TrilinosWrappers
       out.setf (std::ios::fixed, std::ios::floatfield);
 
     if (across)
-      for (unsigned int i=0; i<size(); ++i)
+      for (size_type i=0; i<size(); ++i)
         out << static_cast<double>(val[i]) << ' ';
     else
-      for (unsigned int i=0; i<size(); ++i)
+      for (size_type i=0; i<size(); ++i)
         out << static_cast<double>(val[i]) << std::endl;
     out << std::endl;
 
@@ -422,7 +448,8 @@ namespace TrilinosWrappers
     //one index and the value per local
     //entry.
     return sizeof(*this)
-           + this->local_size()*( sizeof(double)+sizeof(int) );
+           + this->local_size()*( sizeof(double)+
+                                  sizeof(TrilinosWrappers::types::int_type) );
   }
 
 } /* end of namespace TrilinosWrappers */
index 976e0bd070730c20d83abfc45c7a0e665e3c6e57..9c4d495f919e36c9530e4c012eef3c2c4eb07fd2 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2008 by the deal.II authors
+// Copyright (C) 2008 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (SCALAR : REAL_SCALARS)
index 57fcef309c71cc01a4d1c18f2a65e408356b0a07..63d5aecdf00ca1393c9ddb8a7bc5fd8cb0edfc79 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/vector.templates.h>
 
index 73bdab2d7793bd9f3c8b795414b0cc135feccc64..ac8514b5225429205f085fa53f70c4d394ead266 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (SCALAR : REAL_SCALARS)
index 2e138a26440389b84adb79969151ffcb020eb247..ecc97a6b0d024edaa56950e4ab56d7bc13b704b1 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/vector_memory.h>
 #include <deal.II/lac/vector.h>
@@ -53,13 +55,10 @@ GrowingVectorMemory<VECTOR>::Pool::~Pool()
   // vectors. Actually, there should
   // be none, if there is no memory
   // leak
-  unsigned int n=0;
   for (typename std::vector<entry_type>::iterator i=data->begin();
        i != data->end();
        ++i)
     {
-      if (i->first == true)
-        ++n;
       delete i->second;
     }
   delete data;
@@ -69,7 +68,7 @@ GrowingVectorMemory<VECTOR>::Pool::~Pool()
 template <typename VECTOR>
 inline
 void
-GrowingVectorMemory<VECTOR>::Pool::initialize(const unsigned int size)
+GrowingVectorMemory<VECTOR>::Pool::initialize(const size_type size)
 {
   if (data == 0)
     {
@@ -88,7 +87,7 @@ GrowingVectorMemory<VECTOR>::Pool::initialize(const unsigned int size)
 
 template <typename VECTOR>
 inline
-GrowingVectorMemory<VECTOR>::GrowingVectorMemory (const unsigned int initial_size,
+GrowingVectorMemory<VECTOR>::GrowingVectorMemory (const size_type initial_size,
                                                   const bool log_statistics)
 
   :
index 39228c1fddbd4d51270e8e6297e1e18461f81f75..32f15b0e4c8aa48b74ddcf4474bfba14bc8d15f7 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (VECTOR : SERIAL_VECTORS)
index 4850d5eaf2d2f0ea5e86c12945910cbc9bab6e99..f00d31abd67237294b70d83ff1e2214777291310 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/vector_view.h>
 
index 7971632165127db939ffe4655dfb5e091d2740bf..8475af26dbc0c1278d94d2559fc6545e1dec6746 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (SCALAR : REAL_SCALARS)
index 57fc6dfe6605becaca55f83707cd0dfd2a123878..ee5c8bc58ad203a89a83f6e2c5f28bf02080560c 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
 ## Copyright (C) 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index 0d12293cc61e77de240d5c8a72e4ba0103fba867..265b93c542c21c6b975922b9af1a9125b8260454 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2011 by the deal.II authors
+// Copyright (C) 2011 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/matrix_free/matrix_free.templates.h>
 #include <deal.II/base/utilities.h>
index 3c2dee08e82fe1155afc82d8583757cac90bb9d2..2b8d9aac8cad7dd4a6816a623ac3a5438dedc7e1 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index e33ac0ef500320fdb175776b6934db8c983935e0..f58b0fcf63bede579df94c4e3a52322ff7b6a924 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
 ## Copyright (C) 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index 211a7e576464c94490060ea4cef5e06280be36cd..f2bbd879f598fe71b4b010039c7247351ab3212a 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2006 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/meshworker/local_results.h>
 #include <deal.II/meshworker/local_integrator.h>
@@ -61,10 +66,46 @@ namespace MeshWorker
   {}
 
 
+  template <int dim, int spacedim, typename number>
+  LocalIntegrator<dim, spacedim, number>::LocalIntegrator (bool c, bool b, bool f)
+    :
+    use_cell(c), use_boundary(b), use_face(f)
+  {}
+
+
   template <int dim, int spacedim, typename number>
   LocalIntegrator<dim, spacedim, number>::~LocalIntegrator ()
   {}
 
+  template <int dim, int spacedim, typename number>
+  void
+  LocalIntegrator<dim, spacedim, number>::cell (DoFInfo<dim, spacedim, number> &,
+                                                IntegrationInfo<dim, spacedim> &) const
+  {
+    Assert(false, ExcPureFunction());
+  }
+
+
+  template <int dim, int spacedim, typename number>
+  void
+  LocalIntegrator<dim, spacedim, number>::boundary (DoFInfo<dim, spacedim, number> &,
+                                                    IntegrationInfo<dim, spacedim> &) const
+  {
+    Assert(false, ExcPureFunction());
+  }
+
+
+  template <int dim, int spacedim, typename number>
+  void
+  LocalIntegrator<dim, spacedim, number>::face (DoFInfo<dim, spacedim, number> &,
+                                                DoFInfo<dim, spacedim, number> &,
+                                                IntegrationInfo<dim, spacedim> &,
+                                                IntegrationInfo<dim, spacedim> &) const
+  {
+    Assert(false, ExcPureFunction());
+  }
+
+
   template class LocalIntegrator<1,1,float>;
   template class LocalIntegrator<1,1,double>;
   template class LocalIntegrator<1,2,float>;
index a02e9a572ca7398f8cc352352079912dd9a38990..8ad40c5205589807ebb9a2bb91a147fae0c94d77 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/block_vector.h>
index d0225173a27aad1130b5e111a6d1e92173226e5a..f23c25e24fcbc9b7652b979a04afe46efaf12d1e 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index df72c651ac9550a90887adb70636f4916ce35857..36d58a446a9fbd58ba609444433024b7a77fb797 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/block_vector.h>
index 3b545d35eb0b98b299e74bcb151ce56f06563755..797b59f8ea60001c1f280c4e8bd29e7b23e9d006 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 27c0307d6f8075b7f29aa7c8539d9a3a2c0fdfb5..40c223f30d56ce4eaef401ea02063dc4c212cb25 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012, 2013 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index fe5435bac46cdba55237625fba269ff888b45d32..424e043082f5790fb848a8095f4e1d5898871e3d 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2010, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/block_vector.h>
index 6697887ffd050d4ce0384ba36c2eee50c9202c4f..7446bc6e32b7f7f950985980e059167ec6805818 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id: vector_tools.inst.in 26105 2012-08-23 22:10:05Z heister $
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS)
 {
index 0d0e84c53aee4022a652aa6d9b814d7ebaaa8a1e..ca6c9c08311c9c58756559c09dc89dd0fc549de9 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/lac/sparse_matrix.h>
index 8ae02f0e919577f5c90de2e06f77634517cec630..52779b60d5659ee23fc53f5ec5af919081740141 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 49660106cee0f838f0e316720a11d17b35064fd3..5d74887ef2a4c59b5e23a441cc068dee291a3883 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/multithread_info.h>
 #include <deal.II/base/logstream.h>
@@ -130,8 +132,8 @@ namespace MGTools
 
     const typename DoFHandler<dim,spacedim>::cell_iterator end = dofs.end(level);
     typename DoFHandler<dim,spacedim>::active_cell_iterator cell;
-    std::vector<unsigned int> cell_indices;
-    std::vector<unsigned int> neighbor_indices;
+    std::vector<types::global_dof_index> cell_indices;
+    std::vector<types::global_dof_index> neighbor_indices;
 
     // We loop over cells and go from
     // cells to lower dimensional
@@ -304,8 +306,8 @@ namespace MGTools
 
     const typename DoFHandler<dim,spacedim>::cell_iterator end = dofs.end(level);
     typename DoFHandler<dim,spacedim>::active_cell_iterator cell;
-    std::vector<unsigned int> cell_indices;
-    std::vector<unsigned int> neighbor_indices;
+    std::vector<types::global_dof_index> cell_indices;
+    std::vector<types::global_dof_index> neighbor_indices;
 
     // We have to translate the
     // couplings from components to
@@ -542,7 +544,7 @@ namespace MGTools
     SparsityPattern         &sparsity,
     const unsigned int       level)
   {
-    const unsigned int n_dofs = dof.n_dofs(level);
+    const types::global_dof_index n_dofs = dof.n_dofs(level);
 
     Assert (sparsity.n_rows() == n_dofs,
             ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
@@ -550,7 +552,7 @@ namespace MGTools
             ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
 
     const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
-    std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
+    std::vector<types::global_dof_index> dofs_on_this_cell(dofs_per_cell);
     typename DH::cell_iterator cell = dof.begin(level),
                                endc = dof.end(level);
     for (; cell!=endc; ++cell)
@@ -575,7 +577,7 @@ namespace MGTools
     SparsityPattern       &sparsity,
     const unsigned int level)
   {
-    const unsigned int n_dofs = dof.n_dofs(level);
+    const types::global_dof_index n_dofs = dof.n_dofs(level);
 
     Assert (sparsity.n_rows() == n_dofs,
             ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
@@ -583,12 +585,14 @@ namespace MGTools
             ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
 
     const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
-    std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
-    std::vector<unsigned int> dofs_on_other_cell(dofs_per_cell);
+    std::vector<types::global_dof_index> dofs_on_this_cell(dofs_per_cell);
+    std::vector<types::global_dof_index> dofs_on_other_cell(dofs_per_cell);
     typename DoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
                                                      endc = dof.end(level);
     for (; cell!=endc; ++cell)
       {
+        if (!cell->is_locally_owned_on_level()) continue;
+
         cell->get_mg_dof_indices (dofs_on_this_cell);
         // make sparsity pattern for this cell
         for (unsigned int i=0; i<dofs_per_cell; ++i)
@@ -632,11 +636,11 @@ namespace MGTools
     SparsityPattern       &sparsity,
     const unsigned int level)
   {
-    Assert ((level>=1) && (level<dof.get_tria().n_levels()),
-            ExcIndexRange(level, 1, dof.get_tria().n_levels()));
+    Assert ((level>=1) && (level<dof.get_tria().n_global_levels()),
+            ExcIndexRange(level, 1, dof.get_tria().n_global_levels()));
 
-    const unsigned int fine_dofs = dof.n_dofs(level);
-    const unsigned int coarse_dofs = dof.n_dofs(level-1);
+    const types::global_dof_index fine_dofs = dof.n_dofs(level);
+    const types::global_dof_index coarse_dofs = dof.n_dofs(level-1);
 
     // Matrix maps from fine level to coarse level
 
@@ -646,12 +650,14 @@ namespace MGTools
             ExcDimensionMismatch (sparsity.n_cols(), fine_dofs));
 
     const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
-    std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
-    std::vector<unsigned int> dofs_on_other_cell(dofs_per_cell);
+    std::vector<types::global_dof_index> dofs_on_this_cell(dofs_per_cell);
+    std::vector<types::global_dof_index> dofs_on_other_cell(dofs_per_cell);
     typename DoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
                                                      endc = dof.end(level);
     for (; cell!=endc; ++cell)
       {
+        if (!cell->is_locally_owned_on_level()) continue;
+
         cell->get_mg_dof_indices (dofs_on_this_cell);
         // Loop over all interior neighbors
         for (unsigned int face = 0;
@@ -694,7 +700,7 @@ namespace MGTools
     const Table<2,DoFTools::Coupling> &flux_mask)
   {
     const FiniteElement<dim> &fe = dof.get_fe();
-    const unsigned int n_dofs = dof.n_dofs(level);
+    const types::global_dof_index n_dofs = dof.n_dofs(level);
     const unsigned int n_comp = fe.n_components();
 
     Assert (sparsity.n_rows() == n_dofs,
@@ -711,8 +717,8 @@ namespace MGTools
             ExcDimensionMismatch (flux_mask.n_cols(), n_comp));
 
     const unsigned int total_dofs = fe.dofs_per_cell;
-    std::vector<unsigned int> dofs_on_this_cell(total_dofs);
-    std::vector<unsigned int> dofs_on_other_cell(total_dofs);
+    std::vector<types::global_dof_index> dofs_on_this_cell(total_dofs);
+    std::vector<types::global_dof_index> dofs_on_other_cell(total_dofs);
     Table<2,bool> support_on_face(total_dofs, GeometryInfo<dim>::faces_per_cell);
 
     typename DoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
@@ -740,6 +746,8 @@ namespace MGTools
 
     for (; cell!=endc; ++cell)
       {
+        if (!cell->is_locally_owned_on_level()) continue;
+
         cell->get_mg_dof_indices (dofs_on_this_cell);
         // make sparsity pattern for this cell
         for (unsigned int i=0; i<total_dofs; ++i)
@@ -872,11 +880,11 @@ namespace MGTools
     const FiniteElement<dim> &fe = dof.get_fe();
     const unsigned int n_comp = fe.n_components();
 
-    Assert ((level>=1) && (level<dof.get_tria().n_levels()),
-            ExcIndexRange(level, 1, dof.get_tria().n_levels()));
+    Assert ((level>=1) && (level<dof.get_tria().n_global_levels()),
+            ExcIndexRange(level, 1, dof.get_tria().n_global_levels()));
 
-    const unsigned int fine_dofs = dof.n_dofs(level);
-    const unsigned int coarse_dofs = dof.n_dofs(level-1);
+    const types::global_dof_index fine_dofs = dof.n_dofs(level);
+    const types::global_dof_index coarse_dofs = dof.n_dofs(level-1);
 
     // Matrix maps from fine level to coarse level
 
@@ -890,8 +898,8 @@ namespace MGTools
             ExcDimensionMismatch (flux_mask.n_cols(), n_comp));
 
     const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
-    std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
-    std::vector<unsigned int> dofs_on_other_cell(dofs_per_cell);
+    std::vector<types::global_dof_index> dofs_on_this_cell(dofs_per_cell);
+    std::vector<types::global_dof_index> dofs_on_other_cell(dofs_per_cell);
     Table<2,bool> support_on_face(dofs_per_cell, GeometryInfo<dim>::faces_per_cell);
 
     typename DoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
@@ -906,6 +914,8 @@ namespace MGTools
 
     for (; cell!=endc; ++cell)
       {
+        if (!cell->is_locally_owned_on_level()) continue;
+
         cell->get_mg_dof_indices (dofs_on_this_cell);
         // Loop over all interior neighbors
         for (unsigned int face = 0;
@@ -944,13 +954,13 @@ namespace MGTools
   template <int dim, int spacedim>
   void
   count_dofs_per_component (const DoFHandler<dim,spacedim> &dof_handler,
-                            std::vector<std::vector<unsigned int> > &result,
+                            std::vector<std::vector<types::global_dof_index> > &result,
                             bool                              only_once,
                             std::vector<unsigned int>         target_component)
   {
     const FiniteElement<dim> &fe = dof_handler.get_fe();
     const unsigned int n_components = fe.n_components();
-    const unsigned int nlevels = dof_handler.get_tria().n_levels();
+    const unsigned int nlevels = dof_handler.get_tria().n_global_levels();
 
     Assert (result.size() == nlevels,
             ExcDimensionMismatch(result.size(), nlevels));
@@ -1046,7 +1056,7 @@ namespace MGTools
   template <int dim, int spacedim>
   void
   count_dofs_per_component (const DoFHandler<dim,spacedim>        &dof_handler,
-                            std::vector<std::vector<unsigned int> > &result,
+                            std::vector<std::vector<types::global_dof_index> > &result,
                             std::vector<unsigned int>            target_component)
   {
     count_dofs_per_component (dof_handler, result,
@@ -1059,12 +1069,12 @@ namespace MGTools
   void
   count_dofs_per_block (
     const DH     &dof_handler,
-    std::vector<std::vector<unsigned int> > &dofs_per_block,
+    std::vector<std::vector<types::global_dof_index> > &dofs_per_block,
     std::vector<unsigned int>  target_block)
   {
     const FiniteElement<DH::dimension,DH::space_dimension> &fe = dof_handler.get_fe();
     const unsigned int n_blocks = fe.n_blocks();
-    const unsigned int n_levels = dof_handler.get_tria().n_levels();
+    const unsigned int n_levels = dof_handler.get_tria().n_global_levels();
 
     AssertDimension (dofs_per_block.size(), n_levels);
 
@@ -1142,7 +1152,7 @@ namespace MGTools
   make_boundary_list(
     const DoFHandler<1,1> &,
     const FunctionMap<1>::type &,
-    std::vector<std::set<unsigned int> > &,
+    std::vector<std::set<types::global_dof_index> > &,
     const ComponentMask &)
   {
     Assert(false, ExcNotImplemented());
@@ -1155,7 +1165,7 @@ namespace MGTools
   make_boundary_list(
     const DoFHandler<1,2> &,
     const FunctionMap<1>::type &,
-    std::vector<std::set<unsigned int> > &,
+    std::vector<std::set<types::global_dof_index> > &,
     const ComponentMask &)
   {
     Assert(false, ExcNotImplemented());
@@ -1168,7 +1178,7 @@ namespace MGTools
   make_boundary_list(
     const DoFHandler<dim,spacedim> &dof,
     const typename FunctionMap<dim>::type &function_map,
-    std::vector<std::set<unsigned int> > &boundary_indices,
+    std::vector<std::set<types::global_dof_index> > &boundary_indices,
     const ComponentMask &component_mask)
   {
     // if for whatever reason we were
@@ -1177,7 +1187,7 @@ namespace MGTools
     if (function_map.size() == 0)
       return;
 
-    const unsigned int n_levels = dof.get_tria().n_levels();
+    const unsigned int n_levels = dof.get_tria().n_global_levels();
 
 
 
@@ -1186,7 +1196,7 @@ namespace MGTools
 
     AssertDimension (boundary_indices.size(), n_levels);
 
-    std::vector<unsigned int> local_dofs;
+    std::vector<types::global_dof_index> local_dofs;
     local_dofs.reserve (DoFTools::max_dofs_per_face(dof));
     std::fill (local_dofs.begin (),
                local_dofs.end (),
@@ -1238,120 +1248,120 @@ namespace MGTools
         for (; cell!=endc; ++cell)
           if (dof.get_tria().locally_owned_subdomain()==numbers::invalid_subdomain_id
               || cell->level_subdomain_id()==dof.get_tria().locally_owned_subdomain())
-          for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
-               ++face_no)
-            {
-              if (cell->at_boundary(face_no) == false)
-                continue;
+            for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
+                 ++face_no)
+              {
+                if (cell->at_boundary(face_no) == false)
+                  continue;
 
-              const FiniteElement<dim> &fe = cell->get_fe();
-              const unsigned int level = cell->level();
-
-              // we can presently deal only with
-              // primitive elements for boundary
-              // values. this does not preclude
-              // us using non-primitive elements
-              // in components that we aren't
-              // interested in, however. make
-              // sure that all shape functions
-              // that are non-zero for the
-              // components we are interested in,
-              // are in fact primitive
-              for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-                {
-                  const ComponentMask &nonzero_component_array
-                    = cell->get_fe().get_nonzero_components (i);
-                  for (unsigned int c=0; c<n_components; ++c)
-                    if ((nonzero_component_array[c] == true)
-                        &&
-                        (component_mask[c] == true))
-                      Assert (cell->get_fe().is_primitive (i),
-                              ExcMessage ("This function can only deal with requested boundary "
-                                          "values that correspond to primitive (scalar) base "
-                                          "elements"));
-                }
+                const FiniteElement<dim> &fe = cell->get_fe();
+                const unsigned int level = cell->level();
+
+                // we can presently deal only with
+                // primitive elements for boundary
+                // values. this does not preclude
+                // us using non-primitive elements
+                // in components that we aren't
+                // interested in, however. make
+                // sure that all shape functions
+                // that are non-zero for the
+                // components we are interested in,
+                // are in fact primitive
+                for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+                  {
+                    const ComponentMask &nonzero_component_array
+                      = cell->get_fe().get_nonzero_components (i);
+                    for (unsigned int c=0; c<n_components; ++c)
+                      if ((nonzero_component_array[c] == true)
+                          &&
+                          (component_mask[c] == true))
+                        Assert (cell->get_fe().is_primitive (i),
+                                ExcMessage ("This function can only deal with requested boundary "
+                                            "values that correspond to primitive (scalar) base "
+                                            "elements"));
+                  }
 
-              typename DoFHandler<dim,spacedim>::face_iterator face = cell->face(face_no);
-              const types::boundary_id boundary_component = face->boundary_indicator();
-              if (function_map.find(boundary_component) != function_map.end())
-                // face is of the right component
-                {
-                  // get indices, physical location and
-                  // boundary values of dofs on this
-                  // face
-                  local_dofs.resize (fe.dofs_per_face);
-                  face->get_mg_dof_indices (level, local_dofs);
-                  if (fe_is_system)
-                    {
-                      // enter those dofs
-                      // into the list that
-                      // match the
-                      // component
-                      // signature. avoid
-                      // the usual
-                      // complication that
-                      // we can't just use
-                      // *_system_to_component_index
-                      // for non-primitive
-                      // FEs
-                      for (unsigned int i=0; i<local_dofs.size(); ++i)
-                        {
-                          unsigned int component;
-                          if (fe.is_primitive())
-                            component = fe.face_system_to_component_index(i).first;
-                          else
-                            {
-                              // non-primitive
-                              // case. make
-                              // sure that
-                              // this
-                              // particular
-                              // shape
-                              // function
-                              // _is_
-                              // primitive,
-                              // and get at
-                              // it's
-                              // component. use
-                              // usual
-                              // trick to
-                              // transfer
-                              // face dof
-                              // index to
-                              // cell dof
-                              // index
-                              const unsigned int cell_i
-                                = (dim == 1 ?
-                                   i
-                                   :
-                                   (dim == 2 ?
-                                    (i<2*fe.dofs_per_vertex ? i : i+2*fe.dofs_per_vertex)
-                                      :
-                                      (dim == 3 ?
-                                       (i<4*fe.dofs_per_vertex ?
-                                        i
+                typename DoFHandler<dim,spacedim>::face_iterator face = cell->face(face_no);
+                const types::boundary_id boundary_component = face->boundary_indicator();
+                if (function_map.find(boundary_component) != function_map.end())
+                  // face is of the right component
+                  {
+                    // get indices, physical location and
+                    // boundary values of dofs on this
+                    // face
+                    local_dofs.resize (fe.dofs_per_face);
+                    face->get_mg_dof_indices (level, local_dofs);
+                    if (fe_is_system)
+                      {
+                        // enter those dofs
+                        // into the list that
+                        // match the
+                        // component
+                        // signature. avoid
+                        // the usual
+                        // complication that
+                        // we can't just use
+                        // *_system_to_component_index
+                        // for non-primitive
+                        // FEs
+                        for (unsigned int i=0; i<local_dofs.size(); ++i)
+                          {
+                            unsigned int component;
+                            if (fe.is_primitive())
+                              component = fe.face_system_to_component_index(i).first;
+                            else
+                              {
+                                // non-primitive
+                                // case. make
+                                // sure that
+                                // this
+                                // particular
+                                // shape
+                                // function
+                                // _is_
+                                // primitive,
+                                // and get at
+                                // it's
+                                // component. use
+                                // usual
+                                // trick to
+                                // transfer
+                                // face dof
+                                // index to
+                                // cell dof
+                                // index
+                                const unsigned int cell_i
+                                  = (dim == 1 ?
+                                     i
+                                     :
+                                     (dim == 2 ?
+                                      (i<2*fe.dofs_per_vertex ? i : i+2*fe.dofs_per_vertex)
                                         :
-                                        (i<4*fe.dofs_per_vertex+4*fe.dofs_per_line ?
-                                         i+4*fe.dofs_per_vertex
+                                        (dim == 3 ?
+                                         (i<4*fe.dofs_per_vertex ?
+                                          i
+                                          :
+                                          (i<4*fe.dofs_per_vertex+4*fe.dofs_per_line ?
+                                           i+4*fe.dofs_per_vertex
+                                           :
+                                           i+4*fe.dofs_per_vertex+8*fe.dofs_per_line))
                                          :
-                                         i+4*fe.dofs_per_vertex+8*fe.dofs_per_line))
-                                       :
-                                       numbers::invalid_unsigned_int)));
-                              Assert (cell_i < fe.dofs_per_cell, ExcInternalError());
-
-                              // make sure
-                              // that if
-                              // this is
-                              // not a
-                              // primitive
-                              // shape function,
-                              // then all
-                              // the
-                              // corresponding
-                              // components
-                              // in the
-                              // mask are
-                              // not set
+                                         numbers::invalid_unsigned_int)));
+                                Assert (cell_i < fe.dofs_per_cell, ExcInternalError());
+
+                                // make sure
+                                // that if
+                                // this is
+                                // not a
+                                // primitive
+                                // shape function,
+                                // then all
+                                // the
+                                // corresponding
+                                // components
+                                // in the
+                                // mask are
+                                // not set
 //                         if (!fe.is_primitive(cell_i))
 //                           for (unsigned int c=0; c<n_components; ++c)
 //                             if (fe.get_nonzero_components(cell_i)[c])
@@ -1362,18 +1372,18 @@ namespace MGTools
 // components. if shape function is non-primitive, then we will ignore
 // the result in the following anyway, otherwise there's only one
 // non-zero component which we will use
-                              component = fe.get_nonzero_components(cell_i).first_selected_component();
-                            }
+                                component = fe.get_nonzero_components(cell_i).first_selected_component();
+                              }
 
-                          if (component_mask[component] == true)
-                            boundary_indices[level].insert(local_dofs[i]);
-                        }
-                    }
-                  else
-                    for (unsigned int i=0; i<local_dofs.size(); ++i)
-                      boundary_indices[level].insert(local_dofs[i]);
-                }
-            }
+                            if (component_mask[component] == true)
+                              boundary_indices[level].insert(local_dofs[i]);
+                          }
+                      }
+                    else
+                      for (unsigned int i=0; i<local_dofs.size(); ++i)
+                        boundary_indices[level].insert(local_dofs[i]);
+                  }
+              }
       }
   }
 
@@ -1385,14 +1395,14 @@ namespace MGTools
                      std::vector<IndexSet> &boundary_indices,
                      const ComponentMask &component_mask)
 {
-    Assert (boundary_indices.size() == dof.get_tria().n_levels(),
+    Assert (boundary_indices.size() == dof.get_tria().n_global_levels(),
             ExcDimensionMismatch (boundary_indices.size(),
-                                  dof.get_tria().n_levels()));
+                                  dof.get_tria().n_global_levels()));
 
-    std::vector<std::set<unsigned int> >
-    my_boundary_indices (dof.get_tria().n_levels());
+    std::vector<std::set<types::global_dof_index> >
+    my_boundary_indices (dof.get_tria().n_global_levels());
     make_boundary_list (dof, function_map, my_boundary_indices, component_mask);
-    for (unsigned int i=0; i<dof.get_tria().n_levels(); ++i)
+    for (unsigned int i=0; i<dof.get_tria().n_global_levels(); ++i)
       {
         boundary_indices[i] = IndexSet (dof.n_dofs(i));
         boundary_indices[i].add_indices (my_boundary_indices[i].begin(),
@@ -1408,11 +1418,11 @@ namespace MGTools
   extract_inner_interface_dofs (const DoFHandler<dim,spacedim> &mg_dof_handler,
                                 std::vector<std::vector<bool> >  &interface_dofs)
   {
-    Assert (interface_dofs.size() == mg_dof_handler.get_tria().n_levels(),
+    Assert (interface_dofs.size() == mg_dof_handler.get_tria().n_global_levels(),
             ExcDimensionMismatch (interface_dofs.size(),
-                                  mg_dof_handler.get_tria().n_levels()));
+                                  mg_dof_handler.get_tria().n_global_levels()));
 
-    for (unsigned int l=0; l<mg_dof_handler.get_tria().n_levels(); ++l)
+    for (unsigned int l=0; l<mg_dof_handler.get_tria().n_global_levels(); ++l)
       {
         Assert (interface_dofs[l].size() == mg_dof_handler.n_dofs(l),
                 ExcDimensionMismatch (interface_dofs[l].size(),
@@ -1428,7 +1438,7 @@ namespace MGTools
     const unsigned int   dofs_per_cell   = fe.dofs_per_cell;
     const unsigned int   dofs_per_face   = fe.dofs_per_face;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     std::vector<bool> cell_dofs(dofs_per_cell, false);
 
     typename DoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
@@ -1473,18 +1483,18 @@ namespace MGTools
   template <int dim, int spacedim>
   void
   extract_non_interface_dofs (const DoFHandler<dim,spacedim> &mg_dof_handler,
-                              std::vector<std::set<unsigned int> >  &non_interface_dofs)
+                              std::vector<std::set<types::global_dof_index> >  &non_interface_dofs)
   {
-    Assert (non_interface_dofs.size() == mg_dof_handler.get_tria().n_levels(),
+    Assert (non_interface_dofs.size() == mg_dof_handler.get_tria().n_global_levels(),
             ExcDimensionMismatch (non_interface_dofs.size(),
-                                  mg_dof_handler.get_tria().n_levels()));
+                                  mg_dof_handler.get_tria().n_global_levels()));
 
     const FiniteElement<dim,spacedim> &fe = mg_dof_handler.get_fe();
 
     const unsigned int   dofs_per_cell   = fe.dofs_per_cell;
     const unsigned int   dofs_per_face   = fe.dofs_per_face;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
     std::vector<bool> cell_dofs(dofs_per_cell, false);
     std::vector<bool> cell_dofs_interface(dofs_per_cell, false);
 
@@ -1545,14 +1555,14 @@ namespace MGTools
                                 std::vector<std::vector<bool> >  &interface_dofs,
                                 std::vector<std::vector<bool> >  &boundary_interface_dofs)
   {
-    Assert (interface_dofs.size() == mg_dof_handler.get_tria().n_levels(),
+    Assert (interface_dofs.size() == mg_dof_handler.get_tria().n_global_levels(),
             ExcDimensionMismatch (interface_dofs.size(),
-                                  mg_dof_handler.get_tria().n_levels()));
-    Assert (boundary_interface_dofs.size() == mg_dof_handler.get_tria().n_levels(),
+                                  mg_dof_handler.get_tria().n_global_levels()));
+    Assert (boundary_interface_dofs.size() == mg_dof_handler.get_tria().n_global_levels(),
             ExcDimensionMismatch (boundary_interface_dofs.size(),
-                                  mg_dof_handler.get_tria().n_levels()));
+                                  mg_dof_handler.get_tria().n_global_levels()));
 
-    for (unsigned int l=0; l<mg_dof_handler.get_tria().n_levels(); ++l)
+    for (unsigned int l=0; l<mg_dof_handler.get_tria().n_global_levels(); ++l)
       {
         Assert (interface_dofs[l].size() == mg_dof_handler.n_dofs(l),
                 ExcDimensionMismatch (interface_dofs[l].size(),
@@ -1574,8 +1584,8 @@ namespace MGTools
     const unsigned int   dofs_per_cell   = fe.dofs_per_cell;
     const unsigned int   dofs_per_face   = fe.dofs_per_face;
 
-    std::vector<unsigned int> local_dof_indices (dofs_per_cell);
-    std::vector<unsigned int> face_dof_indices (dofs_per_face);
+    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+    std::vector<types::global_dof_index> face_dof_indices (dofs_per_face);
 
     std::vector<bool> cell_dofs(dofs_per_cell, false);
     std::vector<bool> boundary_cell_dofs(dofs_per_cell, false);
@@ -1641,7 +1651,7 @@ namespace MGTools
   template <typename number>
   void
   apply_boundary_values (
-    const std::set<unsigned int> &boundary_dofs,
+    const std::set<types::global_dof_index> &boundary_dofs,
     SparseMatrix<number> &matrix,
     const bool preserve_symmetry,
     const bool /*ignore_zeros*/)
@@ -1652,8 +1662,8 @@ namespace MGTools
     // a deprecated function, I therefore threw away the original function
     // and replaced it by the following, which I believe should work
 
-    std::map<unsigned int, double> boundary_values;
-    for (std::set<unsigned int>::const_iterator p=boundary_dofs.begin();
+    std::map<types::global_dof_index, double> boundary_values;
+    for (std::set<types::global_dof_index>::const_iterator p=boundary_dofs.begin();
          p != boundary_dofs.end(); ++p)
       boundary_values[*p] = 0;
 
@@ -1668,7 +1678,7 @@ namespace MGTools
   template <typename number>
   void
   apply_boundary_values (
-    const std::set<unsigned int> &boundary_dofs,
+    const std::set<types::global_dof_index> &boundary_dofs,
     BlockSparseMatrix<number> &matrix,
     const bool preserve_symmetry)
   {
@@ -1684,8 +1694,8 @@ namespace MGTools
     // a deprecated function, I therefore threw away the original function
     // and replaced it by the following, which I believe should work
 
-    std::map<unsigned int, double> boundary_values;
-    for (std::set<unsigned int>::const_iterator p=boundary_dofs.begin();
+    std::map<types::global_dof_index, double> boundary_values;
+    for (std::set<types::global_dof_index>::const_iterator p=boundary_dofs.begin();
          p != boundary_dofs.end(); ++p)
       boundary_values[*p] = 0;
 
@@ -1707,16 +1717,16 @@ namespace MGTools
 namespace MGTools
 {
   template void apply_boundary_values (
-    const std::set<unsigned int> &,
+    const std::set<types::global_dof_index> &,
     SparseMatrix<float> &, const bool, const bool);
   template void apply_boundary_values (
-    const std::set<unsigned int> &,
+    const std::set<types::global_dof_index> &,
     SparseMatrix<double> &, const bool, const bool);
   template void apply_boundary_values (
-    const std::set<unsigned int> &,
+    const std::set<types::global_dof_index> &,
     BlockSparseMatrix<float> &, const bool);
   template void apply_boundary_values (
-    const std::set<unsigned int> &,
+    const std::set<types::global_dof_index> &,
     BlockSparseMatrix<double> &, const bool);
 }
 
index 9a0b2b8c85870638ef4ad8033ee5f6a1b16fa30d..8d4a68359b19f53818f037b3dadb6a6908689da3 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (PATTERN : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS;
@@ -84,23 +89,23 @@ for (deal_II_dimension : DIMENSIONS)
 #endif
 
       template void count_dofs_per_component (
-       const DoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
+       const DoFHandler<deal_II_dimension>&, std::vector<std::vector<types::global_dof_index> >&,
        bool, std::vector<unsigned int>);
       template void count_dofs_per_component (
-       const DoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
+       const DoFHandler<deal_II_dimension>&, std::vector<std::vector<types::global_dof_index> >&,
        std::vector<unsigned int>);
       template void count_dofs_per_block (
-       const DoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
+       const DoFHandler<deal_II_dimension>&, std::vector<std::vector<types::global_dof_index> >&,
        std::vector<unsigned int>);
       template void count_dofs_per_block (
-       const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
+       const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<types::global_dof_index> >&,
        std::vector<unsigned int>);
 
 #if deal_II_dimension > 1
       template void make_boundary_list(
        const DoFHandler<deal_II_dimension>&,
        const FunctionMap<deal_II_dimension>::type&,
-       std::vector<std::set<unsigned int> >&,
+       std::vector<std::set<types::global_dof_index> >&,
        const ComponentMask &);
 #endif
 
@@ -122,18 +127,18 @@ for (deal_II_dimension : DIMENSIONS)
       template
         void
         extract_non_interface_dofs (const DoFHandler<deal_II_dimension> & mg_dof_handler,
-                                    std::vector<std::set<unsigned int> > &non_interface_dofs);
+                                    std::vector<std::set<types::global_dof_index> > &non_interface_dofs);
 
 #if deal_II_dimension < 3
       template void count_dofs_per_block (
        const DoFHandler<deal_II_dimension,deal_II_dimension+1>&,
-       std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
+       std::vector<std::vector<types::global_dof_index> >&, std::vector<unsigned int>);
 #endif
 
 #if deal_II_dimension == 3
       template void count_dofs_per_block (
        const DoFHandler<1,3>&,
-       std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
+       std::vector<std::vector<types::global_dof_index> >&, std::vector<unsigned int>);
 #endif
     \}
   }
index acf82b29ea7358292470a4fe0cf505bab22467b2..d8dcd64ed15f1e11ea67a7c999069a10492f9ad3 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/logstream.h>
 
@@ -49,7 +53,7 @@ namespace
     const dealii::DoFHandler<dim,spacedim> &mg_dof,
     MGLevelObject<BlockVector<number> > &v,
     const std::vector<bool> &sel,
-    std::vector<std::vector<unsigned int> > &ndofs)
+    std::vector<std::vector<types::global_dof_index> > &ndofs)
   {
     std::vector<bool> selected=sel;
     // Compute the number of blocks needed
@@ -60,9 +64,9 @@ namespace
 
     if (ndofs.size() == 0)
       {
-        std::vector<std::vector<unsigned int> >
+        std::vector<std::vector<types::global_dof_index> >
         new_dofs(mg_dof.get_tria().n_levels(),
-                 std::vector<unsigned int>(selected.size()));
+                 std::vector<types::global_dof_index>(selected.size()));
         std::swap(ndofs, new_dofs);
         MGTools::count_dofs_per_block (mg_dof, ndofs);
       }
@@ -96,7 +100,7 @@ namespace
     const dealii::DoFHandler<dim,spacedim> &mg_dof,
     MGLevelObject<dealii::Vector<number> > &v,
     const unsigned int selected_block,
-    std::vector<std::vector<unsigned int> > &ndofs)
+    std::vector<std::vector<types::global_dof_index> > &ndofs)
   {
     const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
     Assert(selected_block < n_blocks, ExcIndexRange(selected_block, 0, n_blocks));
@@ -106,9 +110,9 @@ namespace
 
     if (ndofs.size() == 0)
       {
-        std::vector<std::vector<unsigned int> >
+        std::vector<std::vector<types::global_dof_index> >
         new_dofs(mg_dof.get_tria().n_levels(),
-                 std::vector<unsigned int>(selected.size()));
+                 std::vector<types::global_dof_index>(selected.size()));
         std::swap(ndofs, new_dofs);
         MGTools::count_dofs_per_block (mg_dof, ndofs);
       }
@@ -229,7 +233,7 @@ void MGTransferBlockBase::build_matrices (
 
   // Compute the lengths of all blocks
   sizes.clear ();
-  sizes.resize(n_levels, std::vector<unsigned int>(fe.n_blocks()));
+  sizes.resize(n_levels, std::vector<types::global_dof_index>(fe.n_blocks()));
   MGTools::count_dofs_per_block(mg_dof, sizes);
 
   // Fill some index vectors
@@ -238,10 +242,10 @@ void MGTransferBlockBase::build_matrices (
   // Compute start indices from sizes
   for (unsigned int l=0; l<mg_block_start.size(); ++l)
     {
-      unsigned int k=0;
+      types::global_dof_index k=0;
       for (unsigned int i=0; i<mg_block_start[l].size(); ++i)
         {
-          const unsigned int t=mg_block_start[l][i];
+          const types::global_dof_index t=mg_block_start[l][i];
           mg_block_start[l][i] = k;
           k += t;
         }
@@ -251,10 +255,10 @@ void MGTransferBlockBase::build_matrices (
   DoFTools::count_dofs_per_block (static_cast<const DoFHandler<dim,spacedim>&>(mg_dof),
                                   block_start);
 
-  unsigned int k=0;
+  types::global_dof_index k=0;
   for (unsigned int i=0; i<block_start.size(); ++i)
     {
-      const unsigned int t=block_start[i];
+      const types::global_dof_index t=block_start[i];
       block_start[i] = k;
       k += t;
     }
@@ -295,8 +299,8 @@ void MGTransferBlockBase::build_matrices (
   // two fields which will store the
   // indices of the multigrid dofs
   // for a cell and one of its children
-  std::vector<unsigned int> dof_indices_parent (dofs_per_cell);
-  std::vector<unsigned int> dof_indices_child (dofs_per_cell);
+  std::vector<types::global_dof_index> dof_indices_parent (dofs_per_cell);
+  std::vector<types::global_dof_index> dof_indices_child (dofs_per_cell);
 
   // for each level: first build the
   // sparsity pattern of the matrices
@@ -411,7 +415,7 @@ void MGTransferBlockBase::build_matrices (
   if (mg_constrained_dofs != 0)
     if (mg_constrained_dofs->set_boundary_values())
       {
-        std::vector<unsigned int> constrain_indices;
+        std::vector<types::global_dof_index> constrain_indices;
         std::vector<std::vector<bool> > constraints_per_block (n_blocks);
         for (int level=n_levels-2; level>=0; --level)
           {
@@ -425,7 +429,7 @@ void MGTransferBlockBase::build_matrices (
             // need to filter away.
             constrain_indices.resize (0);
             constrain_indices.resize (prolongation_matrices[level]->n(), 0);
-            std::set<unsigned int>::const_iterator dof
+            std::set<types::global_dof_index>::const_iterator dof
             = mg_constrained_dofs->get_boundary_indices()[level].begin(),
             endd = mg_constrained_dofs->get_boundary_indices()[level].end();
             for (; dof != endd; ++dof)
@@ -434,13 +438,13 @@ void MGTransferBlockBase::build_matrices (
             unsigned int index = 0;
             for (unsigned int block=0; block<n_blocks; ++block)
               {
-                const unsigned int n_dofs = prolongation_matrices[level]->block(block, block).m();
+                const types::global_dof_index n_dofs = prolongation_matrices[level]->block(block, block).m();
                 constraints_per_block[block].resize(0);
                 constraints_per_block[block].resize(n_dofs, 0);
-                for (unsigned int i=0; i<n_dofs; ++i, ++index)
+                for (types::global_dof_index i=0; i<n_dofs; ++i, ++index)
                   constraints_per_block[block][i] = constrain_indices[index] == 1;
 
-                for (unsigned int i=0; i<n_dofs; ++i)
+                for (types::global_dof_index i=0; i<n_dofs; ++i)
                   {
                     SparseMatrix<double>::iterator
                     start_row = prolongation_matrices[level]->block(block, block).begin(i),
@@ -474,9 +478,9 @@ void MGTransferBlockSelect<number>::build_matrices (
 
   MGTransferBlockBase::build_matrices (dof, mg_dof);
 
-  std::vector<unsigned int> temp_copy_indices;
-  std::vector<unsigned int> global_dof_indices (fe.dofs_per_cell);
-  std::vector<unsigned int> level_dof_indices  (fe.dofs_per_cell);
+  std::vector<types::global_dof_index> temp_copy_indices;
+  std::vector<types::global_dof_index> global_dof_indices (fe.dofs_per_cell);
+  std::vector<types::global_dof_index> level_dof_indices  (fe.dofs_per_cell);
 
   for (int level=dof.get_tria().n_levels()-1; level>=0; --level)
     {
@@ -487,7 +491,7 @@ void MGTransferBlockSelect<number>::build_matrices (
 
       temp_copy_indices.resize (0);
       temp_copy_indices.resize (sizes[level][selected_block],
-                                numbers::invalid_unsigned_int);
+                                numbers::invalid_dof_index);
 
       // Compute coarse level right hand side
       // by restricting from fine level.
@@ -524,16 +528,16 @@ void MGTransferBlockSelect<number>::build_matrices (
       // copy_indices object. Then, insert the pairs
       // of global index and level index into
       // copy_indices.
-      const unsigned int n_active_dofs =
+      const types::global_dof_index n_active_dofs =
         std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(),
-                       std::bind2nd(std::not_equal_to<unsigned int>(),
-                                    numbers::invalid_unsigned_int));
+                       std::bind2nd(std::not_equal_to<types::global_dof_index>(),
+                                    numbers::invalid_dof_index));
       copy_indices[selected_block][level].resize (n_active_dofs);
-      unsigned int counter = 0;
-      for (unsigned int i=0; i<temp_copy_indices.size(); ++i)
-        if (temp_copy_indices[i] != numbers::invalid_unsigned_int)
+      types::global_dof_index counter = 0;
+      for (types::global_dof_index i=0; i<temp_copy_indices.size(); ++i)
+        if (temp_copy_indices[i] != numbers::invalid_dof_index)
           copy_indices[selected_block][level][counter++] =
-            std::pair<unsigned int, unsigned int> (temp_copy_indices[i], i);
+            std::pair<types::global_dof_index, unsigned int> (temp_copy_indices[i], i);
       Assert (counter == n_active_dofs, ExcInternalError());
     }
 }
@@ -562,9 +566,9 @@ void MGTransferBlock<number>::build_matrices (
 
   MGTransferBlockBase::build_matrices (dof, mg_dof);
 
-  std::vector<std::vector<unsigned int> > temp_copy_indices (n_blocks);
-  std::vector<unsigned int> global_dof_indices (fe.dofs_per_cell);
-  std::vector<unsigned int> level_dof_indices  (fe.dofs_per_cell);
+  std::vector<std::vector<types::global_dof_index> > temp_copy_indices (n_blocks);
+  std::vector<types::global_dof_index> global_dof_indices (fe.dofs_per_cell);
+  std::vector<types::global_dof_index> level_dof_indices  (fe.dofs_per_cell);
   for (int level=dof.get_tria().n_levels()-1; level>=0; --level)
     {
       typename DoFHandler<dim,spacedim>::active_cell_iterator
@@ -577,7 +581,7 @@ void MGTransferBlock<number>::build_matrices (
           {
             temp_copy_indices[block].resize (0);
             temp_copy_indices[block].resize (sizes[level][block],
-                                             numbers::invalid_unsigned_int);
+                                             numbers::invalid_dof_index);
           }
 
       // Compute coarse level right hand side
@@ -603,17 +607,17 @@ void MGTransferBlock<number>::build_matrices (
       for (unsigned int block=0; block<n_blocks; ++block)
         if (selected[block])
           {
-            const unsigned int n_active_dofs =
+            const types::global_dof_index n_active_dofs =
               std::count_if (temp_copy_indices[block].begin(),
                              temp_copy_indices[block].end(),
-                             std::bind2nd(std::not_equal_to<unsigned int>(),
-                                          numbers::invalid_unsigned_int));
+                             std::bind2nd(std::not_equal_to<types::global_dof_index>(),
+                                          numbers::invalid_dof_index));
             copy_indices[block][level].resize (n_active_dofs);
-            unsigned int counter = 0;
-            for (unsigned int i=0; i<temp_copy_indices[block].size(); ++i)
-              if (temp_copy_indices[block][i] != numbers::invalid_unsigned_int)
+            types::global_dof_index counter = 0;
+            for (types::global_dof_index i=0; i<temp_copy_indices[block].size(); ++i)
+              if (temp_copy_indices[block][i] != numbers::invalid_dof_index)
                 copy_indices[block][level][counter++] =
-                  std::pair<unsigned int, unsigned int>
+                  std::pair<types::global_dof_index, unsigned int>
                   (temp_copy_indices[block][i], i);
             Assert (counter == n_active_dofs, ExcInternalError());
           }
index 466aac4c48aa3ccb547f57eeb1594d598414d966..6bff38e9f79531f9cbfa272663e6b079e6cd1c0b 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index 74d58198ab397b571305433c043f73d00fcadc86..1be8a299e6ccf5546374a305c9fd5ff22e581ff8 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/function.h>
@@ -79,7 +83,7 @@ namespace
     MGLevelObject<BlockVector<number> > &v,
     const std::vector<bool> &sel,
     const std::vector<unsigned int> &target_comp,
-    std::vector<std::vector<unsigned int> > &ndofs)
+    std::vector<std::vector<types::global_dof_index> > &ndofs)
   {
     std::vector<bool> selected=sel;
     std::vector<unsigned int> target_component=target_comp;
@@ -122,9 +126,9 @@ namespace
 
     if (ndofs.size() == 0)
       {
-        std::vector<std::vector<unsigned int> >
+        std::vector<std::vector<types::global_dof_index> >
         new_dofs(mg_dof.get_tria().n_levels(),
-                 std::vector<unsigned int>(target_component.size()));
+                 std::vector<types::global_dof_index>(target_component.size()));
         std::swap(ndofs, new_dofs);
         MGTools::count_dofs_per_block (mg_dof, ndofs, target_component);
       }
@@ -179,7 +183,7 @@ namespace
     MGLevelObject<dealii::Vector<number> > &v,
     const ComponentMask &component_mask,
     const std::vector<unsigned int> &target_component,
-    std::vector<std::vector<unsigned int> > &ndofs)
+    std::vector<std::vector<types::global_dof_index> > &ndofs)
   {
     Assert (component_mask.represents_n_components(target_component.size()),
             ExcMessage ("The component mask does not have the correct size."));
@@ -191,9 +195,9 @@ namespace
 
     if (ndofs.size() == 0)
       {
-        std::vector<std::vector<unsigned int> >
+        std::vector<std::vector<types::global_dof_index> >
         new_dofs(mg_dof.get_tria().n_levels(),
-                 std::vector<unsigned int>(target_component.size()));
+                 std::vector<types::global_dof_index>(target_component.size()));
         std::swap(ndofs, new_dofs);
         MGTools::count_dofs_per_block (mg_dof, ndofs,
                                        target_component);
@@ -241,7 +245,7 @@ MGTransferSelect<number>::do_copy_to_mg (
     {
       --level;
 
-      typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+      typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
       for (IT i=copy_to_and_from_indices[level].begin();
            i != copy_to_and_from_indices[level].end(); ++i)
         dst[level](i->second) = src(i->first);
@@ -334,10 +338,10 @@ void MGTransferComponentBase::build_matrices (
   // Compute start indices from sizes
   for (unsigned int l=0; l<mg_component_start.size(); ++l)
     {
-      unsigned int k=0;
+      types::global_dof_index k=0;
       for (unsigned int i=0; i<mg_component_start[l].size(); ++i)
         {
-          const unsigned int t=mg_component_start[l][i];
+          const types::global_dof_index t=mg_component_start[l][i];
           mg_component_start[l][i] = k;
           k += t;
         }
@@ -348,10 +352,10 @@ void MGTransferComponentBase::build_matrices (
   DoFTools::
   count_dofs_per_block (mg_dof, component_start, target_component);
 
-  unsigned int k=0;
+  types::global_dof_index k=0;
   for (unsigned int i=0; i<component_start.size(); ++i)
     {
-      const unsigned int t=component_start[i];
+      const types::global_dof_index t=component_start[i];
       component_start[i] = k;
       k += t;
     }
@@ -391,8 +395,8 @@ void MGTransferComponentBase::build_matrices (
   // two fields which will store the
   // indices of the multigrid dofs
   // for a cell and one of its children
-  std::vector<unsigned int> dof_indices_parent (dofs_per_cell);
-  std::vector<unsigned int> dof_indices_child (dofs_per_cell);
+  std::vector<types::global_dof_index> dof_indices_parent (dofs_per_cell);
+  std::vector<types::global_dof_index> dof_indices_child (dofs_per_cell);
 
   // for each level: first build the
   // sparsity pattern of the matrices
@@ -503,9 +507,9 @@ void MGTransferComponentBase::build_matrices (
 
   if (boundary_indices.size() != 0)
     {
-      std::vector<std::vector<unsigned int> >
+      std::vector<std::vector<types::global_dof_index> >
       dofs_per_component(mg_dof.get_tria().n_levels(),
-                         std::vector<unsigned int>(n_components));
+                         std::vector<types::global_dof_index>(n_components));
 
       MGTools::count_dofs_per_block (mg_dof, dofs_per_component, mg_target_component);
       for (unsigned int level=0; level<n_levels-1; ++level)
@@ -517,20 +521,20 @@ void MGTransferComponentBase::build_matrices (
             for (unsigned int jblock=0; jblock<n_components; ++jblock)
               if (iblock==jblock)
                 {
-                  const unsigned int n_dofs = prolongation_matrices[level]->block(iblock,jblock).m();
-                  for (unsigned int i=0; i<n_dofs; ++i)
+                  const types::global_dof_index n_dofs = prolongation_matrices[level]->block(iblock,jblock).m();
+                  for (types::global_dof_index i=0; i<n_dofs; ++i)
                     {
                       SparseMatrix<double>::iterator anfang = prolongation_matrices[level]->block(iblock,jblock).begin(i),
                                                      ende = prolongation_matrices[level]->block(iblock,jblock).end(i);
                       for (; anfang != ende; ++anfang)
                         {
-                          const unsigned int column_number = anfang->column();
+                          const types::global_dof_index column_number = anfang->column();
 
                           //convert global indices into local ones
                           const BlockIndices block_indices_coarse (dofs_per_component[level]);
-                          const unsigned int global_j = block_indices_coarse.local_to_global(iblock, column_number);
+                          const types::global_dof_index global_j = block_indices_coarse.local_to_global(iblock, column_number);
 
-                          std::set<unsigned int>::const_iterator found_dof =
+                          std::set<types::global_dof_index>::const_iterator found_dof =
                             boundary_indices[level].find(global_j);
 
                           const bool is_boundary_index =
@@ -558,7 +562,7 @@ void MGTransferSelect<number>::build_matrices (
   unsigned int mg_select,
   const std::vector<unsigned int> &t_component,
   const std::vector<unsigned int> &mg_t_component,
-  const std::vector<std::set<unsigned int> > &bdry_indices)
+  const std::vector<std::set<types::global_dof_index> > &bdry_indices)
 {
   const FiniteElement<dim> &fe = mg_dof.get_fe();
   unsigned int ncomp = mg_dof.get_fe().n_components();
@@ -617,9 +621,9 @@ void MGTransferSelect<number>::build_matrices (
 
   // use a temporary vector to create the
   // relation between global and level dofs
-  std::vector<unsigned int> temp_copy_indices;
-  std::vector<unsigned int> global_dof_indices (fe.dofs_per_cell);
-  std::vector<unsigned int> level_dof_indices  (fe.dofs_per_cell);
+  std::vector<types::global_dof_index> temp_copy_indices;
+  std::vector<types::global_dof_index> global_dof_indices (fe.dofs_per_cell);
+  std::vector<types::global_dof_index> level_dof_indices  (fe.dofs_per_cell);
   for (int level=dof.get_tria().n_levels()-1; level>=0; --level)
     {
       copy_to_and_from_indices[level].clear();
@@ -629,7 +633,7 @@ void MGTransferSelect<number>::build_matrices (
       level_end  = mg_dof.end_active(level);
 
       temp_copy_indices.resize (0);
-      temp_copy_indices.resize (mg_dof.n_dofs(level), numbers::invalid_unsigned_int);
+      temp_copy_indices.resize (mg_dof.n_dofs(level), numbers::invalid_dof_index);
 
       // Compute coarse level right hand side
       // by restricting from fine level.
@@ -649,9 +653,9 @@ void MGTransferSelect<number>::build_matrices (
               if (component_mask[component] &&
                   !interface_dofs[level][level_dof_indices[i]])
                 {
-                  const unsigned int level_start
+                  const types::global_dof_index level_start
                     = mg_component_start[level][mg_target_component[component]];
-                  const unsigned int global_start
+                  const types::global_dof_index global_start
                     = component_start[target_component[component]];
                   temp_copy_indices[level_dof_indices[i]-level_start] =
                     global_dof_indices[i] - global_start;
@@ -661,16 +665,16 @@ void MGTransferSelect<number>::build_matrices (
 
       // write indices from vector into the map from
       // global to level dofs
-      const unsigned int n_active_dofs =
+      const types::global_dof_index n_active_dofs =
         std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(),
-                       std::bind2nd(std::not_equal_to<unsigned int>(),
-                                    numbers::invalid_unsigned_int));
+                       std::bind2nd(std::not_equal_to<types::global_dof_index>(),
+                                    numbers::invalid_dof_index));
       copy_to_and_from_indices[level].resize (n_active_dofs);
-      unsigned int counter = 0;
-      for (unsigned int i=0; i<temp_copy_indices.size(); ++i)
-        if (temp_copy_indices[i] != numbers::invalid_unsigned_int)
+      types::global_dof_index counter = 0;
+      for (types::global_dof_index i=0; i<temp_copy_indices.size(); ++i)
+        if (temp_copy_indices[i] != numbers::invalid_dof_index)
           copy_to_and_from_indices[level][counter++] =
-            std::pair<unsigned int, unsigned int> (temp_copy_indices[i], i);
+            std::pair<types::global_dof_index, unsigned int> (temp_copy_indices[i], i);
       Assert (counter == n_active_dofs, ExcInternalError());
     }
 }
index bd9ad33004c19ff159bcaec6a203e81777ac10a3..6c53ccb8169d4d4d22eaff94d33352171a8617d9 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
@@ -21,7 +25,7 @@ void MGTransferSelect<float>::build_matrices<deal_II_dimension>
  unsigned int, unsigned int,
  const std::vector<unsigned int>&,
  const std::vector<unsigned int>&,
- const std::vector<std::set<unsigned int> >&);
+ const std::vector<std::set<types::global_dof_index> >&);
 
 template
 void MGTransferSelect<double>::build_matrices<deal_II_dimension>
@@ -30,7 +34,7 @@ void MGTransferSelect<double>::build_matrices<deal_II_dimension>
  unsigned int, unsigned int,
  const std::vector<unsigned int>&,
  const std::vector<unsigned int>&,
- const std::vector<std::set<unsigned int> >&);
+ const std::vector<std::set<types::global_dof_index> >&);
 
 template void
 MGTransferSelect<float>::copy_to_mg (
index 4415dc60fdc3da81f92ca5696a82cd54d6689a16..b1fb5910fc419f021495eef536006579173398a3 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 by the deal.II authors
+// Copyright (C) 2003 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/function.h>
@@ -34,6 +39,8 @@
 #include <deal.II/multigrid/mg_transfer.h>
 #include <deal.II/multigrid/mg_transfer.templates.h>
 
+#include <algorithm>
+
 DEAL_II_NAMESPACE_OPEN
 
 
@@ -85,7 +92,7 @@ template <int dim, int spacedim>
 void MGTransferPrebuilt<VECTOR>::build_matrices (
   const DoFHandler<dim,spacedim>  &mg_dof)
 {
-  const unsigned int n_levels      = mg_dof.get_tria().n_levels();
+  const unsigned int n_levels      = mg_dof.get_tria().n_global_levels();
   const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell;
 
   sizes.resize(n_levels);
@@ -116,8 +123,8 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
   // two fields which will store the
   // indices of the multigrid dofs
   // for a cell and one of its children
-  std::vector<unsigned int> dof_indices_parent (dofs_per_cell);
-  std::vector<unsigned int> dof_indices_child (dofs_per_cell);
+  std::vector<types::global_dof_index> dof_indices_parent (dofs_per_cell);
+  std::vector<types::global_dof_index> dof_indices_child (dofs_per_cell);
 
   // for each level: first build the sparsity
   // pattern of the matrices and then build the
@@ -139,13 +146,13 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
       // element will be stored
       CompressedSimpleSparsityPattern csp (sizes[level+1],
                                            sizes[level]);
-      std::vector<unsigned int> entries (dofs_per_cell);
+      std::vector<types::global_dof_index> entries (dofs_per_cell);
       for (typename DoFHandler<dim,spacedim>::cell_iterator cell=mg_dof.begin(level);
            cell != mg_dof.end(level); ++cell)
         if (cell->has_children() &&
             ( mg_dof.get_tria().locally_owned_subdomain()==numbers::invalid_subdomain_id
-                || cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain()
-                ))
+              || cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain()
+            ))
           {
             cell->get_mg_dof_indices (dof_indices_parent);
 
@@ -178,21 +185,23 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
                   }
               }
           }
-      
+
       internal::MatrixSelector<VECTOR>::reinit(*prolongation_matrices[level],
-                                              *prolongation_sparsities[level],
-                                              level,
-                                              csp,
-                                              mg_dof);
+                                               *prolongation_sparsities[level],
+                                               level,
+                                               csp,
+                                               mg_dof);
       csp.reinit(0,0);
 
+      FullMatrix<double> prolongation;
+
       // now actually build the matrices
       for (typename DoFHandler<dim,spacedim>::cell_iterator cell=mg_dof.begin(level);
            cell != mg_dof.end(level); ++cell)
         if (cell->has_children() &&
             (mg_dof.get_tria().locally_owned_subdomain()==numbers::invalid_subdomain_id
              || cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain())
-             )
+           )
           {
             cell->get_mg_dof_indices (dof_indices_parent);
 
@@ -203,10 +212,16 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
                 // set an alias to the
                 // prolongation matrix for
                 // this child
-                const FullMatrix<double> &prolongation
+                prolongation
                   = mg_dof.get_fe().get_prolongation_matrix (child,
                                                              cell->refinement_case());
 
+                if (mg_constrained_dofs != 0 && mg_constrained_dofs->set_boundary_values())
+                  for (unsigned int j=0; j<dofs_per_cell; ++j)
+                    if (mg_constrained_dofs->is_boundary_index(level, dof_indices_parent[j]))
+                      for (unsigned int i=0; i<dofs_per_cell; ++i)
+                        prolongation(i,j) = 0.;
+
                 cell->child(child)->get_mg_dof_indices (dof_indices_child);
 
                 // now set the entries in the
@@ -219,128 +234,102 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
                                                      true);
               }
           }
+      prolongation_matrices[level]->compress(VectorOperation::insert);
     }
 
-
-  // impose boundary conditions
-  // but only in the column of
-  // the prolongation matrix
-  if (mg_constrained_dofs != 0)
-    if (mg_constrained_dofs->set_boundary_values())
-      {
-        std::vector<unsigned int> constrain_indices;
-        for (int level=n_levels-2; level>=0; --level)
-          {
-            if (mg_constrained_dofs->get_boundary_indices()[level].size() == 0)
-              continue;
-
-            // need to delete all the columns in the
-            // matrix that are on the boundary. to achieve
-            // this, create an array as long as there are
-            // matrix columns, and find which columns we
-            // need to filter away.
-            constrain_indices.resize (0);
-            constrain_indices.resize (prolongation_matrices[level]->n(), 0);
-            std::set<unsigned int>::const_iterator dof
-            = mg_constrained_dofs->get_boundary_indices()[level].begin(),
-            endd = mg_constrained_dofs->get_boundary_indices()[level].end();
-            for (; dof != endd; ++dof)
-              constrain_indices[*dof] = 1;
-
-            const unsigned int n_dofs = prolongation_matrices[level]->m();
-            for (unsigned int i=0; i<n_dofs; ++i)
-              {
-                typename internal::MatrixSelector<VECTOR>::Matrix::iterator
-                start_row = prolongation_matrices[level]->begin(i),
-                end_row   = prolongation_matrices[level]->end(i);
-                for (; start_row != end_row; ++start_row)
-                  {
-                    if (constrain_indices[start_row->column()] == 1)
-                      start_row->value() = 0;
-                  }
-              }
-          }
-      }
-
-  // to find the indices that describe the
-  // relation between global dofs and local
-  // numbering on the individual level, first
-  // create a temp vector where the ith level
-  // entry contains the respective global
-  // entry. this gives a neat way to find those
-  // indices. in a second step, actually build
-  // the std::vector<std::pair<uint,uint> > that
-  // only contains the active dofs on the
-  // levels.
+  // Now we are filling the variables copy_indices*, which are essentially
+  // maps from global to mgdof for each level stored as a std::vector of
+  // pairs. We need to split this map on each level depending on the ownership
+  // of the global and mgdof, so that we later not access non-local elements
+  // in copy_to/from_mg.
+  // We keep track in the bitfield dof_touched which global dof has
+  // been processed already (on the current level). This is the same as
+  // the multigrid running in serial.
+  // Only entering on the finest level gives wrong results (why?)
 
   copy_indices.resize(n_levels);
-  std::vector<unsigned int> temp_copy_indices;
-  std::vector<unsigned int> global_dof_indices (dofs_per_cell);
-  std::vector<unsigned int> level_dof_indices  (dofs_per_cell);
-  for (int level=mg_dof.get_tria().n_levels()-1; level>=0; --level)
+  copy_indices_from_me.resize(n_levels);
+  copy_indices_to_me.resize(n_levels);
+  IndexSet globally_relevant;
+  DoFTools::extract_locally_relevant_dofs(mg_dof, globally_relevant);
+
+  std::vector<types::global_dof_index> global_dof_indices (dofs_per_cell);
+  std::vector<types::global_dof_index> level_dof_indices  (dofs_per_cell);
+  //  for (int level=mg_dof.get_tria().n_levels()-1; level>=0; --level)
+  for (unsigned int level=0; level<mg_dof.get_tria().n_levels(); ++level)
     {
+      std::vector<bool> dof_touched(globally_relevant.n_elements(), false);
       copy_indices[level].clear();
+      copy_indices_from_me[level].clear();
+      copy_indices_to_me[level].clear();
+
       typename DoFHandler<dim,spacedim>::active_cell_iterator
       level_cell = mg_dof.begin_active(level);
       const typename DoFHandler<dim,spacedim>::active_cell_iterator
       level_end  = mg_dof.end_active(level);
 
-      temp_copy_indices.resize (0);
-      temp_copy_indices.resize (mg_dof.n_dofs(level), numbers::invalid_unsigned_int);
-
-      // Compute coarse level right hand side
-      // by restricting from fine level.
       for (; level_cell!=level_end; ++level_cell)
         {
           if (mg_dof.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id
-              &&  level_cell->level_subdomain_id()!=mg_dof.get_tria().locally_owned_subdomain())
+              &&  (level_cell->level_subdomain_id()==numbers::artificial_subdomain_id
+                   ||  level_cell->subdomain_id()==numbers::artificial_subdomain_id)
+             )
             continue;
 
-          // get the dof numbers of
-          // this cell for the global
-          // and the level-wise
+          // get the dof numbers of this cell for the global and the level-wise
           // numbering
-          level_cell->get_dof_indices(global_dof_indices);
+          level_cell->get_dof_indices (global_dof_indices);
           level_cell->get_mg_dof_indices (level_dof_indices);
 
           for (unsigned int i=0; i<dofs_per_cell; ++i)
             {
-              if (mg_constrained_dofs != 0)
-                {
-                  if (!mg_constrained_dofs->at_refinement_edge(level,level_dof_indices[i]))
-                    temp_copy_indices[level_dof_indices[i]] = global_dof_indices[i];
-                }
+              // we need to ignore if the DoF is on a refinement edge (hanging node)
+              if (mg_constrained_dofs != 0
+                  && mg_constrained_dofs->at_refinement_edge(level, level_dof_indices[i]))
+                continue;
+              unsigned int global_idx = globally_relevant.index_within_set(global_dof_indices[i]);
+              //skip if we did this global dof already (on this or a coarser level)
+              if (dof_touched[global_idx])
+                continue;
+              bool global_mine = mg_dof.locally_owned_dofs().is_element(global_dof_indices[i]);
+              bool level_mine = mg_dof.locally_owned_mg_dofs(level).is_element(level_dof_indices[i]);
+
+              if (global_mine && level_mine)
+                copy_indices[level].push_back(
+                  std::pair<unsigned int, unsigned int> (global_dof_indices[i], level_dof_indices[i]));
+              else if (level_mine)
+                copy_indices_from_me[level].push_back(
+                  std::pair<unsigned int, unsigned int> (global_dof_indices[i], level_dof_indices[i]));
+              else if (global_mine)
+                copy_indices_to_me[level].push_back(
+                  std::pair<unsigned int, unsigned int> (global_dof_indices[i], level_dof_indices[i]));
               else
-                temp_copy_indices[level_dof_indices[i]] = global_dof_indices[i];
+                continue;
+
+              dof_touched[global_idx] = true;
             }
         }
-
-      // now all the active dofs got a valid entry,
-      // the other ones have an invalid entry. Count
-      // the invalid entries and then resize the
-      // copy_indices object. Then, insert the pairs
-      // of global index and level index into
-      // copy_indices.
-      const unsigned int n_active_dofs =
-        std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(),
-                       std::bind2nd(std::not_equal_to<unsigned int>(),
-                                    numbers::invalid_unsigned_int));
-      copy_indices[level].resize (n_active_dofs);
-      unsigned int counter = 0;
-      for (unsigned int i=0; i<temp_copy_indices.size(); ++i)
-        if (temp_copy_indices[i] != numbers::invalid_unsigned_int)
-          copy_indices[level][counter++] =
-            std::pair<unsigned int, unsigned int> (temp_copy_indices[i], i);
-      Assert (counter == n_active_dofs, ExcInternalError());
     }
+
+  // If we are in debugging mode, we order the copy indices, so we get
+  // more reliable output for regression texts
+#ifdef DEBUG
+  std::less<std::pair<types::global_dof_index, unsigned int> > compare;
+  for (unsigned int level=0; level<copy_indices.size(); ++level)
+    std::sort(copy_indices[level].begin(), copy_indices[level].end(), compare);
+  for (unsigned int level=0; level<copy_indices_from_me.size(); ++level)
+    std::sort(copy_indices_from_me[level].begin(), copy_indices_from_me[level].end(), compare);
+  for (unsigned int level=0; level<copy_indices_to_me.size(); ++level)
+    std::sort(copy_indices_to_me[level].begin(), copy_indices_to_me[level].end(), compare);
+#endif
 }
 
 
 template <class VECTOR>
 void
-MGTransferPrebuilt<VECTOR>::print_matrices (std::ostreamos) const
+MGTransferPrebuilt<VECTOR>::print_matrices (std::ostream &os) const
 {
-  for (unsigned int level = 0;level<prolongation_matrices.size();++level)
+  for (unsigned int level = 0; level<prolongation_matrices.size(); ++level)
     {
       os << "Level " << level << std::endl;
       prolongation_matrices[level]->print(os);
@@ -348,6 +337,31 @@ MGTransferPrebuilt<VECTOR>::print_matrices (std::ostream& os) const
     }
 }
 
+template <class VECTOR>
+void
+MGTransferPrebuilt<VECTOR>::print_indices (std::ostream &os) const
+{
+  for (unsigned int level = 0; level<copy_indices.size(); ++level)
+    {
+      for (unsigned int i=0; i<copy_indices[level].size(); ++i)
+        os << "copy_indices[" << level
+           << "]\t" << copy_indices[level][i].first << '\t' << copy_indices[level][i].second << std::endl;
+    }
+
+  for (unsigned int level = 0; level<copy_indices_from_me.size(); ++level)
+    {
+      for (unsigned int i=0; i<copy_indices_from_me[level].size(); ++i)
+        os << "copy_ifrom  [" << level
+           << "]\t" << copy_indices_from_me[level][i].first << '\t' << copy_indices_from_me[level][i].second << std::endl;
+    }
+  for (unsigned int level = 0; level<copy_indices_to_me.size(); ++level)
+    {
+      for (unsigned int i=0; i<copy_indices_to_me[level].size(); ++i)
+        os << "copy_ito    [" << level
+           << "]\t" << copy_indices_to_me[level][i].first << '\t' << copy_indices_to_me[level][i].second << std::endl;
+    }
+}
+
 
 // explicit instantiation
 #include "mg_transfer_prebuilt.inst"
index 47e315f22552037b89cb186fd7bb45dc16a9a6b7..c72b279ae0f92c8316c718ddcc1677a44495d123 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (V1 : VECTORS_WITH_MATRIX)
index b5555d7f88c5e4c9d51119be5597ff53afec1614..20012529005269493873eeeed601358d1673d9ec 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 
 #include <deal.II/lac/vector.h>
index 9623c2413a7c969a808746b4fb7626cc37f4d288..f74b685f142647243b6e3a3d41e9b68d7775edd5 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id: vector_tools.inst.in 26105 2012-08-23 22:10:05Z heister $
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2012 by the deal.II authors
+// Copyright (C) 2012 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS)
 {
index d2d500f71b983ba04abecdb1396f1c8d397842b5..855e2c677791a9510c0abc33c79d5660ee779933 100644 (file)
@@ -1,16 +1,18 @@
-#####
+## ---------------------------------------------------------------------
+## $Id$
 ##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012 - 2013 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
 ##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
+## ---------------------------------------------------------------------
 
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
index a1172305ea1938479d62430c51e2510216d0d59c..51d7a560bc8475a52291be7c052c7f0b42f18113 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/work_stream.h>
index b084eabe27c70f0df024fdba734e0a235eaadc44..55fc70143326514c7b0854b4f2c487c46987a749 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS; DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
 {
index ec0cf5e1dca2fa4e8b7b01a65b60d67277774067..9d282370ae82be90132e621877c469685ef3934f 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/work_stream.h>
index f33ccf0591192deb5546c45ab89cf09906306c33..84516e4da6096f8e3d040c40f62ca19d11bd3281 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index 07e4a5680590112d023187ba4a122cd5530ac263..a78854ada675e9daf810d21891091456782d60ed 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/work_stream.h>
index 95bbbea2045089f26cc04dfb95f7192ad992f197..a44a7c69f8205a2157ee340b81ad3d02f4dc5047 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index 41750ae6350f3099f964815498bcd6a67aaadbcc..9498aeef4a8694328535903611c5304b8023209c 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/numerics/data_out_stack.h>
 #include <deal.II/base/quadrature_lib.h>
index 2c77b5ff5750cb47fa57ed96f948a14d89450ebf..67a6ccc773e24b0dbf4d759f2b5aea8d36866206 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index 99149e8bd2301627d5ace9443728110373018806..70c386017cd483adcbef6c7c8a25616e6ef27a7e 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2010, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 #include <deal.II/numerics/data_postprocessor.h>
 
 DEAL_II_NAMESPACE_OPEN
index 601653a179f3d2059304b4eef31cd8cbaf681846..b170d35b3b414bf0297cd80463a676dfb80265a9 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index 59929690ba270709443455f511ceae5957737544..bea59d99596781e4a3097443dde9f5ff96aba152 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012, 2013 by the deal.II authors
+// Copyright (C) 2000 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/thread_management.h>
index 8abdb2bde792c80b3554d9ce435262b644e85c04..6e7ed876abc893734a94beb851560be8a0cf9484 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS ; VEC : SERIAL_VECTORS ; DH : DOFHANDLER_TEMPLATES)
 {
index 8fd7ff76ad750dfd85b07aa91eac83b37d75fea2..740c8e89e7111fbf14d773e11590365821a20981 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/base/parameter_handler.h>
 #include <deal.II/base/logstream.h>
index 2f28e5e08b8ef9fa83cbe381546d65afad0811ca..5aeafb7734bff2f9df154cb091d041cc701edc47 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS)
 {
index 676a4c7e7f47f6d82283f4e166290e79f9b4da29..46771ecc59e28fb605701816613fa113ff534736 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/thread_management.h>
 #include <deal.II/base/quadrature.h>
@@ -471,7 +473,7 @@ namespace internal
             {
               fe_face_values_neighbor.get_present_fe_values()
               .get_function_gradients (*solutions[n],
-                                      parallel_data.neighbor_psi[n]);
+                                       parallel_data.neighbor_psi[n]);
 
               // compute the jump in the gradients
               for (unsigned int component=0; component<n_components; ++component)
@@ -1325,7 +1327,7 @@ estimate (const Mapping<1,spacedim>                    &mapping,
                 for (unsigned int s=0; s<n_solution_vectors; ++s)
                   fe_values.get_present_fe_values()
                   .get_function_gradients (*solutions[s],
-                                          gradients_neighbor[s]);
+                                           gradients_neighbor[s]);
 
                 // extract the
                 // gradients of all the
index 7b701a69924e1ef249c678f8c55d5ba676356525..34b06e672b499cdd56cd51d6af0c79fa844a1cc7 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS)
 {
index f71739892c4705542a496152da51e8dcdfae2c75..d6f176aac07df2a16e7634bf6cd5af344c0af73b 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/numerics/fe_field_function.templates.h>
 #include <deal.II/multigrid/mg_dof_handler.h>
index 1a8f3c9e6ba5e8ff095832c3a3142e2286087045..e124e5cce30f6f431541f205aa722acd636ae8af 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2007, 2008, 2009, 2012 by the deal.II authors
+// Copyright (C) 2007 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (VECTOR : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS)
index b80e62aa3e8d5435556381e9d0d527769468fb03..c1c89e903acbf476d836fec0fb00ff176d3173e8 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/lac/vector.h>
index 77fa2af43d032a0aeead33dcd217b1db0778eb0d..32119a2330eda2513a9ee80406e7a29b3c7e6849 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/function.h>
 #include <deal.II/base/quadrature.h>
@@ -195,8 +197,6 @@ namespace MatrixCreator
         std::vector<double>                  rhs_values;
         std::vector<dealii::Vector<double> > rhs_vector_values;
 
-        std::vector<double> old_JxW;
-
         const Function<spacedim>   *coefficient;
         const Function<spacedim>   *rhs_function;
 
@@ -206,7 +206,7 @@ namespace MatrixCreator
 
       struct CopyData
       {
-        std::vector<unsigned int> dof_indices;
+        std::vector<types::global_dof_index> dof_indices;
         FullMatrix<double>        cell_matrix;
         dealii::Vector<double>    cell_rhs;
         const ConstraintMatrix   *constraints;
@@ -840,7 +840,7 @@ namespace MatrixCreator
                                    SparseMatrix<double>      &matrix,
                                    const typename FunctionMap<spacedim>::type &boundary_functions,
                                    Vector<double>            &rhs_vector,
-                                   std::vector<unsigned int> &dof_to_boundary_mapping,
+                                   std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                    const Function<spacedim> *const coefficient,
                                    const std::vector<unsigned int> &component_mapping,
                                    const MatrixCreator::internal::IteratorRange<DoFHandler<dim,spacedim> >   range,
@@ -885,8 +885,8 @@ namespace MatrixCreator
       std::vector<Vector<double> > rhs_values_system (fe_values.n_quadrature_points,
                                                       Vector<double>(n_function_components));
 
-      std::vector<unsigned int> dofs (dofs_per_cell);
-      std::vector<unsigned int> dofs_on_face_vector (dofs_per_face);
+      std::vector<types::global_dof_index> dofs (dofs_per_cell);
+      std::vector<types::global_dof_index> dofs_on_face_vector (dofs_per_face);
 
       // for each dof on the cell, have a
       // flag whether it is on the face
@@ -1082,10 +1082,10 @@ namespace MatrixCreator
               Threads::Mutex::ScopedLock lock (mutex);
               for (unsigned int i=0; i<dofs_per_cell; ++i)
                 {
-                  if (dof_is_on_face[i] && dof_to_boundary_mapping[dofs[i]] != numbers::invalid_unsigned_int)
+                  if (dof_is_on_face[i] && dof_to_boundary_mapping[dofs[i]] != numbers::invalid_dof_index)
                     {
                       for (unsigned int j=0; j<dofs_per_cell; ++j)
-                        if (dof_is_on_face[j] && dof_to_boundary_mapping[dofs[j]] != numbers::invalid_unsigned_int)
+                        if (dof_is_on_face[j] && dof_to_boundary_mapping[dofs[j]] != numbers::invalid_dof_index)
                           {
                             Assert(numbers::is_finite(cell_matrix(i,j)), ExcNumberNotFinite());
                             matrix.add(dof_to_boundary_mapping[dofs[i]],
@@ -1108,7 +1108,7 @@ namespace MatrixCreator
                                         SparseMatrix<double> &,
                                         const FunctionMap<3>::type &,
                                         Vector<double> &,
-                                        std::vector<unsigned int> &,
+                                        std::vector<types::global_dof_index> &,
                                         const Function<3> *const ,
                                         const std::vector<unsigned int> &,
                                         const MatrixCreator::internal::IteratorRange<DoFHandler<2,3> > ,
@@ -1127,7 +1127,7 @@ namespace MatrixCreator
                                         SparseMatrix<double> &,
                                         const FunctionMap<3>::type &,
                                         Vector<double> &,
-                                        std::vector<unsigned int> &,
+                                        std::vector<types::global_dof_index> &,
                                         const Function<3> *const ,
                                         const std::vector<unsigned int> &,
                                         const MatrixCreator::internal::IteratorRange<DoFHandler<1,3> > ,
@@ -1148,7 +1148,7 @@ namespace MatrixCreator
                                SparseMatrix<double>  &matrix,
                                const typename FunctionMap<spacedim>::type  &boundary_functions,
                                Vector<double>            &rhs_vector,
-                               std::vector<unsigned int> &dof_to_boundary_mapping,
+                               std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                const Function<spacedim> *const coefficient,
                                std::vector<unsigned int> component_mapping)
   {
@@ -1208,7 +1208,7 @@ namespace MatrixCreator
      SparseMatrix<double>      &matrix,
      const typename FunctionMap<spacedim>::type &boundary_functions,
      Vector<double>            &rhs_vector,
-     std::vector<unsigned int> &dof_to_boundary_mapping,
+     std::vector<types::global_dof_index> &dof_to_boundary_mapping,
      const Function<spacedim> *const coefficient,
      const std::vector<unsigned int> &component_mapping,
      const MatrixCreator::internal::IteratorRange<DoFHandler<dim,spacedim> >   range,
@@ -1240,7 +1240,7 @@ namespace MatrixCreator
                                    SparseMatrix<double>      &matrix,
                                    const typename FunctionMap<spacedim>::type &boundary_functions,
                                    Vector<double>            &rhs_vector,
-                                   std::vector<unsigned int> &dof_to_boundary_mapping,
+                                   std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                    const Function<spacedim> *const coefficient,
                                    const std::vector<unsigned int> &component_mapping,
                                    const MatrixCreator::internal::IteratorRange<hp::DoFHandler<dim,spacedim> >   range,
@@ -1256,8 +1256,8 @@ namespace MatrixCreator
 #ifdef DEBUG
       if (true)
         {
-          unsigned int max_element = 0;
-          for (std::vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
+          types::global_dof_index max_element = static_cast<types::global_dof_index>(0);
+          for (std::vector<types::global_dof_index>::const_iterator i=dof_to_boundary_mapping.begin();
                i!=dof_to_boundary_mapping.end(); ++i)
             if ((*i != hp::DoFHandler<dim,spacedim>::invalid_dof_index) &&
                 (*i > max_element))
@@ -1276,7 +1276,7 @@ namespace MatrixCreator
       UpdateFlags update_flags = UpdateFlags (update_values     |
                                               update_JxW_values |
                                               update_quadrature_points);
-      hp::FEFaceValues<dim> x_fe_values (mapping, fe_collection, q, update_flags);
+      hp::FEFaceValues<dim,spacedim> x_fe_values (mapping, fe_collection, q, update_flags);
 
       // two variables for the coefficient,
       // one for the two cases indicated in
@@ -1287,8 +1287,8 @@ namespace MatrixCreator
       std::vector<double>          rhs_values_scalar;
       std::vector<Vector<double> > rhs_values_system;
 
-      std::vector<unsigned int> dofs (max_dofs_per_cell);
-      std::vector<unsigned int> dofs_on_face_vector (max_dofs_per_face);
+      std::vector<types::global_dof_index> dofs (max_dofs_per_cell);
+      std::vector<types::global_dof_index> dofs_on_face_vector (max_dofs_per_face);
 
       // for each dof on the cell, have a
       // flag whether it is on the face
@@ -1606,7 +1606,7 @@ namespace MatrixCreator
                                     SparseMatrix<double>      &matrix,
                                     const typename FunctionMap<spacedim>::type &rhs,
                                     Vector<double>            &rhs_vector,
-                                    std::vector<unsigned int> &dof_to_boundary_mapping,
+                                    std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                     const Function<spacedim> *const a,
                                     std::vector<unsigned int> component_mapping)
   {
@@ -1624,7 +1624,7 @@ namespace MatrixCreator
                                SparseMatrix<double>      &matrix,
                                const typename FunctionMap<spacedim>::type         &boundary_functions,
                                Vector<double>            &rhs_vector,
-                               std::vector<unsigned int> &dof_to_boundary_mapping,
+                               std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                const Function<spacedim> *const coefficient,
                                std::vector<unsigned int> component_mapping)
   {
@@ -1684,7 +1684,7 @@ namespace MatrixCreator
      SparseMatrix<double>      &matrix,
      const typename FunctionMap<spacedim>::type &boundary_functions,
      Vector<double>            &rhs_vector,
-     std::vector<unsigned int> &dof_to_boundary_mapping,
+     std::vector<types::global_dof_index> &dof_to_boundary_mapping,
      const Function<spacedim> *const coefficient,
      const std::vector<unsigned int> &component_mapping,
      const MatrixCreator::internal::IteratorRange<hp::DoFHandler<dim,spacedim> >   range,
@@ -1711,7 +1711,7 @@ namespace MatrixCreator
                                     SparseMatrix<double>      &matrix,
                                     const typename FunctionMap<spacedim>::type &rhs,
                                     Vector<double>            &rhs_vector,
-                                    std::vector<unsigned int> &dof_to_boundary_mapping,
+                                    std::vector<types::global_dof_index> &dof_to_boundary_mapping,
                                     const Function<spacedim> *const a,
                                     std::vector<unsigned int> component_mapping)
   {
@@ -1973,7 +1973,7 @@ namespace MatrixTools
 //TODO:[WB] I don't think that the optimized storage of diagonals is needed (GK)
   template <typename number>
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          SparseMatrix<number>  &matrix,
                          Vector<number>   &solution,
                          Vector<number>   &right_hand_side,
@@ -1992,7 +1992,7 @@ namespace MatrixTools
       return;
 
 
-    const unsigned int n_dofs = matrix.m();
+    const types::global_dof_index n_dofs = matrix.m();
 
     // if a diagonal entry is zero
     // later, then we use another
@@ -2009,13 +2009,13 @@ namespace MatrixTools
         }
 
 
-    std::map<unsigned int,double>::const_iterator dof  = boundary_values.begin(),
-                                                  endd = boundary_values.end();
+    std::map<types::global_dof_index,double>::const_iterator dof  = boundary_values.begin(),
+                                                             endd = boundary_values.end();
     for (; dof != endd; ++dof)
       {
         Assert (dof->first < n_dofs, ExcInternalError());
 
-        const unsigned int dof_number = dof->first;
+        const types::global_dof_index dof_number = dof->first;
         // for each boundary dof:
 
         // set entries of this line to zero except for the diagonal
@@ -2080,7 +2080,7 @@ namespace MatrixTools
                  q = matrix.begin(dof_number)+1;
                  q != matrix.end(dof_number); ++q)
               {
-                const unsigned int row = q->column();
+                const types::global_dof_index row = q->column();
 
                 // find the position of
                 // element
@@ -2127,7 +2127,7 @@ namespace MatrixTools
 
   template <typename number>
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          BlockSparseMatrix<number>  &matrix,
                          BlockVector<number>   &solution,
                          BlockVector<number>   &right_hand_side,
@@ -2157,7 +2157,7 @@ namespace MatrixTools
       return;
 
 
-    const unsigned int n_dofs = matrix.m();
+    const types::global_dof_index n_dofs = matrix.m();
 
     // if a diagonal entry is zero
     // later, then we use another
@@ -2187,8 +2187,8 @@ namespace MatrixTools
       first_nonzero_diagonal_entry = 1;
 
 
-    std::map<unsigned int,double>::const_iterator dof  = boundary_values.begin(),
-                                                  endd = boundary_values.end();
+    std::map<types::global_dof_index,double>::const_iterator dof  = boundary_values.begin(),
+                                                             endd = boundary_values.end();
     const BlockSparsityPattern &
     sparsity_pattern = matrix.get_sparsity_pattern();
 
@@ -2208,8 +2208,8 @@ namespace MatrixTools
         // get global index and index
         // in the block in which this
         // dof is located
-        const unsigned int dof_number = dof->first;
-        const std::pair<unsigned int,unsigned int>
+        const types::global_dof_index dof_number = dof->first;
+        const std::pair<unsigned int,types::global_dof_index>
         block_index = index_mapping.global_to_local (dof_number);
 
         // for each boundary dof:
@@ -2322,7 +2322,7 @@ namespace MatrixTools
                     // get the number of the column in this row in which a
                     // nonzero entry is. this is also the row of the transpose
                     // block which has an entry in the interesting row
-                    const unsigned int row = q->column();
+                    const types::global_dof_index row = q->column();
 
                     // find the position of element (row,dof_number) in this
                     // block (not in the transpose one). note that we have to
@@ -2391,7 +2391,7 @@ namespace MatrixTools
     {
       template <typename PETScMatrix, typename PETScVector>
       void
-      apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+      apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                              PETScMatrix      &matrix,
                              PETScVector      &solution,
                              PETScVector      &right_hand_side,
@@ -2409,7 +2409,7 @@ namespace MatrixTools
         if (boundary_values.size() == 0)
           return;
 
-        const std::pair<unsigned int, unsigned int> local_range
+        const std::pair<types::global_dof_index, types::global_dof_index> local_range
           = matrix.local_range();
         Assert (local_range == right_hand_side.local_range(),
                 ExcInternalError());
@@ -2421,7 +2421,7 @@ namespace MatrixTools
         // matrix that we can see. if we can't
         // find such an entry, take one
         PetscScalar average_nonzero_diagonal_entry = 1;
-        for (unsigned int i=local_range.first; i<local_range.second; ++i)
+        for (types::global_dof_index i=local_range.first; i<local_range.second; ++i)
           if (matrix.diag_element(i) != 0)
             {
               average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
@@ -2430,8 +2430,8 @@ namespace MatrixTools
 
         // figure out which rows of the matrix we
         // have to eliminate on this processor
-        std::vector<unsigned int> constrained_rows;
-        for (std::map<unsigned int,double>::const_iterator
+        std::vector<types::global_dof_index> constrained_rows;
+        for (std::map<types::global_dof_index,double>::const_iterator
              dof  = boundary_values.begin();
              dof != boundary_values.end();
              ++dof)
@@ -2452,9 +2452,9 @@ namespace MatrixTools
         // treated in the other functions.
         matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
 
-        std::vector<unsigned int> indices;
+        std::vector<types::global_dof_index> indices;
         std::vector<PetscScalar>  solution_values;
-        for (std::map<unsigned int,double>::const_iterator
+        for (std::map<types::global_dof_index,double>::const_iterator
              dof  = boundary_values.begin();
              dof != boundary_values.end();
              ++dof)
@@ -2484,7 +2484,7 @@ namespace MatrixTools
 
 
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          PETScWrappers::SparseMatrix   &matrix,
                          PETScWrappers::Vector   &solution,
                          PETScWrappers::Vector   &right_hand_side,
@@ -2499,7 +2499,7 @@ namespace MatrixTools
 
 
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          PETScWrappers::MPI::SparseMatrix   &matrix,
                          PETScWrappers::MPI::Vector   &solution,
                          PETScWrappers::MPI::Vector   &right_hand_side,
@@ -2516,8 +2516,8 @@ namespace MatrixTools
 
 
   void
-  apply_boundary_values (const std::map<unsigned int,double>  &boundary_values,
-                         PETScWrappers::MPI::BlockSparseMatrix  &matrix,
+  apply_boundary_values (const std::map<types::global_dof_index,double>  &boundary_values,
+                         PETScWrappers::MPI::BlockSparseMatrix &matrix,
                          PETScWrappers::MPI::BlockVector        &solution,
                          PETScWrappers::MPI::BlockVector        &right_hand_side,
                          const bool                            eliminate_columns)
@@ -2537,10 +2537,11 @@ namespace MatrixTools
     // into blocks for the boundary values.
     // To this end, generate a vector of
     // maps with the respective indices.
-    std::vector<std::map<unsigned int,double> > block_boundary_values(n_blocks);
+    std::vector<std::map<dealii::types::global_dof_index,double> > block_boundary_values(n_blocks);
     {
-      int offset = 0, block=0;
-      for (std::map<unsigned int,double>::const_iterator
+      int block = 0;
+      dealii::types::global_dof_index offset = 0;
+      for (std::map<types::global_dof_index,double>::const_iterator
            dof  = boundary_values.begin();
            dof != boundary_values.end();
            ++dof)
@@ -2550,8 +2551,8 @@ namespace MatrixTools
               offset += matrix.block(block,0).m();
               block++;
             }
-          const unsigned int index = dof->first - offset;
-          block_boundary_values[block].insert(std::pair<unsigned int, double> (index,dof->second));
+          const types::global_dof_index index = dof->first - offset;
+          block_boundary_values[block].insert(std::pair<types::global_dof_index, double> (index,dof->second));
         }
     }
 
@@ -2571,11 +2572,11 @@ namespace MatrixTools
     // the whole row.
     for (unsigned int block_m=0; block_m<n_blocks; ++block_m)
       {
-        const std::pair<unsigned int, unsigned int> local_range
+        const std::pair<types::global_dof_index, types::global_dof_index> local_range
           = matrix.block(block_m,0).local_range();
 
-        std::vector<unsigned int> constrained_rows;
-        for (std::map<unsigned int,double>::const_iterator
+        std::vector<types::global_dof_index> constrained_rows;
+        for (std::map<types::global_dof_index,double>::const_iterator
              dof  = block_boundary_values[block_m].begin();
              dof != block_boundary_values[block_m].end();
              ++dof)
@@ -2601,7 +2602,7 @@ namespace MatrixTools
     {
       template <typename TrilinosMatrix, typename TrilinosVector>
       void
-      apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+      apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                              TrilinosMatrix      &matrix,
                              TrilinosVector      &solution,
                              TrilinosVector      &right_hand_side,
@@ -2619,7 +2620,7 @@ namespace MatrixTools
         if (boundary_values.size() == 0)
           return;
 
-        const std::pair<unsigned int, unsigned int> local_range
+        const std::pair<types::global_dof_index, types::global_dof_index> local_range
           = matrix.local_range();
         Assert (local_range == right_hand_side.local_range(),
                 ExcInternalError());
@@ -2637,7 +2638,7 @@ namespace MatrixTools
         // matrix that we can see. if we can't
         // find such an entry, take one
         TrilinosScalar average_nonzero_diagonal_entry = 1;
-        for (unsigned int i=local_range.first; i<local_range.second; ++i)
+        for (types::global_dof_index i=local_range.first; i<local_range.second; ++i)
           if (matrix.diag_element(i) != 0)
             {
               average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
@@ -2646,8 +2647,8 @@ namespace MatrixTools
 
         // figure out which rows of the matrix we
         // have to eliminate on this processor
-        std::vector<unsigned int> constrained_rows;
-        for (std::map<unsigned int,double>::const_iterator
+        std::vector<types::global_dof_index> constrained_rows;
+        for (std::map<types::global_dof_index,double>::const_iterator
              dof  = boundary_values.begin();
              dof != boundary_values.end();
              ++dof)
@@ -2664,9 +2665,9 @@ namespace MatrixTools
         // matrix classes in deal.II.
         matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
 
-        std::vector<unsigned int> indices;
+        std::vector<types::global_dof_index> indices;
         std::vector<TrilinosScalar>  solution_values;
-        for (std::map<unsigned int,double>::const_iterator
+        for (std::map<types::global_dof_index,double>::const_iterator
              dof  = boundary_values.begin();
              dof != boundary_values.end();
              ++dof)
@@ -2695,7 +2696,7 @@ namespace MatrixTools
 
       template <typename TrilinosMatrix, typename TrilinosBlockVector>
       void
-      apply_block_boundary_values (const std::map<unsigned int,double> &boundary_values,
+      apply_block_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                                    TrilinosMatrix      &matrix,
                                    TrilinosBlockVector &solution,
                                    TrilinosBlockVector &right_hand_side,
@@ -2718,10 +2719,11 @@ namespace MatrixTools
         // into blocks for the boundary values.
         // To this end, generate a vector of
         // maps with the respective indices.
-        std::vector<std::map<unsigned int,double> > block_boundary_values(n_blocks);
+        std::vector<std::map<types::global_dof_index,double> > block_boundary_values(n_blocks);
         {
-          int offset = 0, block=0;
-          for (std::map<unsigned int,double>::const_iterator
+          int block=0;
+          types::global_dof_index offset = 0;
+          for (std::map<types::global_dof_index,double>::const_iterator
                dof  = boundary_values.begin();
                dof != boundary_values.end();
                ++dof)
@@ -2731,9 +2733,9 @@ namespace MatrixTools
                   offset += matrix.block(block,0).m();
                   block++;
                 }
-              const unsigned int index = dof->first - offset;
+              const types::global_dof_index index = dof->first - offset;
               block_boundary_values[block].insert(
-                std::pair<unsigned int, double> (index,dof->second));
+                std::pair<types::global_dof_index, double> (index,dof->second));
             }
         }
 
@@ -2753,11 +2755,11 @@ namespace MatrixTools
         // the whole row.
         for (unsigned int block_m=0; block_m<n_blocks; ++block_m)
           {
-            const std::pair<unsigned int, unsigned int> local_range
+            const std::pair<types::global_dof_index, types::global_dof_index> local_range
               = matrix.block(block_m,0).local_range();
 
-            std::vector<unsigned int> constrained_rows;
-            for (std::map<unsigned int,double>::const_iterator
+            std::vector<types::global_dof_index> constrained_rows;
+            for (std::map<types::global_dof_index,double>::const_iterator
                  dof  = block_boundary_values[block_m].begin();
                  dof != block_boundary_values[block_m].end();
                  ++dof)
@@ -2777,7 +2779,7 @@ namespace MatrixTools
 
 
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          TrilinosWrappers::SparseMatrix   &matrix,
                          TrilinosWrappers::Vector         &solution,
                          TrilinosWrappers::Vector         &right_hand_side,
@@ -2792,7 +2794,7 @@ namespace MatrixTools
 
 
   void
-  apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
                          TrilinosWrappers::SparseMatrix   &matrix,
                          TrilinosWrappers::MPI::Vector    &solution,
                          TrilinosWrappers::MPI::Vector    &right_hand_side,
@@ -2807,8 +2809,8 @@ namespace MatrixTools
 
 
   void
-  apply_boundary_values (const std::map<unsigned int,double>  &boundary_values,
-                         TrilinosWrappers::BlockSparseMatrix  &matrix,
+  apply_boundary_values (const std::map<types::global_dof_index,double>  &boundary_values,
+                         TrilinosWrappers::BlockSparseMatrix &matrix,
                          TrilinosWrappers::BlockVector        &solution,
                          TrilinosWrappers::BlockVector        &right_hand_side,
                          const bool                            eliminate_columns)
@@ -2821,8 +2823,8 @@ namespace MatrixTools
 
 
   void
-  apply_boundary_values (const std::map<unsigned int,double>  &boundary_values,
-                         TrilinosWrappers::BlockSparseMatrix  &matrix,
+  apply_boundary_values (const std::map<types::global_dof_index,double>  &boundary_values,
+                         TrilinosWrappers::BlockSparseMatrix &matrix,
                          TrilinosWrappers::MPI::BlockVector   &solution,
                          TrilinosWrappers::MPI::BlockVector   &right_hand_side,
                          const bool                            eliminate_columns)
@@ -2837,8 +2839,8 @@ namespace MatrixTools
 
 
   void
-  local_apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
-                               const std::vector<unsigned int> &local_dof_indices,
+  local_apply_boundary_values (const std::map<types::global_dof_index,double> &boundary_values,
+                               const std::vector<types::global_dof_index> &local_dof_indices,
                                FullMatrix<double> &local_matrix,
                                Vector<double>     &local_rhs,
                                const bool          eliminate_columns)
@@ -2885,7 +2887,7 @@ namespace MatrixTools
     const unsigned int n_local_dofs = local_dof_indices.size();
     for (unsigned int i=0; i<n_local_dofs; ++i)
       {
-        const std::map<unsigned int, double>::const_iterator
+        const std::map<types::global_dof_index, double>::const_iterator
         boundary_value = boundary_values.find (local_dof_indices[i]);
         if (boundary_value != boundary_values.end())
           {
@@ -2959,14 +2961,14 @@ namespace MatrixTools
 {
   template
   void
-  apply_boundary_values<double> (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values<double> (const std::map<types::global_dof_index,double> &boundary_values,
                                  SparseMatrix<double>  &matrix,
                                  Vector<double>   &solution,
                                  Vector<double>   &right_hand_side,
                                  const bool        eliminate_columns);
   template
   void
-  apply_boundary_values<float> (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values<float> (const std::map<types::global_dof_index,double> &boundary_values,
                                 SparseMatrix<float>  &matrix,
                                 Vector<float>   &solution,
                                 Vector<float>   &right_hand_side,
@@ -2974,14 +2976,14 @@ namespace MatrixTools
 
   template
   void
-  apply_boundary_values<double> (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values<double> (const std::map<types::global_dof_index,double> &boundary_values,
                                  BlockSparseMatrix<double>  &matrix,
                                  BlockVector<double>   &solution,
                                  BlockVector<double>   &right_hand_side,
                                  const bool        eliminate_columns);
   template
   void
-  apply_boundary_values<float> (const std::map<unsigned int,double> &boundary_values,
+  apply_boundary_values<float> (const std::map<types::global_dof_index,double> &boundary_values,
                                 BlockSparseMatrix<float>  &matrix,
                                 BlockVector<float>   &solution,
                                 BlockVector<float>   &right_hand_side,
index 07c6301155b9618b9b2d63d744f6acf797400f3b..211ccdac5b635c0ddb321070ba0828c748375b54 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2010, 2012 by the deal.II authors
+// Copyright (C) 2010 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
@@ -93,7 +97,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
        SparseMatrix<double>      &matrix,
        const FunctionMap<deal_II_space_dimension>::type &rhs,
        Vector<double>            &rhs_vector,
-       std::vector<unsigned int> &dof_to_boundary_mapping,
+       std::vector<types::global_dof_index> &dof_to_boundary_mapping,
        const Function<deal_II_space_dimension> * const a,
        std::vector<unsigned int>);
 
@@ -105,12 +109,33 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
        SparseMatrix<double>      &matrix,
        const FunctionMap<deal_II_space_dimension>::type &rhs,
        Vector<double>            &rhs_vector,
-       std::vector<unsigned int> &dof_to_boundary_mapping,
+       std::vector<types::global_dof_index> &dof_to_boundary_mapping,
        const Function<deal_II_space_dimension> * const a,
        std::vector<unsigned int>);
 
+    template
+      void
+      MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_space_dimension>
+      (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>&,
+       const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>&,
+       const hp::QCollection<deal_II_dimension-1>&,
+       SparseMatrix<double>&,
+       const FunctionMap<deal_II_space_dimension>::type&,
+       Vector<double>&,
+       std::vector<types::global_dof_index>&,
+       const Function<deal_II_space_dimension> * const,
+       std::vector<unsigned int>);
 
-
+    template
+      void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_space_dimension>
+      (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>&,
+       const hp::QCollection<deal_II_dimension-1>&,
+       SparseMatrix<double>&,
+       const FunctionMap<deal_II_space_dimension>::type&,
+       Vector<double>&,
+       std::vector<types::global_dof_index>&,
+       const Function<deal_II_space_dimension> * const,
+       std::vector<unsigned int>);
 
 #endif
   }
@@ -120,111 +145,88 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
 // where applicable and move to codimension cases above also when applicable
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
-#if deal_II_dimension == deal_II_space_dimension
-
+#if deal_II_dimension <= deal_II_space_dimension
 // hp versions of functions
     template
-      void MatrixCreator::create_mass_matrix<deal_II_dimension>
-      (const hp::MappingCollection<deal_II_dimension>       &mapping,
-       const hp::DoFHandler<deal_II_dimension>    &dof,
+      void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_space_dimension>
+      (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>       &mapping,
+       const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>    &dof,
        const hp::QCollection<deal_II_dimension>    &q,
        SparseMatrix<double>     &matrix,
-       const Function<deal_II_dimension> * const coefficient,
+       const Function<deal_II_space_dimension> * const coefficient,
        const ConstraintMatrix   &constraints);
+
     template
-      void MatrixCreator::create_mass_matrix<deal_II_dimension>
-      (const hp::DoFHandler<deal_II_dimension>    &dof,
+      void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_space_dimension>
+      (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>       &mapping,
+       const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>    &dof,
        const hp::QCollection<deal_II_dimension>    &q,
        SparseMatrix<double>     &matrix,
-       const Function<deal_II_dimension> * const coefficient,
+       const Function<deal_II_space_dimension>      &rhs,
+       Vector<double>           &rhs_vector,
+       const Function<deal_II_space_dimension> * const coefficient,
        const ConstraintMatrix   &constraints);
+
     template
       void MatrixCreator::create_mass_matrix<deal_II_dimension>
-      (const hp::MappingCollection<deal_II_dimension>       &mapping,
-       const hp::DoFHandler<deal_II_dimension>    &dof,
+      (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>       &mapping,
+       const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>    &dof,
        const hp::QCollection<deal_II_dimension>    &q,
-       SparseMatrix<double>     &matrix,
-       const Function<deal_II_dimension>      &rhs,
+       SparseMatrix<float>     &matrix,
+       const Function<deal_II_space_dimension>      &rhs,
        Vector<double>           &rhs_vector,
-       const Function<deal_II_dimension> * const coefficient,
+       const Function<deal_II_space_dimension> * const coefficient,
        const ConstraintMatrix   &constraints);
+
     template
       void MatrixCreator::create_mass_matrix<deal_II_dimension>
-      (const hp::DoFHandler<deal_II_dimension>    &dof,
+      (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>    &dof,
        const hp::QCollection<deal_II_dimension>    &q,
-       SparseMatrix<double>     &matrix,
-       const Function<deal_II_dimension>      &rhs,
+       SparseMatrix<float>     &matrix,
+       const Function<deal_II_space_dimension>      &rhs,
        Vector<double>           &rhs_vector,
-       const Function<deal_II_dimension> * const coefficient,
+       const Function<deal_II_space_dimension> * const coefficient,
        const ConstraintMatrix   &constraints);
 
+#endif
 
+#if deal_II_dimension == deal_II_space_dimension
+
+       
     template
       void MatrixCreator::create_mass_matrix<deal_II_dimension>
-      (const hp::MappingCollection<deal_II_dimension>       &mapping,
-       const hp::DoFHandler<deal_II_dimension>    &dof,
+      (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>    &dof,
        const hp::QCollection<deal_II_dimension>    &q,
-       SparseMatrix<float>     &matrix,
-       const Function<deal_II_dimension> * const coefficient,
+       SparseMatrix<double>     &matrix,
+       const Function<deal_II_space_dimension> * const coefficient,
        const ConstraintMatrix   &constraints);
+
     template
       void MatrixCreator::create_mass_matrix<deal_II_dimension>
-      (const hp::DoFHandler<deal_II_dimension>    &dof,
+      (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>    &dof,
        const hp::QCollection<deal_II_dimension>    &q,
-       SparseMatrix<float>     &matrix,
-       const Function<deal_II_dimension> * const coefficient,
+       SparseMatrix<double>     &matrix,
+       const Function<deal_II_space_dimension>      &rhs,
+       Vector<double>           &rhs_vector,
+       const Function<deal_II_space_dimension> * const coefficient,
        const ConstraintMatrix   &constraints);
+
     template
       void MatrixCreator::create_mass_matrix<deal_II_dimension>
-      (const hp::MappingCollection<deal_II_dimension>       &mapping,
-       const hp::DoFHandler<deal_II_dimension>    &dof,
+      (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>       &mapping,
+       const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>    &dof,
        const hp::QCollection<deal_II_dimension>    &q,
        SparseMatrix<float>     &matrix,
-       const Function<deal_II_dimension>      &rhs,
-       Vector<double>           &rhs_vector,
-       const Function<deal_II_dimension> * const coefficient,
+       const Function<deal_II_space_dimension> * const coefficient,
        const ConstraintMatrix   &constraints);
+       
     template
       void MatrixCreator::create_mass_matrix<deal_II_dimension>
-      (const hp::DoFHandler<deal_II_dimension>    &dof,
+      (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>    &dof,
        const hp::QCollection<deal_II_dimension>    &q,
        SparseMatrix<float>     &matrix,
-       const Function<deal_II_dimension>      &rhs,
-       Vector<double>           &rhs_vector,
-       const Function<deal_II_dimension> * const coefficient,
-       const ConstraintMatrix   &constraints);
-
-
-#if deal_II_dimension != 1
-
-
-
-    template
-      void
-      MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
-      (const hp::MappingCollection<deal_II_dimension>&,
-       const hp::DoFHandler<deal_II_dimension>&,
-       const hp::QCollection<deal_II_dimension-1>&,
-       SparseMatrix<double>&,
-       const FunctionMap<deal_II_dimension>::type&,
-       Vector<double>&,
-       std::vector<unsigned int>&,
-       const Function<deal_II_dimension> * const,
-       std::vector<unsigned int>);
-
-    template
-      void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
-      (const hp::DoFHandler<deal_II_dimension>&,
-       const hp::QCollection<deal_II_dimension-1>&,
-       SparseMatrix<double>&,
-       const FunctionMap<deal_II_dimension>::type&,
-       Vector<double>&,
-       std::vector<unsigned int>&,
-       const Function<deal_II_dimension> * const,
-       std::vector<unsigned int>);
-
-#endif
-
+       const Function<deal_II_space_dimension> * const coefficient,
+       const ConstraintMatrix   &constraints);       
 
 // non-hp versions of create_laplace_matrix
     template
index 57d6262b7dde5db4aa6752b9947d29e1798ae1a5..c7b849693b6cc991ed42f415b1a79e7fe0ed93d7 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009, 2010, 2012 by Michael Rapson and the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/block_vector.h>
@@ -39,7 +43,7 @@ namespace internal
     PointGeometryData<dim>
     ::PointGeometryData (const Point <dim> &new_requested_location,
                          const std::vector <Point <dim> > &new_locations,
-                         const std::vector <int> &new_sol_indices)
+                         const std::vector <types::global_dof_index> &new_sol_indices)
     {
       requested_location = new_requested_location;
       support_point_locations = new_locations;
@@ -268,9 +272,9 @@ void PointValueHistory<dim>
     }
 
 
-  std::vector<unsigned int>
+  std::vector<types::global_dof_index>
   local_dof_indices (dof_handler->get_fe ().dofs_per_cell);
-  std::vector <int> new_solution_indices;
+  std::vector <types::global_dof_index> new_solution_indices;
   current_cell->get_dof_indices (local_dof_indices);
   // there is an implicit assumption here
   // that all the closest support point to
@@ -411,11 +415,11 @@ void PointValueHistory<dim>
         }
     }
 
-  std::vector<unsigned int> local_dof_indices (dof_handler->get_fe ().dofs_per_cell);
+  std::vector<types::global_dof_index> local_dof_indices (dof_handler->get_fe ().dofs_per_cell);
   for (unsigned int point = 0; point < locations.size (); point++)
     {
       current_cell[point]->get_dof_indices (local_dof_indices);
-      std::vector <int> new_solution_indices;
+      std::vector<types::global_dof_index> new_solution_indices;
 
       for (unsigned int component = 0; component < dof_handler->get_fe ().n_components (); component++)
         {
index e175ccbb234a3184765efbe17bcd00d761a16b1d..c3ae1f0896881d1d157697e33c6e14f3da306ddf 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2009 by Michael Rapson and the deal.II authors
+// Copyright (C) 2009 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 
 for (deal_II_dimension : DIMENSIONS)
index d10e394da6ba257cdaeac26935bf1f9dca23e732..0a40a40830a5c6b4482322212085b9d7cbc3b577 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/grid/tria.h>
@@ -76,7 +78,7 @@ void SolutionTransfer<dim, VECTOR, DH>::prepare_for_pure_refinement()
   n_dofs_old=dof_handler->n_dofs();
 
   // efficient reallocation of indices_on_cell
-  std::vector<std::vector<unsigned int> > (n_active_cells)
+  std::vector<std::vector<types::global_dof_index> > (n_active_cells)
   .swap(indices_on_cell);
 
   typename DH::active_cell_iterator cell = dof_handler->begin_active(),
@@ -291,7 +293,7 @@ prepare_for_coarsening_and_refinement(const std::vector<VECTOR> &all_in)
   // allocate the needed memory. initialize
   // the following arrays in an efficient
   // way, without copying much
-  std::vector<std::vector<unsigned int> >
+  std::vector<std::vector<types::global_dof_index> >
   (n_cells_to_stay_or_refine)
   .swap(indices_on_cell);
 
@@ -498,7 +500,7 @@ interpolate (const std::vector<VECTOR> &all_in,
                          " at the same time!"));
 
   Vector<typename VECTOR::value_type> local_values;
-  std::vector<unsigned int> dofs;
+  std::vector<types::global_dof_index> dofs;
 
   typename std::map<std::pair<unsigned int, unsigned int>, Pointerstruct>::const_iterator
   pointerstruct,
@@ -516,7 +518,7 @@ interpolate (const std::vector<VECTOR> &all_in,
 
       if (pointerstruct!=cell_map_end)
         {
-          const std::vector<unsigned int> *const indexptr
+          const std::vector<types::global_dof_index> *const indexptr
             =pointerstruct->second.indices_ptr;
 
           const std::vector<Vector<typename VECTOR::value_type> > *const valuesptr
index 5d8ec479d6b8116e05e80a662f3eefd76b649118..fe64874d34b75e094cdfd9be0dd190490d63768d 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
index e903f0435323d47c94494c18698f5a4aeaf95751..09c0cde1031424eafa4bb4ec56163d5e34e094db 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id:  $
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 2013 by the deal.II authors
+// Copyright (C) 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 // This file compiles the second half of the instantiations from solution_transfer.cc
 // to get the memory consumption below 1.5gb with gcc (if compiling with PETSc and Trilinos).
index 8944ad436cadd1804214a72ef5575f0b93bfce1c..97db6b277bac25f31d62a1e23a7fb934289f72ec 100644 (file)
@@ -1,16 +1,18 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
+// Copyright (C) 1999 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
-
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
 
 #include <deal.II/numerics/time_dependent.h>
 #include <deal.II/base/memory_consumption.h>
@@ -215,8 +217,8 @@ void TimeDependent::end_sweep ()
   void (TimeDependent::*p) (const unsigned int, const unsigned int)
     = &TimeDependent::end_sweep;
   parallel::apply_to_subranges (0U, timesteps.size(),
-                               std_cxx1x::bind (p, this, std_cxx1x::_1, std_cxx1x::_2),
-                               1);
+                                std_cxx1x::bind (p, this, std_cxx1x::_1, std_cxx1x::_2),
+                                1);
 }
 
 
index 863f5d55245cd04d3d07ef441d1b06c3216ecb6b..b851acc61cea740b3991599c0dccb3ed00995474 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (deal_II_dimension : DIMENSIONS)
 {
index af44a3a505e3486a3cc65dbd30d57a7c0f1a56f4..fe9539c1d0f736331ccd26797e61dc0514f19426 100644 (file)
@@ -1,15 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 #include <deal.II/numerics/vector_tools.templates.h>
 
index d4f394f95c6e342f7df9d09d8f323977c146cf7f..7d0327b86645ffbea5a538091547d7b7e1ad6f9f 100644 (file)
@@ -1,14 +1,19 @@
-//---------------------------------------------------------------------------
-//    $Id$
+// ---------------------------------------------------------------------
+// $Id$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
 //
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
+// This file is part of the deal.II library.
 //
-//---------------------------------------------------------------------------
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
 
 for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
@@ -113,6 +118,29 @@ for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_dimens
          const bool,
          const Quadrature<deal_II_dimension-1> &,
          const bool);
+
+      template
+        void project
+        (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>      &,
+         const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>   &,
+         const ConstraintMatrix                &,
+         const hp::QCollection<deal_II_dimension>   &,
+         const Function<deal_II_space_dimension>     &,
+         VEC                                   &,
+         const bool,
+         const hp::QCollection<deal_II_dimension-1> &,
+         const bool);
+
+      template
+        void project
+        (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>   &,
+         const ConstraintMatrix                &,
+         const hp::QCollection<deal_II_dimension>   &,
+         const Function<deal_II_space_dimension>     &,
+         VEC                                   &,
+         const bool,
+         const hp::QCollection<deal_II_dimension-1> &,
+         const bool);
       \}
 #endif
   }
@@ -293,7 +321,7 @@ for (deal_II_dimension : DIMENSIONS)
           const MGDoFHandler<deal_II_dimension> &,
           const types::boundary_id,
           const Function<deal_II_dimension>   &,
-          std::map<unsigned int,double>       &,
+          std::map<types::global_dof_index,double>       &,
           const ComponentMask    &);
     \}
 }
@@ -308,7 +336,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS;
         (const Mapping<deal_II_dimension,deal_II_space_dimension>    &,
          const DH<deal_II_dimension,deal_II_space_dimension> &,
          const FunctionMap<deal_II_space_dimension>::type &,
-         std::map<unsigned int,double>       &,
+         std::map<types::global_dof_index,double>       &,
          const ComponentMask    &);
 
       template
@@ -317,7 +345,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS;
          const DH<deal_II_dimension,deal_II_space_dimension> &,
          const types::boundary_id,
          const Function<deal_II_space_dimension>   &,
-         std::map<unsigned int,double>       &,
+         std::map<types::global_dof_index,double>       &,
          const ComponentMask    &);
 
       template
@@ -325,14 +353,14 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS;
           const DH<deal_II_dimension,deal_II_space_dimension> &,
           const types::boundary_id,
           const Function<deal_II_space_dimension>   &,
-          std::map<unsigned int,double>       &,
+          std::map<types::global_dof_index,double>       &,
           const ComponentMask    &);
 
       template
         void interpolate_boundary_values
         (const DH<deal_II_dimension,deal_II_space_dimension> &,
          const FunctionMap<deal_II_space_dimension>::type &,
-         std::map<unsigned int,double>       &,
+         std::map<types::global_dof_index,double>       &,
          const ComponentMask    &);
 
       template
@@ -399,8 +427,28 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
 // where applicable and move to codimension cases above also when applicable
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
   {
-#if deal_II_dimension == deal_II_space_dimension
     namespace VectorTools \{
+
+#if deal_II_dimension <= deal_II_space_dimension
+      template
+        void project_boundary_values<deal_II_dimension,deal_II_space_dimension>
+        (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>  &,
+         const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>  &,
+         const FunctionMap<deal_II_space_dimension>::type &,
+         const hp::QCollection<deal_II_dimension-1>&,
+         std::map<types::global_dof_index,double>&, 
+         std::vector<unsigned int>);
+
+      template
+        void project_boundary_values<deal_II_dimension,deal_II_space_dimension>
+        (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>  &,
+         const FunctionMap<deal_II_space_dimension>::type &,
+         const hp::QCollection<deal_II_dimension-1>&,
+         std::map<types::global_dof_index,double>&, 
+         std::vector<unsigned int>);
+#endif
+
+#if deal_II_dimension == deal_II_space_dimension
       template
         void create_right_hand_side<deal_II_dimension>
         (const hp::MappingCollection<deal_II_dimension>    &,
@@ -513,38 +561,22 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
 
 
 
-#if deal_II_dimension > 1
       template
         void project_boundary_values<deal_II_dimension>
         (const Mapping<deal_II_dimension>     &,
          const DoFHandler<deal_II_dimension>  &,
          const FunctionMap<deal_II_dimension>::type &,
          const Quadrature<deal_II_dimension-1>&,
-         std::map<unsigned int,double>&, std::vector<unsigned int>);
-#endif
+         std::map<types::global_dof_index,double>&, std::vector<unsigned int>);
 
       template
         void project_boundary_values<deal_II_dimension>
         (const DoFHandler<deal_II_dimension>  &,
          const FunctionMap<deal_II_dimension>::type &,
          const Quadrature<deal_II_dimension-1>&,
-         std::map<unsigned int,double>&, std::vector<unsigned int>);
-
-
-      template
-        void project_boundary_values<deal_II_dimension>
-        (const Mapping<deal_II_dimension>     &,
-         const DoFHandler<deal_II_dimension>  &,
-         const FunctionMap<deal_II_dimension>::type &,
-         const Quadrature<deal_II_dimension-1>&,
-         ConstraintMatrix&, std::vector<unsigned int>);
+         std::map<types::global_dof_index,double>&, 
+         std::vector<unsigned int>);
 
-      template
-        void project_boundary_values<deal_II_dimension>
-        (const DoFHandler<deal_II_dimension>  &,
-         const FunctionMap<deal_II_dimension>::type &,
-         const Quadrature<deal_II_dimension-1>&,
-         ConstraintMatrix&, std::vector<unsigned int>);
 
 
 #if deal_II_dimension != 1
@@ -595,8 +627,8 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
                                             ConstraintMatrix      &constraints,
                                             const Mapping<deal_II_dimension>    &mapping);
 #endif
-      \}
 #endif
+      \}
   }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.